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

Fix llncs.tex #1

Open
mfhepp opened this issue Mar 8, 2021 · 3 comments
Open

Fix llncs.tex #1

mfhepp opened this issue Mar 8, 2021 · 3 comments

Comments

@mfhepp
Copy link

mfhepp commented Mar 8, 2021

Hi,
I found your code super-useful for setting up my own Markdown-centric research workflow. Now, there are a few caveats as Pandoc has evolved quite a bit.

First of all, you must insert the following code, taken from mpark/wg21#54 (comment), below line 142 of templates/llncs.tex:

$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$

This is because Pandoc has changed and now requires these additional variables. Likely, you will also have to apply this to the ACM and IEEE templates, but I haven't tried that yet.

Second, the citeproc filter is now (2.11.4) part of pandoc and no longer an external component; hence, the build instructions in the makefile must be changed like so (this is my local version, not exactly yours):

pandoc  --wrap=preserve \
	--citeproc \
	--filter pandoc-crossref \
	--csl=./styles/llncs.csl \
	--number-sections \
	--template=./templates/llncs.latex \
	-o output/lncs-paper.pdf paper.md
rm ./llncs.cls

Third, the pandoc-crossref binaries work only with a matching pandoc version. Unfortunately, if you use condaas a package manager, as of today, the available versions for both don't match and the 0.3.9.0 version of pandoc--crossrefavailable from conda-forge does not run on OSX Big Sur.

I solved this by installing the latest binary locally as part of my workflow and use the local path, like so:

pandoc  --wrap=preserve \
	--citeproc \
	--filter ./pandoc-crossref/pandoc-crossref \
	--csl=./styles/llncs.csl \
	--number-sections \
	--template=./templates/llncs.latex \
	-o output/lncs-paper.pdf paper.md
rm ./llncs.cls
@mfhepp
Copy link
Author

mfhepp commented Mar 8, 2021

BTW: The original link to pandoc is here: jgm/pandoc@0fe635d

@thomas-schuster
Copy link

Did you try the other templates now? Did it work out?

I just started with pandoc and thought I could use this project as a template but for now I am kind of debugging from one error to the next one. Currently:

! LaTeX Error: Environment CSLReferences undefined.
...
l.380 \begin{CSLReferences}

@BeauJoh
Copy link
Owner

BeauJoh commented Dec 11, 2021

Hi @thomas-schuster, I'm sorry my templates and workflow aren't working for you out of the box.
It did work well for me, I wrote a few papers and my thesis from these tools and it supported a number of latex styles.
Unfortunately, with my work at the moment I've let this codebase slide. If I find time tomorrow I'll apply @mfhepp's suggestions and try to update the workflow (but no promises). If you can fix it yourself, I'd appreciate a pull request :)

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

3 participants