Skip to content

Commit be2890f

Browse files
author
smeyer
committed
Rd2latex() no longer outputs an \inputencoding line by default
git-svn-id: https://svn.r-project.org/R/trunk@87676 00db46b3-68df-0310-9c12-caf00c1e9a41
1 parent b898130 commit be2890f

File tree

5 files changed

+14
-11
lines changed

5 files changed

+14
-11
lines changed

doc/NEWS.Rd

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,10 @@
425425
or package manuals using \command{R CMD Rd2pdf}, it is ensured
426426
that this \R's \file{Rd.sty} takes precedence over any other
427427
(incompatible) versions in default \dQuote{texmf trees}.
428+
429+
\item \code{tools::Rd2latex()} no longer outputs an
430+
\samp{\\inputencoding{utf8}} line by default;
431+
such a declaration is obsolete since \LaTeX 2018-04-01.
428432
}
429433
}
430434

src/library/tools/R/Rd2latex.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ latex_canonical_encoding <- function(encoding)
6161
Rd2latex <- function(Rd, out = "", defines = .Platform$OS.type,
6262
stages = "render",
6363
outputEncoding = "UTF-8", fragment = FALSE, ...,
64-
writeEncoding = TRUE,
64+
writeEncoding = outputEncoding != "UTF-8",
6565
concordance = FALSE)
6666
{
6767
encode_warn <- FALSE

src/library/tools/man/Rd2HTML.Rd

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
% File src/library/tools/man/Rd2HTML.Rd
22
% Part of the R package, https://www.R-project.org
3-
% Copyright 2008-2022 R Core Team
3+
% Copyright 2008-2025 R Core Team
44
% Distributed under GPL 2 or later
55

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

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

4040
Rd2ex(Rd, out = "", defines = .Platform$OS.type,
@@ -75,7 +75,7 @@ Rd2ex(Rd, out = "", defines = .Platform$OS.type,
7575
standalone HTML file. If \code{FALSE}, the header and footer are
7676
omitted, so that the output can be combined with other fragments.
7777
}
78-
\item{hooks}{A list of functions controlling details of
78+
\item{hooks}{a list of functions controlling details of
7979
output. Currently the only component used is \code{pkg_href}, which
8080
is used by \code{pkg2HTML} to determine the output HTML file path
8181
given a package name as input. }
@@ -86,15 +86,16 @@ Rd2ex(Rd, out = "", defines = .Platform$OS.type,
8686
examples section is wrapped inside a \code{rcode} block. }
8787
\item{Links, Links2}{\code{NULL} or a named (by topics) character vector of
8888
links, as returned by \code{\link{findHTMLlinks}}.}
89-
\item{options}{An optional named list of options to pass to
89+
\item{options}{an optional named list of options to pass to
9090
\code{\link{Rd2txt_options}}.}
9191
\item{...}{ additional parameters to pass to \code{\link{parse_Rd}} when
9292
\code{Rd} is a filename. }
93-
\item{writeEncoding}{should \verb{\inputencoding} lines be written in
94-
the file for non-ASCII encodings?}
95-
\item{commentDontrun}{should \verb{\dontrun} sections be commented
93+
\item{writeEncoding}{logical: should an \verb{\inputencoding} line be written
94+
for non-ASCII encodings? \LaTeX release 2018-04-01 and later
95+
default to UTF-8; the declaration is obsolete in that case.}
96+
\item{commentDontrun}{logical: should \verb{\dontrun} sections be commented
9697
out?}
97-
\item{commentDonttest}{should \verb{\donttest} sections be commented out?}
98+
\item{commentDonttest}{logical: should \verb{\donttest} sections be commented out?}
9899
}
99100
\details{
100101
These functions convert help documents: \code{Rd2HTML} produces HTML,

tests/testit.tex.save

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
\inputencoding{utf8}
21
\HeaderA{testit}{An Rd Regression Test}{testit}
32
\aliasB{\{}{testit}{.Rlbrace.}
43
%

tests/ver20.tex.save

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
\inputencoding{utf8}
21
\HeaderA{ver20}{Johnson \& Johnson, \$ \_ \#\#\# \textasciicircum{} \textasciitilde{}}{ver20}
32
%
43
\begin{Description}

0 commit comments

Comments
 (0)