r - 无法编织 pdf,收到 tinytex 错误,tlmgr 搜索失败
问题描述
使用 - RStudio 版本 1.2.1335 - R 版本
我能够将 R markdown 文件编织成 HTML 和 Word,但使用 PDF 失败。我不断收到相同的错误消息,告诉我它无法找到“Palatino”字体。
该文件已成功处理(所有块都运行)。
我尝试重新安装和重置 Miktex 和 Tinytex,以及 R 本身。我对此很陌生,所以我不确定如何进行。我应该安装 TexLive 吗?
这是我要运行的文件的标题:
--
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 文件:
输出文件: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-title:是的" tlmgr 搜索 --file --global "/Palatino。" !包 fontspec 错误:找不到字体“Palatino”。
!kpathsea:运行 mktextfm Palatino
!命令名称为 C:\Users\UYser\AppData\Roaming\TinyTeX\bin\win32\mktextfm
!kpathsea:将字体创建命令附加到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 的包。执行停止
我尝试关注这个线程,https ://github.com/yihui/tinytex/issues/81 ,但没有成功:
- 运行这个建议的代码
tinytex::tlmgr_search("/Palatino[.](tfm|afm|mf|otf)")
结果是:
软件包存储库http://ctan.math.illinois.edu/systems/texlive/tlnet(未验证:gpg 不可用)
- 运行这个
tinytex::tlmgr_install("multirow")
给我以下错误:
tlmgr 安装 Palatino。'afm' 不是内部或外部命令、可运行程序或批处理文件。tlmgr update --self tlmgr.pl:包存储库http://ctan.math.illinois.edu/systems/texlive/tlnet(未验证:gpg 不可用) tlmgr.pl:没有可用的 tlmgr 自我更新。tlmgr 安装 Palatino。'afm' 不是内部或外部命令、可运行程序或批处理文件。
任何帮助表示赞赏!
解决方案
看起来您在使用 Windows 时从 Mac 用户那里获得了模板。那里的字体名称不同。而不是Palatino
你可以使用Palatino Linotype
. 我不确定是否Helvetica
并且Courier
会起作用。如果没有,您可以使用Arial
and Courier New
。
然而,这听起来像是一个相当丑陋的字体组合。Palatino 是一种非常好的字体,但 Helvertica/Arial 和 Courier (New) 都不太适合。此外,我不认为将普通的 Palatino 字体设置为用于数学。你可以改用Asana Math
MikTeX/TinyTeX 自带的。
推荐阅读
- java - 在java中从客户端的两个服务器之间Ping
- angular12 - Angular Akita 仅设置数组中的最后一个值
- laravel-8 - Laravel Fogot 密码不起作用 - 令牌无效
- reactjs - React & TypeScript:动态输入道具的最佳方式?
- extjs - Ext JS 7.4.0 Modern 在 Ext.dataview.NavigationModel 的 onChildTrigger 中使用错误的变量
- java - 如何在 Harmony Os 中检查设备是否连接到互联网和连接类型
- reactjs - Nextjs 未按预期呈现并抛出“警告道具`样式`不匹配。” 使用内联样式时
- visual-studio-code - 如何在 devcontainer 中安装私人创建的扩展?
- r - 将不同数量的 ARIMA 回归系数存储到数组/列表中,如何填充零以使数组(列表元素)长度相等?
- html - CSS 计数器仅在前几个元素上重置