问题
I've tried to write a very simple Rmarkdown file to render as pdf, but got an error for an undefined control sequence.
The file:
---
title: "Untitled"
author: "author"
date: "3/2/2020"
output: pdf_document
---
# whatever
fskjflsjflkj
saved as test.Rmd and knit (with the button) produces the following output in the R markdown console:
processing file: test.Rmd
output file: test.knit.md
! Undefined control sequence.
l.115 \xdef\@fontenc@load@list{\@fontenc@load@list
Error: LaTeX failed to compile test.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips. See test.log for more info.
Execution halted
The following is the relevant test.log
part:
Already applied: [0000/00/00] Old fixltx2e package on input line 53.
) (/usr/local/texlive/2019/texmf-dist/tex/latex/base/fontenc.sty
Package: fontenc 2020/02/11 v2.0o Standard LaTeX package
(/usr/local/texlive/2019/texmf-dist/tex/latex/base/t1enc.def
File: t1enc.def 2020/02/11 v2.0o Standard LaTeX file
LaTeX Font Info: Redeclaring font encoding T1 on input line 48.
)
LaTeX Font Info: Trying to load font information for T1+lmr on input line 11
2.
(/usr/local/texlive/2019/texmf-dist/tex/latex/lm/t1lmr.fd
File: t1lmr.fd 2009/10/30 v1.6 Font defs for Latin Modern
)
! Undefined control sequence.
l.115 \xdef\@fontenc@load@list{\@fontenc@load@list
It doesn't matter if I try to compile it with pdflatex
, lualatex
or xelatex
the error is the same.
I'm working on an Ubuntu 18.04 machine with everything updated and upgraded (apt-get update && apt-get upgrade
as root) and after running tlmgr update --self --all
.
How can I get Rmarkdown to knit to pdf again?
回答1:
Try to use
fmtutil-sys --all
to rebuilt the format files using those new sources (updated with tlmgr).
来源:https://stackoverflow.com/questions/60489469/xdef-fontencloadlist-fontencloadlist-undefined-control-sequence-in-rmark