-
-
Notifications
You must be signed in to change notification settings - Fork 977
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pandoc 2.8 error "! LaTeX Error: Environment cslreferences undefined." #1649
Comments
I have been hoping to use Pandoc's own template for long. I just haven't had the time to review the PR #1563 yet. Here is what you do if you want to use Pandoc's template: output:
pdf_document:
template: null See |
Should be fixed now. Please test the development version of rmarkdown with remotes::install_github('rstudio/rmarkdown') Thanks for the report! |
thanks this fixed the issue for me! |
…oduce a pdf file
I still receive this error:
even though I am using rmarkdown installed from Github. My pandoc versions are (installed via Homebrew to usr/local/bin):
My .rmd file:
My sessionInfo:
Can you help me resolve this? |
@jokorn That's odd. I'm unable to reproduce your issue with either Pandoc 2.9.2.1 (bundled with RStudio) or 2.10.1. You may check if the environment system2('pandoc', c('-D', 'latex')) |
Hm, it seems to be defined as:
I uninstalled the homebrew version and used the rstudio version of pandoc (version 2.7.3 for my rstudio Version 1.3.1093) instead and then it completed without any errors. I then reinstalled pandoc via homebrew and the error was back. I will just uninstall the homebrew version and use the rstudio version instead (and symlink it to /usr/local/bin). |
I was also testing with the Homebrew version of Pandoc, and wasn't able to reproduce the problem. That's really odd... |
That is weird. Are there any other steps I can take to find the error? Or should we just leave it for now until (if) someone else experiences the same bug? |
I managed to find the cause of the error. I had an old template directory in $HOME/.pandoc with a template called default.latex. This old template was used instead of pandoc's build in template and this old template did not include the cslreferences environment. From the pandoc manual:
I deleted this old template folder and everything now works as expected. Sorry for the inconvenience and thank you for the help. |
Excellent! I'm very glad that you figured it out, and thanks for sharing the solution! I think it will be helpful to future users. |
I added the following in my latex template file and it worked: \newlength{\cslhangindent} |
This old thread has been automatically locked. If you think you have found something related to this, please open a new issue by following the issue guide (https://yihui.org/issue/), and link to this old issue if necessary. |
pandoc now requires a
cslreferences
environment to be defined in the latex template (see jgm/pandoc@0fe635d).This would require the addition of
to https://github.com/rstudio/rmarkdown/blob/master/inst/rmd/latex/default-1.17.0.2.tex.
If useful, I could submit a pull request, but I need to understand one thing first:
Is there any reason why rmarkdown (and bookdown, blogdown) do not just use pandoc’s own default templates?
By filing an issue to this repo, I promise that
xfun::session_info('rmarkdown')
. I have upgraded all my packages to their latest versions (e.g., R, RStudio, and R packages), and also tried the development version:remotes::install_github('rstudio/rmarkdown')
.I understand that my issue may be closed if I don't fulfill my promises.
The text was updated successfully, but these errors were encountered: