mitchelloharawild / vitae

R Markdown Résumés and CVs
https://pkg.mitchelloharawild.com/vitae/
1.23k stars 239 forks source link

knit pandoc new version problem #229

Closed fgardavaud closed 1 year ago

fgardavaud commented 1 year ago

Hi,

I have code my curriculum vitae with this package (thanks a lot for that) based on Lorena Abad template (thks again).

If I knit my Rmd document with RStudio 2022.07.1+554 "Spotted Wakerobin" Release for macOS it works !

If I knit the same Rmd document with the next release RStudio 2022.07.2+576 "Spotted Wakerobin" it does not work. I got this terminal output : /Applications/RStudio.app/Contents/MacOS/quarto/bin/tools/pandoc +RTS -K512m -RTS CV_public_english.knit.md --to latex --from markdown+autolink_bare_uris+tex_math_single_backslash --output CV_public_english.tex --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 --embed-resources --standalone --template /Library/Frameworks/R.framework/Versions/4.2/Resources/library/vitae/rmarkdown/templates/awesomecv/resources/awesome-cv.tex --highlight-style tango --pdf-engine xelatex --lua-filter /var/folders/l9/b_x839tj1w74jktj8jtfh2qh0000gn/T//RtmpMpgoDx/multiple-bibliographies.lua --variable show_footer=TRUE

! LaTeX Error: Missing \begin{document}.

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

It's the same behavior for the most recent releases.

I think the problem is on pandoc behavior.

I analyze the difference between the two versions of Rstudio and, in my opinion, the problem could be the difference on pandoc embedded version as :

pandoc_version() (for RStudio 2022.07.1+554) [1] ‘2.18’

pandoc_version() (for RStudio 2022.07.2+576) [1] ‘2.19.2’

To knit my document I can use the old version of Rstudio but it will be obviously problematic in the future.

If someone can explain me how to deal with newer pandoc version it would be very appreciable. Thanks for your time.

zadrafi commented 1 year ago

Same issue

mitchelloharawild commented 1 year ago

I can't reproduce this error, and I have pandoc version 2.19.2.

fgardavaud commented 1 year ago

Hi @mitchelloharawild, @loreabad6, I analyze a bit more this bug. If I compile my .Rmd document with RStudio 2022.07.1+554 "Spotted Wakerobin" Release for macOS it works ! In this release, pandoc version = 2.18 But with the same Rstudio version, if I install pandoc with for instance brew (so the last version of pandoc), the compilation will crash as Rstudio take the newer version of pandoc in the system. So, I definitively think there is a problem with pandoc. I make another test with the next version of Rstudio (RStudio 2022.07.2+576 "Spotted Wakerobin" Release for macOS) and without pandoc installed on my Mac, the compilation crash too with this output : A new version of TeX Live has been released. If you need to install or update any LaTeX packages, you have to upgrade TinyTeX with tinytex::reinstall_tinytex(repository = "illinois"). ! LaTeX Error: Missing \begin{document}. Errorr : LaTeX failed to compile CV_public_english.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips. See CV_public_english.log for more info. Execution stopped

In this release, pandoc version = 2.19.2.

Next, I found this post of the Yihui master : https://yihui.org/en/2017/11/pandoc-2/

Also, Do you want my .Rmd file ?

mitchelloharawild commented 1 year ago

Thanks for the added info, if you're able to share your .Rmd that could help.

fgardavaud commented 1 year ago

Here we go ! CV_public_english.Rmd.zip

loreabad6 commented 1 year ago

Found a way around this. I am not sure if it is a bug or if the includes formulation should be preferred to header-includes. https://github.com/loreabad6/R-CV/issues/2#issuecomment-1478045175

fgardavaud commented 1 year ago

@loreabad6 Great it's work on my side too. Congratulation for debugging with success and for your reactivity !

mitchelloharawild commented 1 year ago

Nice, glad this is figured out. I'm not sure why header-includes isn't working, as far as I'm aware the awesomecv template is set up to accept this as an input. If anyone can figure it out, would be happy to accept a PR to fix this. https://github.com/mitchelloharawild/vitae/blob/40a47e2fe9c1573cc980b6be812217207283ff7e/inst/rmarkdown/templates/awesomecv/resources/awesome-cv.tex#L134-L136