诊断R包构建警告:“创建PDF版本时出现乳胶错误”

时间:2021-08-03 13:24:40

When building a package, I received the following warning:

在构建包时,我收到以下警告:

* checking PDF version of manual ... WARNING
LaTeX errors when creating PDF version.
This typically indicates Rd problems.

I have no idea how to even begin diagnosing this. Is there a tool that tells me what .Rd file the problem is in?

我甚至不知道如何开始诊断这个。有没有一个工具可以告诉我问题所在的。rd文件?

I get no warnings about any of my Rd files in the checking documentation step....

我没有任何警告我Rd文件检查文档中一步....

5 个解决方案

#1


47  

Try R CMD Rd2pdf mypackage to create the manual, and possibly also set the --no-clean option to keep the temporary files. This should allow you to debug the LaTeX code triggering the error.

尝试使用R CMD rd2mypdf包来创建手册,也可以设置——no-clean选项来保存临时文件。这应该允许您调试触发错误的乳胶代码。

#2


15  

Though @Dirk's answer also helped me to fix the problem I would like to add a bit which might especially help recent updaters. That is, people who haven't encountered other LaTeX / R troubles after the update to 3.1.3 yet. The problem is little bit more general than just building. For me, on OS X the problem was that R CMD Rd2pdf as well as the R CMD CHECK expected texi2dvi to be in /usr/local/bin while it was in /usr/bin. A symlink helped to fix the problem. On terminal type:

尽管@Dirk的回答也帮助我解决了这个问题,但我还是想补充一点,这可能对最近的更新有特别的帮助。也就是说,在更新到3.1.3之后还没有遇到其他乳胶/ R问题的人。这个问题比建造更一般。对我来说,在OS X上的问题是R CMD Rd2pdf以及R CMD检查都期望texi2dvi在/usr/local/bin中,而在/usr/ bin中。一个符号链接帮助解决了这个问题。终端类型:

# to check whether the same issue exists for you
which texi2dvi
# if so
cd /usr/local/bin
ln -s /usr/bin/texi2dvi

Of course if the first line returns something else, you need to adapt the symlink here.

当然,如果第一行返回其他内容,则需要调整这里的符号链接。

#3


1  

Concluding from the comments and from my own experience the problem often seems to be that some TeX fonts are missing, most often

从这些评论和我自己的经验得出的结论是,问题往往似乎是一些TeX字体被遗漏了,而这些字体往往是缺失的

  • inconsolata.sty and
  • inconsolata。住在猪圈里,
  • upquote.sty
  • upquote.sty

First you have to find the right directory where TeX fonts are stored - in my case this is:

首先,您必须找到存储TeX字体的正确目录—在我的例子中,这是:

C:\Program Files\R\R-3.3.0\share\texmf\tex\latex

Then you can download them here:

然后你可以在这里下载:

Just copy them to the respective folder and in many cases the problem will be solved (in my case too). This should work for all operating systems.

只需将它们复制到相应的文件夹中,在许多情况下,问题就会得到解决(在我的例子中也是如此)。这应该适用于所有操作系统。

#4


0  

If you are on Ubuntu just install Tex Live by this command: apt-get install texlive and restart Rstudo if you use it.

如果你在Ubuntu上,只需通过以下命令安装Tex Live: apt-get install texlive和重启Rstudo。

#5


0  

...and another reason is that you haven't installed MikTex yet.

…另一个原因是您还没有安装MikTex。

  1. Download MikTex from here and follow the dialog prompts to install. I found the defaults to be reasonable and worked well for me.

    从这里下载MikTex并按照对话框提示进行安装。我发现默认值是合理的,并且对我很有效。

  2. Try to build your R package again. It should be OK now.

    试着重新构建你的R包。现在应该没问题了。

#1


47  

Try R CMD Rd2pdf mypackage to create the manual, and possibly also set the --no-clean option to keep the temporary files. This should allow you to debug the LaTeX code triggering the error.

尝试使用R CMD rd2mypdf包来创建手册,也可以设置——no-clean选项来保存临时文件。这应该允许您调试触发错误的乳胶代码。

#2


15  

Though @Dirk's answer also helped me to fix the problem I would like to add a bit which might especially help recent updaters. That is, people who haven't encountered other LaTeX / R troubles after the update to 3.1.3 yet. The problem is little bit more general than just building. For me, on OS X the problem was that R CMD Rd2pdf as well as the R CMD CHECK expected texi2dvi to be in /usr/local/bin while it was in /usr/bin. A symlink helped to fix the problem. On terminal type:

尽管@Dirk的回答也帮助我解决了这个问题,但我还是想补充一点,这可能对最近的更新有特别的帮助。也就是说,在更新到3.1.3之后还没有遇到其他乳胶/ R问题的人。这个问题比建造更一般。对我来说,在OS X上的问题是R CMD Rd2pdf以及R CMD检查都期望texi2dvi在/usr/local/bin中,而在/usr/ bin中。一个符号链接帮助解决了这个问题。终端类型:

# to check whether the same issue exists for you
which texi2dvi
# if so
cd /usr/local/bin
ln -s /usr/bin/texi2dvi

Of course if the first line returns something else, you need to adapt the symlink here.

当然,如果第一行返回其他内容,则需要调整这里的符号链接。

#3


1  

Concluding from the comments and from my own experience the problem often seems to be that some TeX fonts are missing, most often

从这些评论和我自己的经验得出的结论是,问题往往似乎是一些TeX字体被遗漏了,而这些字体往往是缺失的

  • inconsolata.sty and
  • inconsolata。住在猪圈里,
  • upquote.sty
  • upquote.sty

First you have to find the right directory where TeX fonts are stored - in my case this is:

首先,您必须找到存储TeX字体的正确目录—在我的例子中,这是:

C:\Program Files\R\R-3.3.0\share\texmf\tex\latex

Then you can download them here:

然后你可以在这里下载:

Just copy them to the respective folder and in many cases the problem will be solved (in my case too). This should work for all operating systems.

只需将它们复制到相应的文件夹中,在许多情况下,问题就会得到解决(在我的例子中也是如此)。这应该适用于所有操作系统。

#4


0  

If you are on Ubuntu just install Tex Live by this command: apt-get install texlive and restart Rstudo if you use it.

如果你在Ubuntu上,只需通过以下命令安装Tex Live: apt-get install texlive和重启Rstudo。

#5


0  

...and another reason is that you haven't installed MikTex yet.

…另一个原因是您还没有安装MikTex。

  1. Download MikTex from here and follow the dialog prompts to install. I found the defaults to be reasonable and worked well for me.

    从这里下载MikTex并按照对话框提示进行安装。我发现默认值是合理的,并且对我很有效。

  2. Try to build your R package again. It should be OK now.

    试着重新构建你的R包。现在应该没问题了。