GithubHelp home page GithubHelp logo

Comments (8)

MyKo101 avatar MyKo101 commented on July 22, 2024 9

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$

from wg21.

allefeld avatar allefeld commented on July 22, 2024 6

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.

from wg21.

mercergeoinfo avatar mercergeoinfo commented on July 22, 2024 3

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

from wg21.

mpark avatar mpark commented on July 22, 2024 1

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

from wg21.

mpusz avatar mpusz commented on July 22, 2024

Example of a failing paper: https://github.com/mpusz/wg21-papers/blob/master/src/2007R0_std_from_chars_should_work_with_std_string_view.md.

from wg21.

mpark avatar mpark commented on July 22, 2024

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.

from wg21.

MyKo101 avatar MyKo101 commented on July 22, 2024

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

from wg21.

thomas-schuster avatar thomas-schuster commented on July 22, 2024

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

from wg21.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.