[Rd] UTF-8 encoding issue with R CMD check with install-args="--latex"
Ivan Krylov
|kry|ov @end|ng |rom d|@root@org
Thu Jan 16 21:21:16 CET 2025
В Thu, 16 Jan 2025 18:09:25 +0100
Peter Ruckdeschel via R-devel <r-devel using r-project.org> пишет:
> this is to report some minor UTF-8 encoding issue with R CMD check
> with option --install-args="--latex" (and possibly more install-args).
Thank you for a very detailed report!
This doesn't happen on R-4.2.2 or 4.3.1, but it does happen on R-devel.
Comparing the calls from R CMD check to R CMD Rd2pdf, I see no
difference in the environment variables or any significant difference
in the command lines. The command being run ends up being equivalent to
R CMD Rd2pdf <package>.Rcheck/<package>
...and the source of the difference is the presence (or absence) of the
<package>.Rcheck/<package>/latex directory. If I temporarily move it
away during an R CMD check --install-args=--latex run, the command
succeeds.
Indeed, tools:::.pkg2tex says
>> ## First check for a latex dir (from R CMD INSTALL --latex).
>> ## Second guess is this is a >= 2.10.0 package with stored .rds
>> ## files.
>> ## If it does not exist, guess this is a source package.
>> latexdir <- file.path(pkgdir, "latex")
The individual *.tex files in the latex/ subdirectory of the installed
package all do start with an "\inputencoding{utf8}" line.
When the latex/ subdirectory doesn't exist, the !dir.exists(latexdir)
branch is taken, where Rd2latex(...) is called with writeEncoding =
FALSE, thus avoiding the problem.
--
Best regards,
Ivan
More information about the R-devel
mailing list