You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have provided the necessary information about my issue.
If I'm asking a question, I have already asked it on Stack Overflow or RStudio Community, waited for at least 24 hours, and included a link to my question there.
If I'm filing a bug report, I have included a minimal, self-contained, and reproducible example, and have also included 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').
If I have posted the same issue elsewhere, I have also mentioned it in this issue.
I have learned the Github Markdown syntax, and formatted my issue correctly.
I understand that my issue may be closed if I don't fulfill my promises.
changed the title [-]cslreferences environment missing in latex template[/-][+]Pandoc 2.8 error "! LaTeX Error: Environment cslreferences undefined."[/+]on Dec 6, 2019
@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 cslreferences is defined in the template:
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).
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:
You can find the default user data directory on your system by looking at the output of pandoc --version. A reference.odt, reference.docx, epub.css, templates, slidy, slideous, or s5 directory placed in this directory will override pandoc’s normal defaults.
I deleted this old template folder and everything now works as expected.
Sorry for the inconvenience and thank you for the help.
Reacted by Yihui Xie, Christophe Dervieux, Hugo Santarem de Araujo and Nami Sunami
Activity
yihui commentedon Sep 19, 2019
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:
See
?rmarkdown::pdf_document.yihui commentedon Nov 25, 2019
Should be fixed now. Please test the development version of rmarkdown with
Thanks for the report!
Add cslreferences environment definition to template.
[-]cslreferences environment missing in latex template[/-][+]Pandoc 2.8 error "! LaTeX Error: Environment cslreferences undefined."[/+]firasm commentedon Mar 3, 2020
thanks this fixed the issue for me!
resolve rstudio/rmarkdown#1649 bug with a preamble so that it will pr…
jokorn commentedon Oct 3, 2020
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?
yihui commentedon Oct 4, 2020
@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
cslreferencesis defined in the template:jokorn commentedon Oct 4, 2020
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).
yihui commentedon Oct 4, 2020
I was also testing with the Homebrew version of Pandoc, and wasn't able to reproduce the problem. That's really odd...
jokorn commentedon Oct 4, 2020
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?
jokorn commentedon Oct 4, 2020
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.
yihui commentedon Oct 5, 2020
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.
Nicktz commentedon Oct 27, 2020
I added the following in my latex template file and it worked:
\newlength{\cslhangindent}
\setlength{\cslhangindent}{1.5em}
\newenvironment{CSLReferences}%
{\setlength{\parindent}{0pt}%
\everypar{\setlength{\hangindent}{\cslhangindent}}\ignorespaces}%
{\par}
for some reason this seemed to fix that cslreference error that poppe…
github-actions commentedon Apr 27, 2021
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.