aboutsummaryrefslogtreecommitdiff
path: root/pandoc/templates
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fischer@muhq.space>2024-11-02 17:32:06 +0100
committerFlorian Fischer <florian.fischer@muhq.space>2024-11-02 17:32:06 +0100
commit9978eb28ca57cb8319428a09e22bc422d0b1d5ff (patch)
tree3e4c14df415442a2a254095bab3e4e21933900c1 /pandoc/templates
parentc0259e241455ddc52bca938ebf0fa0700cd94b92 (diff)
downloadunterricht-9978eb28ca57cb8319428a09e22bc422d0b1d5ff.tar.gz
unterricht-9978eb28ca57cb8319428a09e22bc422d0b1d5ff.zip
update the beamer template in order to fix problems when using citeproc
Diffstat (limited to 'pandoc/templates')
-rw-r--r--pandoc/templates/beamer.tex38
1 files changed, 24 insertions, 14 deletions
diff --git a/pandoc/templates/beamer.tex b/pandoc/templates/beamer.tex
index 659854d6..53b23e37 100644
--- a/pandoc/templates/beamer.tex
+++ b/pandoc/templates/beamer.tex
@@ -341,28 +341,38 @@ $if(pagestyle)$
\pagestyle{$pagestyle$}
$endif$
$if(csl-refs)$
+% definitions for citeproc citations
+\NewDocumentCommand\citeproctext{}{}
+\NewDocumentCommand\citeproc{mm}{%
+ \begingroup\def\citeproctext{#2}\cite{#1}\endgroup}
+\makeatletter
+ % allow citations to break across lines
+ \let\@cite@ofmt\@firstofone
+ % avoid brackets around text for \cite:
+ \def\@biblabel#1{}
+ \def\@cite#1#2{{#1\if@tempswa , #2\fi}}
+\makeatother
\newlength{\cslhangindent}
\setlength{\cslhangindent}{1.5em}
\newlength{\csllabelwidth}
\setlength{\csllabelwidth}{3em}
-\newlength{\cslentryspacingunit} % times entry-spacing
-\setlength{\cslentryspacingunit}{\parskip}
-\newenvironment{CSLReferences}[2] % #1 hanging-ident, #2 entry spacing
- {% don't indent paragraphs
- \setlength{\parindent}{0pt}
+\newenvironment{CSLReferences}[2] % #1 hanging-indent, #2 entry-spacing
+ {\begin{list}{}{%
+ \setlength{\itemindent}{0pt}
+ \setlength{\leftmargin}{0pt}
+ \setlength{\parsep}{0pt}
% turn on hanging indent if param 1 is 1
\ifodd #1
- \let\oldpar\par
- \def\par{\hangindent=\cslhangindent\oldpar}
+ \setlength{\leftmargin}{\cslhangindent}
+ \setlength{\itemindent}{-1\cslhangindent}
\fi
% set entry spacing
- \setlength{\parskip}{#2\cslentryspacingunit}
- }%
- {}
+ \setlength{\itemsep}{#2\baselineskip}}}
+ {\end{list}}
\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{\CSLBlock}[1]{\hfill\break\parbox[t]{\linewidth}{\strut\ignorespaces#1\strut}}
+\newcommand{\CSLLeftMargin}[1]{\parbox[t]{\csllabelwidth}{\strut#1\strut}}
+\newcommand{\CSLRightInline}[1]{\parbox[t]{\linewidth - \csllabelwidth}{\strut#1\strut}}
\newcommand{\CSLIndent}[1]{\hspace{\cslhangindent}#1}
$endif$
$if(lang)$
@@ -421,7 +431,7 @@ $endif$
$if(csquotes)$
\usepackage{csquotes}
$endif$
-\IfFileExists{bookmark.sty}{\usepackage{bookmark}}{\usepackage{hyperref}}
+\usepackage{bookmark}
\IfFileExists{xurl.sty}{\usepackage{xurl}}{} % add URL line breaks if available
\urlstyle{$if(urlstyle)$$urlstyle$$else$same$endif$}
$if(links-as-notes)$