ulyngs / oxforddown

Template for writing an Oxford University thesis in R Markdown; uses the OxThesis LaTeX template and was inspired by thesisdown.
https://ulyngs.github.io/oxforddown/
MIT License
220 stars 80 forks source link

Repeated error "! Undefined control sequence." The fresh Oxforddown files cannot be knitted into pdf #90

Closed muqing-lydia closed 3 months ago

muqing-lydia commented 3 months ago

Hi Ulrik,

I am using your template to write my phd thesis. I am already halfway in writing, but there is a bug recently that kept showing up, and I cannot knit things into pdf anymore. The same error occurs to my own thesis version as well as with your fresh oxforddown files.

I also tried using different Rstudio versions and many Pandoc versions, but nothing changed. Now I am staying with Rstudio 2023.06.2, and pandoc 3.1.1, and I am a macOS user.

This is the warning message:

processing file: _main.Rmd

/Applications/RStudio.app/Contents/Resources/app/quarto/bin/tools/pandoc +RTS -K512m -RTS _main.knit.md --to latex --from markdown+autolink_bare_uris+tex_math_single_backslash --output _main.tex --lua-filter /Library/Frameworks/R.framework/Versions/4.2/Resources/library/bookdown/rmarkdown/lua/custom-environment.lua --lua-filter /Library/Frameworks/R.framework/Versions/4.2/Resources/library/rmarkdown/rmarkdown/lua/pagebreak.lua --lua-filter /Library/Frameworks/R.framework/Versions/4.2/Resources/library/rmarkdown/rmarkdown/lua/latex-div.lua --metadata-file /var/folders/dk/g4l630p92q79x9lhrwdgg_d00000gn/T//Rtmp48XJxN/filef23445b1701f --embed-resources --standalone --table-of-contents --toc-depth 2 --template templates/template.tex --number-sections --highlight-style tango --pdf-engine xelatex --wrap preserve --lua-filter=scripts_and_filters/colour_and_highlight.lua --include-in-header /var/folders/dk/g4l630p92q79x9lhrwdgg_d00000gn/T//Rtmp48XJxN/rmarkdown-strf2343db9f5f8.html --variable tables=yes --standalone -Mhas-frontmatter=false --citeproc 
output file: _main.knit.md

tlmgr: package repository https://mirror.dogado.de/tex-archive/systems/texlive/tlnet (verified)
tlmgr install: package already present: l3backend
tlmgr install: package already present: l3backend-dev
! Undefined control sequence.
l.338 \DeclareCollectionInstance
                                 { plainmath } { xfrac } { mathdefault } { m... 

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

In the _main.log file, the message is:

LaTeX template Info: Declaring template type 'xfrac' taking 3 argument(s) on
(template)           line 80.

! Undefined control sequence.
l.338 \DeclareCollectionInstance
                                 { plainmath } { xfrac } { mathdefault } { m... 

But I am not even sure where to find l.338, as I did not see these codes in _main.rmd nor _main.tex.

"! Undefined control sequence." There were also other warning message following this before (something about citeproc), but have gone after I downgraded the Pandoc versions.

Could you help with having a look? Thank you for your help!!

Best, Muqing

muqing-lydia commented 3 months ago

The problem is oddly solved after I uninstall everything (rstudio and tinytex) and reinstall again ...