git.iko.soy/typeable/pandoc
on master help sign in
LaTeX template: Move CSL macro defs before header-includes.
0e5b840John MacFarlane
data/templates/default.latex+25−25
@@ -325,6 +325,31 @@ $endif$
325$if(pagestyle)$
325$if(pagestyle)$
326\pagestyle{$pagestyle$}
326\pagestyle{$pagestyle$}
327$endif$
327$endif$
328+$if(csl-refs)$
329+\newlength{\cslhangindent}
330+\setlength{\cslhangindent}{1.5em}
331+\newlength{\csllabelwidth}
332+\setlength{\csllabelwidth}{3em}
333+\newenvironment{CSLReferences}[2] % #1 hanging-ident, #2 entry spacing
334+ {% don't indent paragraphs
335+ \setlength{\parindent}{0pt}
336+ % turn on hanging indent if param 1 is 1
337+ \ifodd #1
338+ \let\oldpar\par
339+ \def\par{\hangindent=\cslhangindent\oldpar}
340+ \fi
341+ % set entry spacing
342+ \ifnum #2 > 0
343+ \setlength{\parskip}{#2\baselineskip}
344+ \fi
345+ }%
346+ {}
347+\usepackage{calc}
348+\newcommand{\CSLBlock}[1]{#1\hfill\break}
349+\newcommand{\CSLLeftMargin}[1]{\parbox[t]{\csllabelwidth}{#1}}
350+\newcommand{\CSLRightInline}[1]{\parbox[t]{\linewidth - \csllabelwidth}{#1}\break}
351+\newcommand{\CSLIndent}[1]{\hspace{\cslhangindent}#1}
352+$endif$
328$for(header-includes)$
353$for(header-includes)$
329$header-includes$
354$header-includes$
330$endfor$
355$endfor$
@@ -375,31 +400,6 @@ $endif$
375$if(nocite-ids)$
400$if(nocite-ids)$
376\nocite{$for(nocite-ids)$$it$$sep$, $endfor$}
401\nocite{$for(nocite-ids)$$it$$sep$, $endfor$}
377$endif$
402$endif$
378−$if(csl-refs)$
379−\newlength{\cslhangindent}
380−\setlength{\cslhangindent}{1.5em}
381−\newlength{\csllabelwidth}
382−\setlength{\csllabelwidth}{3em}
383−\newenvironment{CSLReferences}[2] % #1 hanging-ident, #2 entry spacing
384− {% don't indent paragraphs
385− \setlength{\parindent}{0pt}
386− % turn on hanging indent if param 1 is 1
387− \ifodd #1
388− \let\oldpar\par
389− \def\par{\hangindent=\cslhangindent\oldpar}
390− \fi
391− % set entry spacing
392− \ifnum #2 > 0
393− \setlength{\parskip}{#2\baselineskip}
394− \fi
395− }%
396− {}
397−\usepackage{calc}
398−\newcommand{\CSLBlock}[1]{#1\hfill\break}
399−\newcommand{\CSLLeftMargin}[1]{\parbox[t]{\csllabelwidth}{#1}}
400−\newcommand{\CSLRightInline}[1]{\parbox[t]{\linewidth - \csllabelwidth}{#1}\break}
401−\newcommand{\CSLIndent}[1]{\hspace{\cslhangindent}#1}
402−$endif$
403$if(csquotes)$
403$if(csquotes)$
404\usepackage{csquotes}
404\usepackage{csquotes}
405$endif$
405$endif$