Skip to content

Commit

Permalink
Rd2latex() no longer outputs an \inputencoding line by default
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.r-project.org/R/trunk@87676 00db46b3-68df-0310-9c12-caf00c1e9a41
  • Loading branch information
smeyer committed Feb 2, 2025
1 parent b898130 commit be2890f
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 11 deletions.
4 changes: 4 additions & 0 deletions doc/NEWS.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,10 @@
or package manuals using \command{R CMD Rd2pdf}, it is ensured
that this \R's \file{Rd.sty} takes precedence over any other
(incompatible) versions in default \dQuote{texmf trees}.
\item \code{tools::Rd2latex()} no longer outputs an
\samp{\\inputencoding{utf8}} line by default;
such a declaration is obsolete since \LaTeX 2018-04-01.
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/library/tools/R/Rd2latex.R
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ latex_canonical_encoding <- function(encoding)
Rd2latex <- function(Rd, out = "", defines = .Platform$OS.type,
stages = "render",
outputEncoding = "UTF-8", fragment = FALSE, ...,
writeEncoding = TRUE,
writeEncoding = outputEncoding != "UTF-8",
concordance = FALSE)
{
encode_warn <- FALSE
Expand Down
17 changes: 9 additions & 8 deletions src/library/tools/man/Rd2HTML.Rd
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
% File src/library/tools/man/Rd2HTML.Rd
% Part of the R package, https://www.R-project.org
% Copyright 2008-2022 R Core Team
% Copyright 2008-2025 R Core Team
% Distributed under GPL 2 or later

\name{Rd2HTML}
Expand Down Expand Up @@ -34,7 +34,7 @@ Rd2txt(Rd, out = "", package = "", defines = .Platform$OS.type,

Rd2latex(Rd, out = "", defines = .Platform$OS.type,
stages = "render", outputEncoding = "UTF-8",
fragment = FALSE, ..., writeEncoding = TRUE,
fragment = FALSE, ..., writeEncoding = outputEncoding != "UTF-8",
concordance = FALSE)

Rd2ex(Rd, out = "", defines = .Platform$OS.type,
Expand Down Expand Up @@ -75,7 +75,7 @@ Rd2ex(Rd, out = "", defines = .Platform$OS.type,
standalone HTML file. If \code{FALSE}, the header and footer are
omitted, so that the output can be combined with other fragments.
}
\item{hooks}{A list of functions controlling details of
\item{hooks}{a list of functions controlling details of
output. Currently the only component used is \code{pkg_href}, which
is used by \code{pkg2HTML} to determine the output HTML file path
given a package name as input. }
Expand All @@ -86,15 +86,16 @@ Rd2ex(Rd, out = "", defines = .Platform$OS.type,
examples section is wrapped inside a \code{rcode} block. }
\item{Links, Links2}{\code{NULL} or a named (by topics) character vector of
links, as returned by \code{\link{findHTMLlinks}}.}
\item{options}{An optional named list of options to pass to
\item{options}{an optional named list of options to pass to
\code{\link{Rd2txt_options}}.}
\item{...}{ additional parameters to pass to \code{\link{parse_Rd}} when
\code{Rd} is a filename. }
\item{writeEncoding}{should \verb{\inputencoding} lines be written in
the file for non-ASCII encodings?}
\item{commentDontrun}{should \verb{\dontrun} sections be commented
\item{writeEncoding}{logical: should an \verb{\inputencoding} line be written
for non-ASCII encodings? \LaTeX release 2018-04-01 and later
default to UTF-8; the declaration is obsolete in that case.}
\item{commentDontrun}{logical: should \verb{\dontrun} sections be commented
out?}
\item{commentDonttest}{should \verb{\donttest} sections be commented out?}
\item{commentDonttest}{logical: should \verb{\donttest} sections be commented out?}
}
\details{
These functions convert help documents: \code{Rd2HTML} produces HTML,
Expand Down
1 change: 0 additions & 1 deletion tests/testit.tex.save
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
\inputencoding{utf8}
\HeaderA{testit}{An Rd Regression Test}{testit}
\aliasB{\{}{testit}{.Rlbrace.}
%
Expand Down
1 change: 0 additions & 1 deletion tests/ver20.tex.save
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
\inputencoding{utf8}
\HeaderA{ver20}{Johnson \& Johnson, \$ \_ \#\#\# \textasciicircum{} \textasciitilde{}}{ver20}
%
\begin{Description}
Expand Down

0 comments on commit be2890f

Please sign in to comment.