简体   繁体   English

生成R包手册时出错

[英]Error when generating R package manual

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:然后,当我检查 Rdlatex 日志时,我发现以下抱怨:

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.出于某种原因,它没有设法运行 pdflatex 尽管它已正确安装,如下所示。 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). system("pdflatex --version") pdfTeX 3.14159265-2.6-1.40.15 (TeX Live 2014) kpathsea version 6.2.0 版权所有 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.此软件的重新分发受 pdfTeX 版权和 Lesser GNU 通用公共许可证的条款约束。 For more information about these matters, see the file named COPYING and the pdfTeX source.有关这些问题的更多信息,请参阅名为 COPYING 的文件和 pdfTeX 源。 Primary author of pdfTeX: Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX). pdfTeX 的主要作者:Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX)。 Compiled with libpng 1.6.10;用 libpng 1.6.10 编译; using libpng 1.6.10 Compiled with zlib 1.2.8;使用 libpng 1.6.10 与 zlib 1.2.8 编译; using zlib 1.2.8 Compiled with xpdf version 3.03使用 zlib 1.2.8 用 xpdf 3.03 版编译

Very weirdly, running R CMD Rd2pdf man/ produces output.非常奇怪的是,运行 R CMD Rd2pdf man/ 会产生输出。

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

I know this is a very old post, but for future readers - I had R CMD check and R CMD Rd2pdf fail because one of our collabs created an empty curly-braces block that was not escaped by roxygen and broke the laTeX render, .ie the \\dontrun{} below :我知道这是一篇很老的帖子,但对于未来的读者 - 我有R CMD checkR CMD Rd2pdf失败,因为我们的一个合作创建了一个空的花括号块,它没有被 roxygen 转义并破坏了 LaTeX 渲染,.ie下面的\\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
}
 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM