7

I having the following issue when trying to check a package using the command line. First I get this very general error message:

* checking PDF version of manual ... WARNING
LaTeX errors when creating PDF version.
This typically indicates Rd problems.
LaTeX errors found:
* checking PDF version of manual without hyperrefs or index … ERROR

Then, when I check Rdlatex log, I found the following complain:

Transcript written on Rd2.log.
Error in texi2dvi(file = file, pdf = TRUE, clean = clean, quiet = quiet,  : 
  unable to run 'pdflatex' on 'Rd2.tex'
Error in running tools::texi2pdf()
You may want to clean up by 'rm -rf /var/folders/_q/_kj9kz0n0qq_gwkrv9qjvpxw0000gn/T//Rtmp7uzkmZ/Rd2pdf2a847787e63'

For some reason it didn't manage to run pdflatex though it is properly installed as the following testifies. Does anyone has a clue on how I can fix it?

system("pdflatex --version") pdfTeX 3.14159265-2.6-1.40.15 (TeX Live 2014) kpathsea version 6.2.0 Copyright 2014 Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX). There is NO warranty. Redistribution of this software is covered by the terms of both the pdfTeX copyright and the Lesser GNU General Public License. For more information about these matters, see the file named COPYING and the pdfTeX source. Primary author of pdfTeX: Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX). Compiled with libpng 1.6.10; using libpng 1.6.10 Compiled with zlib 1.2.8; using zlib 1.2.8 Compiled with xpdf version 3.03

Very weirdly, running R CMD Rd2pdf man/ produces output.

LaTeX Font Warning: Some font shapes were not available, defaults substituted.

 )
(see the transcript file for additional information){/usr/local/texlive/2014bas
ic/texmf-dist/fonts/enc/dvips/inconsolata/i4-ts1.enc}{/usr/local/texlive/2014ba
sic/texmf-dist/fonts/enc/dvips/base/8r.enc}{/usr/local/texlive/2014basic/texmf-
dist/fonts/enc/dvips/inconsolata/i4-t1-0.enc}</usr/local/texlive/2014basic/texm
f-dist/fonts/type1/public/inconsolata/Inconsolata-zi4r.pfb></usr/local/texlive/
2014basic/texmf-dist/fonts/type1/public/amsfonts/cm/cmex10.pfb></usr/local/texl
ive/2014basic/texmf-dist/fonts/type1/public/amsfonts/cm/cmmi10.pfb></usr/local/
texlive/2014basic/texmf-dist/fonts/type1/public/amsfonts/cm/cmmi7.pfb></usr/loc
al/texlive/2014basic/texmf-dist/fonts/type1/public/amsfonts/cm/cmr10.pfb></usr/
local/texlive/2014basic/texmf-dist/fonts/type1/public/amsfonts/cm/cmr5.pfb></us
r/local/texlive/2014basic/texmf-dist/fonts/type1/public/amsfonts/cm/cmr7.pfb></
usr/local/texlive/2014basic/texmf-dist/fonts/type1/public/amsfonts/cm/cmsy10.pf
b></usr/local/texlive/2014basic/texmf-dist/fonts/type1/public/amsfonts/cm/cmsy7
.pfb></usr/local/texlive/2014basic/texmf-dist/fonts/type1/urw/helvetic/uhvr8a.p
fb></usr/local/texlive/2014basic/texmf-dist/fonts/type1/urw/times/utmb8a.pfb></
usr/local/texlive/2014basic/texmf-dist/fonts/type1/urw/times/utmr8a.pfb></usr/l
ocal/texlive/2014basic/texmf-dist/fonts/type1/urw/times/utmr8a.pfb></usr/local/
texlive/2014basic/texmf-dist/fonts/type1/urw/times/utmri8a.pfb>
Output written on Rd2.pdf (62 pages, 264746 bytes).
Transcript written on Rd2.log.
Saving output to 'Rd2.pdf' ...
Done
4

1 回答 1

0

我有R CMD check并且R CMD Rd2pdf失败了,因为我们的一个合作伙伴创建了一个空的大括号块,它没有被 roxygen 转义并破坏了 LaTeX 渲染,即\dontrun{}以下内容:

#' An example of breaking the R CMD Rd2pdf with unescaped curly braces.
#'
#' @param df A dataframe.
#' @return A dataframe.
#'
#' @examples
#' \dontrun{
#' }
#' @export
funcname <- function(df){
df
}
 
于 2021-11-11T14:49:50.317 回答