【问题标题】:Unable to knit pdf, receiving tinytex error with failed tlmgr search无法编织 pdf,收到 tinytex 错误,tlmgr 搜索失败
【发布时间】:2020-01-09 19:05:19
【问题描述】:

使用 - 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 - -输出 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 风格的探戈--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”。

! 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,但没有成功:

  1. 运行这个建议的代码
tinytex::tlmgr_search("/Palatino[.](tfm|afm|mf|otf)")

结果:

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

  1. 运行这个
tinytex::tlmgr_install("multirow") 

给我以下错误:

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

感谢任何帮助!

【问题讨论】:

    标签: r r-markdown tinytex


    【解决方案1】:

    我曾经遇到过类似的问题。我的解决方案听起来很幼稚(或愚蠢),但它对我来说非常有效。而不是调试,在RStudio

    1. 安装rticles
    2. 开始一个新的R Markdown文件
    3. 选择期刊文章模板之一,例如PNAS Journal ArticleSpringer Journal ArticleElsevier Journal Article...
    4. knit 模板。

    然后,它将尝试自动安装缺少的 LaTeX 包...

    您可能想尝试一些日记模板。它对我有用,我希望这也能解决你的问题。好好享受!

    【讨论】:

      【解决方案2】:

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

      但是,这听起来像是一个相当难看的字体组合。 Palatino 是一种非常好的字体,但 Helvertica/Arial 和 Courier (New) 都不适合。此外,我不认为将普通的 Palatino 字体设置为用于数学。你可以改用 Asana Math,它是 MikTeX/TinyTeX 自带的。

      【讨论】:

        猜你喜欢
        • 2021-09-15
        • 2019-04-06
        • 2021-02-11
        • 1970-01-01
        • 2021-08-22
        • 2023-03-14
        • 1970-01-01
        • 2017-12-10
        • 1970-01-01
        相关资源
        最近更新 更多