From 3ee9c95374450f73145cc7beeae3782ba26cbb58 Mon Sep 17 00:00:00 2001 From: Marty Oehme Date: Mon, 2 Nov 2020 19:08:12 +0100 Subject: [PATCH] bibtex: Update pandoc latex template Enables template to work with the new version (2.11) of pandoc. --- .../share/pandoc/templates/default.latex | 24 +++++++++++++++---- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/bibtex/.local/share/pandoc/templates/default.latex b/bibtex/.local/share/pandoc/templates/default.latex index f988c5e..f21d1ed 100644 --- a/bibtex/.local/share/pandoc/templates/default.latex +++ b/bibtex/.local/share/pandoc/templates/default.latex @@ -397,10 +397,25 @@ $endif$ $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} +\newlength{\csllabelwidth} +\setlength{\csllabelwidth}{3em} +\newenvironment{CSLReferences}[3] % #1 hanging-ident, #2 entry sp + {% 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 line spacing + % set entry spacing + \ifnum #2 > 0 + \setlength{\parskip}{#3\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$ $if(title)$ @@ -562,4 +577,3 @@ $include-after$ $endfor$ \end{document} -