0

I am unable to knit a pdf in RStudio. I have had no issues previously, though did recently update my Xcode installation. I am working on a Mac OS Catalina 10.15.6.

The problem seems to be related to my l3backend installation, as I get the error copied below. However, I have checked multiple ways and I certainly do have l3backend installed.

Here's the error:

This is pdfTeX, Version 3.14159265-2.6-1.40.21 (TeX Live 2020) (preloaded format=pdflatex)
 restricted \write18 enabled.
entering extended mode
tlmgr search --file --global '/l3backend-pdfmode.def'
! LaTeX Error: File `l3backend-pdfmode.def' not found.

! Emergency stop. <read *>

Error: LaTeX failed to compile handOut_fgkTests.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips. See handOut_fgkTests.log for more info. In addition: Warning message: In parse_packages(logfile, quiet = !verbose) : Failed to find a package that contains l3backend-pdfmode.def Execution halted

When I run:

tlmgr search --file --global '/l3backend-pdfmode.def'

I get:

tlmgr: package repository http://ctan.math.utah.edu/ctan/tex-archive/systems/texlive/tlnet (verified)

Running the Tex Live Utility also confirms l3backend is installed. I am at a total loss as to what is suddenly causing this error.

  • 1
    Is l3backend up-to-date? There was a file name change recently and perhaps you don't have that – Joseph Wright Sep 23 '20 at 15:08
  • Yes, I believe my l3backend install is up-to-date. I used Tex Live to reinstall this morning. – MC Fitzpatrick Sep 23 '20 at 15:11
  • @JosephWright I have Release 2020-09-11. – MC Fitzpatrick Sep 23 '20 at 15:17
  • OK, what do kpsewhich l3backend-pdfmode.def and kpsewhich l3backend-pdftex.def report? – Joseph Wright Sep 23 '20 at 15:20
  • kpsewhich l3backend-pdfmode.def returns nothing. kpsewhich l3backend-pdftex.def returns: /usr/local/texlive/2020/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def – MC Fitzpatrick Sep 23 '20 at 15:24
  • l3backend-pdfmode is the old file and l3backend-pdftex is its replacement so it not being there isn't unexpected but what is not clear from the log you have posted is which file is trying to access the old name. what command are you running that causes tlmgr search --file --global '/l3backend-pdfmode.def' to appear in the latex log that you show in the first code block above? – David Carlisle Sep 23 '20 at 15:36
  • If expl3 is looking for the pdfmode file it is too old. Check if your latex format is up-to-date. – Ulrike Fischer Sep 23 '20 at 15:37
  • @DavidCarlisle I am clicking the knit in RStudio and this text precedes the error: /Applications/RStudio.app/Contents/MacOS/pandoc/pandoc +RTS -K512m -RTS handOut_fgkTests.utf8.md --to latex --from markdown+autolink_bare_uris+tex_math_single_backslash --output handOut_fgkTests.tex --self-contained --highlight-style tango --pdf-engine pdflatex --variable graphics --lua-filter /Library/Frameworks/R.framework/Versions/3.6/Resources/library/rmarkdown/rmd/lua/pagebreak.lua --lua-filter /Library/Frameworks/R.framework/Versions/3.6/Resources/library/rmarkdown/rmd/lua/latex-div.lua – MC Fitzpatrick Sep 23 '20 at 15:42
  • @UlrikeFischer Can you provide some guidance on how to check that my latex format is up-to-date? – MC Fitzpatrick Sep 23 '20 at 15:47
  • what do you get on the terminal if you type pdflatex \\stop it should be $ pdflatex \\stop This is pdfTeX, Version 3.14159265-2.6-1.40.21 (TeX Live 2020) (preloaded format=pdflatex) restricted \write18 enabled. entering extended mode LaTeX2e <2020-02-02> patch level 5 L3 programming layer <2020-09-06> No pages of output. Transcript written on texput.log. – David Carlisle Sep 23 '20 at 15:48
  • @DavidCarlisle I get the same message EXCEPT I get: L3 programming layer <2020-03-06> – MC Fitzpatrick Sep 23 '20 at 15:50
  • there you go then your format is too old, try fmtutil-sys --all to rebuild them – David Carlisle Sep 23 '20 at 15:51
  • often the automatic remaking of formats fails because you have a locally installed old format somewhere that is masking the main one so if the above doesn't work show the output from kpsewhich -engine=pdftex pdflatex.fmt – David Carlisle Sep 23 '20 at 15:54
  • I now get L3 programming layer <2020-09-06>, but still an error when I knit: ! LaTeX Error: \caption outside float. Running kpsewhich -engine=pdftex pdflatex.fmt returns: usr/local/texlive/2020/texmf-var/web2c/pdftex/pdflatex.fmt – MC Fitzpatrick Sep 23 '20 at 15:59
  • @DavidCarlisle Everything is working now - last issue was with my markdown document. Thanks for your help! – MC Fitzpatrick Sep 23 '20 at 16:06

0 Answers0