无法编织 pdf,因 tlmgr 搜索失败而收到 tinytex 错误 [英] Unable to knit pdf, receiving tinytex error with failed tlmgr search

查看:111
本文介绍了无法编织 pdf,因 tlmgr 搜索失败而收到 tinytex 错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用- RStudio 版本 1.2.1335- R 版

Using - RStudio Version 1.2.1335 - R version

我能够将 R markdown 文件编织为 HTML 和 Word,但无法使用 PDF.我不断收到同样的错误消息,告诉我它无法找到Palatino"字体.

I am able to knit the R markdown file to HTML and Word, but fail with PDF. I keep receiving the same error message telling me that it is unable to locate the "Palatino" font.

文件已成功处理(所有块都运行).

The file is successfully processed (all chunks run).

我尝试重新安装和重置 Miktex 和 Tinytex 以及 R 本身.我对此很陌生,所以我不确定如何继续.我应该安装 TexLive 吗?

I have tried re-installing and resetting Miktex and Tinytex, as well as R itself. I am pretty new to this, so I am unsure how to proceed. Should I install TexLive?

这是我要运行的文件的标题:

This is the header of the file I am trying to run:

--
title: "Assignment 1"
fontsize: 11pt
header-includes: \usepackage{fancyhdr}
geometry: "left=.5in,right=.5in,top=1in,bottom=1in"
output:
  pdf_document:
    latex_engine: xelatex
    md_extensions: +inline_notes
    number_sections: no
  word_document: default
mathfont: Palatino
monofont: Courier
mainfont: Palatino
sansfont: Helvetica
subtitle: \textbf{Due Wednesday, 11 September 2019 (beginning of class)}
fontfamily: mathpazo
---

这是我继续收到的错误,没有呈现 PDF 文件:

And this is the error I continue to receive, without rendering of a PDF file:

输出文件:PBHLTH252-Assignment-1_post.knit.md

output file: PBHLTH252-Assignment-1_post.knit.md

"C:/Program Files/RStudio/bin/pandoc/pandoc" +RTS -K512m -RTS PBHLTH252-Assignment-1_post.utf8.md --to latex --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash -+inline_notes-output PBHLTH252-Assignment-1_post.tex --template "C:\Users\UYser\Documents\R\win-library\3.6\rmarkdown\rmd\latex\default-1.17.0.2.tex" --highlight-style tango--pdf-engine xelatex --variable graphics=yes --lua-filter "C:/Users/UYser/Documents/R/win-library/3.6/rmarkdown/rmd/lua/pagebreak.lua" --variable "compact-标题:是的"tlmgr 搜索 --file --global "/Palatino."!包 fontspec 错误:找不到字体Palatino".

"C:/Program Files/RStudio/bin/pandoc/pandoc" +RTS -K512m -RTS PBHLTH252-Assignment-1_post.utf8.md --to latex --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash+inline_notes --output PBHLTH252-Assignment-1_post.tex --template "C:\Users\UYser\Documents\R\win-library\3.6\rmarkdown\rmd\latex\default-1.17.0.2.tex" --highlight-style tango --pdf-engine xelatex --variable graphics=yes --lua-filter "C:/Users/UYser/Documents/R/win-library/3.6/rmarkdown/rmd/lua/pagebreak.lua" --variable "compact-title:yes" tlmgr search --file --global "/Palatino." ! Package fontspec Error: The font "Palatino" cannot be found.

!kpathsea:运行 mktextfm Palatino

! kpathsea: Running mktextfm Palatino

!命令名称为 C:\Users\UYser\AppData\Roaming\TinyTeX\bin\win32\mktextfm

! The command name is C:\Users\UYser\AppData\Roaming\TinyTeX\bin\win32\mktextfm

!kpathsea:将字体创建命令附加到missfont.log.

! kpathsea: Appending font creation commands to missfont.log.

错误:无法编译 PBHLTH252-Assignment-1_post.tex.请参阅 https://yihui.name/tinytex/r/#debugging 了解调试技巧.有关更多信息,请参阅 PBHLTH252-Assignment-1_post.log.另外: 警告信息:在 parse_packages(logfile, quiet = c(TRUE, FALSE, FALSE)) 中:未能找到包含 Palatino 的包.执行停止

Error: Failed to compile PBHLTH252-Assignment-1_post.tex. See https://yihui.name/tinytex/r/#debugging for debugging tips. See PBHLTH252-Assignment-1_post.log for more info. In addition: Warning message: In parse_packages(logfile, quiet = c(TRUE, FALSE, FALSE)) : Failed to find a package that contains Palatino. Execution halted

我尝试关注此线程,https://github.com/yihui/tinytex/issues/81,没有成功:

I tried following this thread, https://github.com/yihui/tinytex/issues/81, with no success:

  1. 运行这个建议的代码

tinytex::tlmgr_search("/Palatino[.](tfm|afm|mf|otf)")

结果:

包存储库 http://ctan.math.illinois.edu/systems/texlive/tlnet(未验证:gpg 不可用)

package repository http://ctan.math.illinois.edu/systems/texlive/tlnet (not verified: gpg unavailable)

  1. 运行这个

tinytex::tlmgr_install("multirow") 

给我以下错误:

tlmgr 安装 Palatino.'afm' 不被识别为内部或外部命令,可运行的程序或批处理文件.tlmgr 更新 --selftlmgr.pl:包存储库 http://ctan.math.illinois.edu/systems/texlive/tlnet(未验证:gpg 不可用)tlmgr.pl:没有可用的 tlmgr 自我更新.tlmgr 安装帕拉蒂诺.'afm' 不被识别为内部或外部命令,可运行的程序或批处理文件.

tlmgr install Palatino. 'afm' is not recognized as an internal or external command, operable program or batch file. tlmgr update --self tlmgr.pl: package repository http://ctan.math.illinois.edu/systems/texlive/tlnet (not verified: gpg unavailable) tlmgr.pl: no self-updates for tlmgr available. tlmgr install Palatino. 'afm' is not recognized as an internal or external command, operable program or batch file.

感谢任何帮助!

推荐答案

看起来您在使用 Windows 时从 Mac 用户那里获得了模板.那里的字体名称不同.您可以使用 Palatino Linotype 代替 Palatino.我不确定 HelveticaCourier 是否可以工作.如果没有,您可以使用 ArialCourier New.

It looks like you got the template from a Mac user while you are on Windows. The fontnames are different there. Instead of Palatino you could use Palatino Linotype. I am not sure if Helvetica and Courier will work. If not, you could use Arial and Courier New.

然而,这听起来像是一个相当丑陋的字体组合.Palatino 是一种非常好的字体,但 Helvertica/Arial 和 Courier (New) 都不适合.此外,我不认为正常的 Palatino 字体被设置为用于数学.您可以改用 Asana Math,它随 MikTeX/TinyTeX 提供.

However, that sounds like a rather ugly font combination. Palatino is a very fine font, but neither Helvertica/Arial nor Courier (New) fit well. Besides, I don't think that normal Palatino fonts are set-up to be used for math. You could use Asana Math instead, which comes with MikTeX/TinyTeX.

这篇关于无法编织 pdf,因 tlmgr 搜索失败而收到 tinytex 错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆