Skip to content
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

New Pandoc compains about cslreferences #54

Closed
mpusz opened this issue Dec 21, 2019 · 8 comments
Closed

New Pandoc compains about cslreferences #54

mpusz opened this issue Dec 21, 2019 · 8 comments

Comments

@mpusz
Copy link

mpusz commented Dec 21, 2019

While generating a PDF with citations on the latest Pandoc the following error is reported:

Error producing PDF.
! LaTeX Error: Environment cslreferences undefined.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              
                                                  
l.384 \begin{cslreferences}

make: *** [../wg21/Makefile:6: generated/2007R0_std_from_chars_should_work_with_std_string_view.pdf] Error 43
@mpusz
Copy link
Author

mpusz commented Dec 23, 2019

@allefeld
Copy link

allefeld commented Dec 31, 2019

I had the same problem. It turns out that in the latest version, Pandoc's default LaTeX template (pandoc -D latex) contains this additional section

$if(csl-refs)$
\newlength{\cslhangindent}
\setlength{\cslhangindent}{1.5em}
\newenvironment{cslreferences}%
  {$if(csl-hanging-indent)$\setlength{\parindent}{0pt}%
  \everypar{\setlength{\hangindent}{\cslhangindent}}\ignorespaces$endif$}%
  {\par}
$endif$

and my old modified template did, of course, not. You can fix the problem by inserting the new section into your custom template.

@mpark mpark closed this as completed in 1f33130 Jan 6, 2020
@mpark
Copy link
Owner

mpark commented Jan 6, 2020

@mpusz Thanks for filing / @allefeld Thanks for digging into the issue!

@mercergeoinfo
Copy link

This has come back again in 2.11.1.1 but can be fixed in the template by changing "cslreferences" to "CSLReferences"

kjhealy added a commit to kjhealy/pandoc-templates that referenced this issue Nov 17, 2020
@MyKo101
Copy link

MyKo101 commented Jan 20, 2021

Since this is usually the first result when people are searching this problem, I'm going to add to it.
I recently updated to RStudio 1.4.1103 and with that came an update to pandoc version 2.11.2. A similar error to the above arose when I was trying to compile a document that had worked before the update. I'd previously fixed this exact problem, but now it's back. In the template.tex, adding the following fixed the problem for me:

$if(csl-refs)$
\newlength{\cslhangindent}
\setlength{\cslhangindent}{1.5em}
\newlength{\csllabelwidth}
\setlength{\csllabelwidth}{3em}
\newenvironment{CSLReferences}[3] % #1 hanging-ident, #2 entry spacing
 {% don't indent paragraphs
  \setlength{\parindent}{0pt}
  % turn on hanging indent if param 1 is 1
  \ifodd #1 \everypar{\setlength{\hangindent}{\cslhangindent}}\ignorespaces\fi
  % set entry spacing
  \ifnum #2 > 0
  \setlength{\parskip}{#2\baselineskip}
  \fi
 }%
 {}
\usepackage{calc} % for \widthof, \maxof
\newcommand{\CSLBlock}[1]{#1\hfill\break}
\newcommand{\CSLLeftMargin}[1]{\parbox[t]{\maxof{\widthof{#1}}{\csllabelwidth}}{#1}}
\newcommand{\CSLRightInline}[1]{\parbox[t]{\linewidth}{#1}}
\newcommand{\CSLIndent}[1]{\hspace{\cslhangindent}#1}
$endif$

@mpark
Copy link
Owner

mpark commented Jan 22, 2021

If you're still running into this problem, you're likely on an older version of this project. If you can, please pull the latest version which will install a local, pinned version of pandoc which I will be explicitly keeping in sync.

@MyKo101
Copy link

MyKo101 commented Jan 22, 2021

If you're still running into this problem, you're likely on an older version of this project. If you can, please pull the latest version which will install a local, pinned version of pandoc which I will be explicitly keeping in sync.

Hi, sorry, my reply wasn't explicitly for this repo. I'm running into this issue with RMarkdown. I posted here because when searching for the cslreference problem, this Issue is the first result for me (and so I presume with many other users) and os just trying to provide the solution/workaround. Apologies again for any confusion and for using your Issue as a forum

njahn82 added a commit to njahn82/elsevier_hybrid_invoicing that referenced this issue May 2, 2021
fsolt added a commit to fsolt/dcpo_dem_mood that referenced this issue Aug 13, 2021
dpwiese added a commit to dpwiese/.pandoc that referenced this issue Nov 24, 2021
First had this issue and solution:

mpark/wg21#54 (comment)

Then had this issue and solution:

jgm/pandoc#7215 (comment)

Solution commit here:

jgm/pandoc@356795d
dpwiese added a commit to dpwiese/.pandoc that referenced this issue Nov 24, 2021
Fix compilation error on BigSur 11.6

Error producing PDF.
! Package keyval Error: letter undefined.

See the keyval package documentation for explanation.
Type  H <return>  for immediate help.
 ...

l.1005 \ProcessOptionsKV[p]{Gm}

Fix no references

First had this issue and solution:

mpark/wg21#54 (comment)

Then had this issue and solution:

jgm/pandoc#7215 (comment)

Solution commit here:

jgm/pandoc@356795d
rkunnema pushed a commit to rkunnema/manual that referenced this issue Jan 4, 2022
rkunnema pushed a commit to rkunnema/manual that referenced this issue Mar 31, 2022
@thomas-schuster
Copy link

Thanks @MyKo101 for this helpful solution! While I do not use RMarkdown, I still had this issue when using Pandoc to convert markdown files for articles.

Final remark, I had to modify one of your lines slightly (was probably just a typo):

\newenvironment{CSLReferences}[3] % #1 hanging-ident, #2 entry spacing

becomes

\newenvironment{CSLReferences}[2] % #1 hanging-ident, #2 entry spacing

cascremers pushed a commit to cascremers/tamarin-prover that referenced this issue May 15, 2024
cascremers pushed a commit to cascremers/tamarin-prover that referenced this issue May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants