RMarkdown找不到'pdflatex.fmt'文件

问题描述 投票:1回答:1

[我是第一次使用RMarkdown尝试使用Rhuidown的《 R Markdown A权威指南》中的第一个例子:

---
title: "Hello R Markdown"
author: "Awesome Me"
date: "2018-02-14"
output: pdf_document
---

This is a paragraph in an R Markdown document.

Below is a code chunk:

options(tinytex.verbose = TRUE)
fit = lm(dist ~ speed, data = cars)
b = coef(fit)
plot(cars)
abline(fit)

The slope of the regression is `r b[1]

我根据Yihui的评论here使用以下内容安装了TinyTex:

devtools::install_github('yihui/tinytex')

tinytex:::install_prebuilt()

运行tinytex:::is_tinytex()得出TRUE。

单击编织给我以下输出。错误行I can't find the format file 'pdflatex.fmt'

processing file: Testpdf1.Rmd
  |.......................                                               |  33%
  ordinary text without R code

  |...............................................                       |  67%
label: unnamed-chunk-1
  |......................................................................| 100%
   inline R code fragments

"C:/Users/xxxxxx/Documents/RStudio/bin/pandoc/pandoc" +RTS -K512m -RTS Testpdf1.utf8.md --to latex --from markdown+autolink_bare_uris+tex_math_single_backslash --output Testpdf1.tex --self-contained --highlight-style tango --pdf-engine pdflatex --variable graphics --lua-filter "C:/Users/xxxxxx/Documents/R/R-3.6.1/library/rmarkdown/rmd/lua/pagebreak.lua" --lua-filter "C:/Users/xxxxxx/Documents/R/R-3.6.1/library/rmarkdown/rmd/lua/latex-div.lua" --variable "geometry:margin=1in" 
output file: Testpdf1.knit.md

This is pdfTeX, Version 3.14159265-2.6-1.40.20 (TeX Live 2019/W32TeX) (preloaded format=pdflatex)
 restricted \write18 enabled.
I can't find the format file `pdflatex.fmt'!

kpathsea: Running mktexfmt pdflatex.fmt

The command name is C:\Users\xxxxxx\AppData\Roaming\TinyTeX\bin\win32\mktexfmt
I was unable to find any missing LaTeX packages from the error log Testpdf1.log.
! kpathsea: Running mktexfmt pdflatex.fmt

! The command name is C:\Users\xxxxxx\AppData\Roaming\TinyTeX\bin\win32\mktexfmt

Error: LaTeX failed to compile Testpdf1.tex. See https://yihui.org/tinytex/r/#debugging for debugging 
tips. See Testpdf1.log for more info.
Execution halted

我正在尝试编译pdf文件。我在公司防火墙后面运行Windows。在我的计算机上搜索该文件“ pdflatex.fmt”不会产生任何结果。我已经在网上寻找解决方案已有一段时间了,但与问题无关。有谁知道我要如何解决这个问题?

r-markdown pdflatex tinytex
1个回答
0
投票

可能与this one相同,所以请尝试

tinytex::tlmgr_install(c('texlive-scripts', 'dehyph-exptl'))
© www.soinside.com 2019 - 2024. All rights reserved.