diff options
author | John MacFarlane <jgm@berkeley.edu> | 2021-05-14 08:48:59 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2021-05-14 08:48:59 -0700 |
commit | 0e5b840c2a340f8b8c2e96148046af2dfd493bcb (patch) | |
tree | 078ee9b10482c66d544a52bdeb2a5c0f3ccffec2 /data | |
parent | 3ec5726c9b7b9f7cc41ca5f26a80c347e20afc9a (diff) | |
download | pandoc-0e5b840c2a340f8b8c2e96148046af2dfd493bcb.tar.gz |
LaTeX template: Move CSL macro defs before header-includes.
This allows them to be overriden by header-includes.
Closes #7286.
Diffstat (limited to 'data')
-rw-r--r-- | data/templates/default.latex | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/data/templates/default.latex b/data/templates/default.latex index f39e56c79..142fe3e55 100644 --- a/data/templates/default.latex +++ b/data/templates/default.latex @@ -325,6 +325,31 @@ $endif$ $if(pagestyle)$ \pagestyle{$pagestyle$} $endif$ +$if(csl-refs)$ +\newlength{\cslhangindent} +\setlength{\cslhangindent}{1.5em} +\newlength{\csllabelwidth} +\setlength{\csllabelwidth}{3em} +\newenvironment{CSLReferences}[2] % #1 hanging-ident, #2 entry spacing + {% don't indent paragraphs + \setlength{\parindent}{0pt} + % turn on hanging indent if param 1 is 1 + \ifodd #1 + \let\oldpar\par + \def\par{\hangindent=\cslhangindent\oldpar} + \fi + % set entry spacing + \ifnum #2 > 0 + \setlength{\parskip}{#2\baselineskip} + \fi + }% + {} +\usepackage{calc} +\newcommand{\CSLBlock}[1]{#1\hfill\break} +\newcommand{\CSLLeftMargin}[1]{\parbox[t]{\csllabelwidth}{#1}} +\newcommand{\CSLRightInline}[1]{\parbox[t]{\linewidth - \csllabelwidth}{#1}\break} +\newcommand{\CSLIndent}[1]{\hspace{\cslhangindent}#1} +$endif$ $for(header-includes)$ $header-includes$ $endfor$ @@ -375,31 +400,6 @@ $endif$ $if(nocite-ids)$ \nocite{$for(nocite-ids)$$it$$sep$, $endfor$} $endif$ -$if(csl-refs)$ -\newlength{\cslhangindent} -\setlength{\cslhangindent}{1.5em} -\newlength{\csllabelwidth} -\setlength{\csllabelwidth}{3em} -\newenvironment{CSLReferences}[2] % #1 hanging-ident, #2 entry spacing - {% don't indent paragraphs - \setlength{\parindent}{0pt} - % turn on hanging indent if param 1 is 1 - \ifodd #1 - \let\oldpar\par - \def\par{\hangindent=\cslhangindent\oldpar} - \fi - % set entry spacing - \ifnum #2 > 0 - \setlength{\parskip}{#2\baselineskip} - \fi - }% - {} -\usepackage{calc} -\newcommand{\CSLBlock}[1]{#1\hfill\break} -\newcommand{\CSLLeftMargin}[1]{\parbox[t]{\csllabelwidth}{#1}} -\newcommand{\CSLRightInline}[1]{\parbox[t]{\linewidth - \csllabelwidth}{#1}\break} -\newcommand{\CSLIndent}[1]{\hspace{\cslhangindent}#1} -$endif$ $if(csquotes)$ \usepackage{csquotes} $endif$ |