diff --git a/manual/template/eisvogel.tex b/manual/template/eisvogel.tex index 6544e46..742b0f5 100644 --- a/manual/template/eisvogel.tex +++ b/manual/template/eisvogel.tex @@ -1,6 +1,6 @@ %% -% Copyright (c) 2017 - 2021, Pascal Wagler; -% Copyright (c) 2014 - 2021, John MacFarlane +% Copyright (c) 2017 - 2024, Pascal Wagler; +% Copyright (c) 2014 - 2024, John MacFarlane % % All rights reserved. % @@ -43,12 +43,7 @@ % Options for packages loaded elsewhere \PassOptionsToPackage{unicode$for(hyperrefoptions)$,$hyperrefoptions$$endfor$}{hyperref} \PassOptionsToPackage{hyphens}{url} -\PassOptionsToPackage{dvipsnames,svgnames*,x11names*,table}{xcolor} -$if(dir)$ -$if(latex-dir-rtl)$ -\PassOptionsToPackage{RTLdocument}{bidi} -$endif$ -$endif$ +\PassOptionsToPackage{dvipsnames,svgnames,x11names,table}{xcolor} $if(CJKmainfont)$ \PassOptionsToPackage{space}{xeCJK} $endif$ @@ -57,9 +52,6 @@ $if(fontsize)$ $fontsize$, $endif$ -$if(lang)$ - $babel-lang$, -$endif$ $if(papersize)$ $papersize$paper, $else$ @@ -73,6 +65,9 @@ $if(aspectratio)$ aspectratio=$aspectratio$, $endif$ +$if(babel-lang)$ + $babel-lang$, +$endif$ $endif$ $for(classoption)$ $classoption$$sep$, @@ -84,6 +79,9 @@ \usebackgroundtemplate{% \includegraphics[width=\paperwidth]{$background-image$}% } +% In beamer background-image does not work well when other images are used, so this is the workaround +\pgfdeclareimage[width=\paperwidth,height=\paperheight]{background}{$background-image$} +\usebackgroundtemplate{\pgfuseimage{background}} $endif$ \usepackage{pgfpages} \setbeamertemplate{caption}[numbered] @@ -105,13 +103,13 @@ } \setbeamertemplate{section page}{ \centering - \begin{beamercolorbox}[sep=12pt,center]{part title} + \begin{beamercolorbox}[sep=12pt,center]{section title} \usebeamerfont{section title}\insertsection\par \end{beamercolorbox} } \setbeamertemplate{subsection page}{ \centering - \begin{beamercolorbox}[sep=8pt,center]{part title} + \begin{beamercolorbox}[sep=8pt,center]{subsection title} \usebeamerfont{subsection title}\insertsubsection\par \end{beamercolorbox} } @@ -133,49 +131,103 @@ \usepackage{beamerarticle} % needs to be loaded first $endif$ \usepackage{amsmath,amssymb} -$if(fontfamily)$ -\usepackage[$for(fontfamilyoptions)$$fontfamilyoptions$$sep$,$endfor$]{$fontfamily$} -$else$ -\usepackage{lmodern} -$endif$ $if(linestretch)$ \usepackage{setspace} $else$ +% Use setspace anyway because we change the default line spacing. +% The spacing is changed early to affect the titlepage and the TOC. \usepackage{setspace} \setstretch{1.2} $endif$ -\usepackage{ifxetex,ifluatex} -\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex +\usepackage{iftex} +\ifPDFTeX \usepackage[$if(fontenc)$$fontenc$$else$T1$endif$]{fontenc} \usepackage[utf8]{inputenc} \usepackage{textcomp} % provide euro and other symbols \else % if luatex or xetex $if(mathspec)$ - \ifxetex - \usepackage{mathspec} + \ifXeTeX + \usepackage{mathspec} % this also loads fontspec \else - \usepackage{unicode-math} + \usepackage{unicode-math} % this also loads fontspec \fi $else$ - \usepackage{unicode-math} + \usepackage{unicode-math} % this also loads fontspec $endif$ - \defaultfontfeatures{Scale=MatchLowercase} + \defaultfontfeatures{Scale=MatchLowercase}$-- must come before Beamer theme \defaultfontfeatures[\rmfamily]{Ligatures=TeX,Scale=1} +\fi +$if(fontfamily)$ +$else$ +$-- Set default font before Beamer theme so the theme can override it +\usepackage{lmodern} +$endif$ +$-- Set Beamer theme before user font settings so they can override theme +$if(beamer)$ +$if(theme)$ +\usetheme[$for(themeoptions)$$themeoptions$$sep$,$endfor$]{$theme$} +$endif$ +$if(colortheme)$ +\usecolortheme{$colortheme$} +$endif$ +$if(fonttheme)$ +\usefonttheme{$fonttheme$} +$endif$ $if(mainfont)$ - \setmainfont[$for(mainfontoptions)$$mainfontoptions$$sep$,$endfor$]{$mainfont$} +\usefonttheme{serif} % use mainfont rather than sansfont for slide text +$endif$ +$if(innertheme)$ +\useinnertheme{$innertheme$} +$endif$ +$if(outertheme)$ +\useoutertheme{$outertheme$} +$endif$ +$endif$ +$-- User font settings (must come after default font and Beamer theme) +$if(fontfamily)$ +\usepackage[$for(fontfamilyoptions)$$fontfamilyoptions$$sep$,$endfor$]{$fontfamily$} +$endif$ +\ifPDFTeX\else + % xetex/luatex font selection +$if(mainfont)$ + $if(mainfontfallback)$ + \ifLuaTeX + \usepackage{luaotfload} + \directlua{luaotfload.add_fallback("mainfontfallback",{ + $for(mainfontfallback)$"$mainfontfallback$"$sep$,$endfor$ + })} + \fi + $endif$ + \setmainfont[$for(mainfontoptions)$$mainfontoptions$$sep$,$endfor$$if(mainfontfallback)$,RawFeature={fallback=mainfontfallback}$endif$]{$mainfont$} $endif$ $if(sansfont)$ - \setsansfont[$for(sansfontoptions)$$sansfontoptions$$sep$,$endfor$]{$sansfont$} + $if(sansfontfallback)$ + \ifLuaTeX + \usepackage{luaotfload} + \directlua{luaotfload.add_fallback("sansfontfallback",{ + $for(sansfontfallback)$"$sansfontfallback$"$sep$,$endfor$ + })} + \fi + $endif$ + \setsansfont[$for(sansfontoptions)$$sansfontoptions$$sep$,$endfor$$if(sansfontfallback)$,RawFeature={fallback=sansfontfallback}$endif$]{$sansfont$} $endif$ $if(monofont)$ - \setmonofont[$for(monofontoptions)$$monofontoptions$$sep$,$endfor$]{$monofont$} + $if(monofontfallback)$ + \ifLuaTeX + \usepackage{luaotfload} + \directlua{luaotfload.add_fallback("monofontfallback",{ + $for(monofontfallback)$"$monofontfallback$"$sep$,$endfor$ + })} + \fi + $endif$ + \setmonofont[$for(monofontoptions)$$monofontoptions$$sep$,$endfor$$if(monofontfallback)$,RawFeature={fallback=monofontfallback}$endif$]{$monofont$} $endif$ $for(fontfamilies)$ \newfontfamily{$fontfamilies.name$}[$for(fontfamilies.options)$$fontfamilies.options$$sep$,$endfor$]{$fontfamilies.font$} $endfor$ $if(mathfont)$ $if(mathspec)$ - \ifxetex + \ifXeTeX \setmathfont(Digits,Latin,Greek)[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$} \else \setmathfont[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$} @@ -185,42 +237,47 @@ $endif$ $endif$ $if(CJKmainfont)$ - \ifxetex + \ifXeTeX \usepackage{xeCJK} \setCJKmainfont[$for(CJKoptions)$$CJKoptions$$sep$,$endfor$]{$CJKmainfont$} + $if(CJKsansfont)$ + \setCJKsansfont[$for(CJKoptions)$$CJKoptions$$sep$,$endfor$]{$CJKsansfont$} + $endif$ + $if(CJKmonofont)$ + \setCJKmonofont[$for(CJKoptions)$$CJKoptions$$sep$,$endfor$]{$CJKmonofont$} + $endif$ \fi $endif$ $if(luatexjapresetoptions)$ - \ifluatex + \ifLuaTeX \usepackage[$for(luatexjapresetoptions)$$luatexjapresetoptions$$sep$,$endfor$]{luatexja-preset} \fi $endif$ $if(CJKmainfont)$ - \ifluatex + \ifLuaTeX \usepackage[$for(luatexjafontspecoptions)$$luatexjafontspecoptions$$sep$,$endfor$]{luatexja-fontspec} \setmainjfont[$for(CJKoptions)$$CJKoptions$$sep$,$endfor$]{$CJKmainfont$} \fi $endif$ \fi -$if(beamer)$ -$if(theme)$ -\usetheme[$for(themeoptions)$$themeoptions$$sep$,$endfor$]{$theme$} -$endif$ -$if(colortheme)$ -\usecolortheme{$colortheme$} -$endif$ -$if(fonttheme)$ -\usefonttheme{$fonttheme$} -$endif$ -$if(mainfont)$ -\usefonttheme{serif} % use mainfont rather than sansfont for slide text -$endif$ -$if(innertheme)$ -\useinnertheme{$innertheme$} -$endif$ -$if(outertheme)$ -\useoutertheme{$outertheme$} -$endif$ +$if(zero-width-non-joiner)$ +%% Support for zero-width non-joiner characters. +\makeatletter +\def\zerowidthnonjoiner{% + % Prevent ligatures and adjust kerning, but still support hyphenating. + \texorpdfstring{% + \TextOrMath{\nobreak\discretionary{-}{}{\kern.03em}% + \ifvmode\else\nobreak\hskip\z@skip\fi}{}% + }{}% +} +\makeatother +\ifPDFTeX + \DeclareUnicodeCharacter{200C}{\zerowidthnonjoiner} +\else + \catcode`^^^^200c=\active + \protected\def ^^^^200c{\zerowidthnonjoiner} +\fi +%% End of ZWNJ support $endif$ % Use upquote if available, for straight quotes in verbatim environments \IfFileExists{upquote.sty}{\usepackage{upquote}}{} @@ -249,7 +306,6 @@ \definecolor{default-filecolor}{HTML}{A50000} \definecolor{default-citecolor}{HTML}{4077C0} \definecolor{default-urlcolor}{HTML}{4077C0} -\IfFileExists{xurl.sty}{\usepackage{xurl}}{} % add URL line breaks if available $if(footnotes-pretty)$ % load footmisc in order to customize footnotes (footmisc has to be loaded before hyperref, cf. https://tex.stackexchange.com/a/169124/144087) \usepackage[hang,flushmargin,bottom,multiple]{footmisc} @@ -258,38 +314,6 @@ \setlength{\skip\footins}{0.3cm} % set space between page content and footnote \setlength{\footskip}{0.9cm} % set space between footnote and page bottom $endif$ -\IfFileExists{bookmark.sty}{\usepackage{bookmark}}{\usepackage{hyperref}} -\hypersetup{ -$if(title-meta)$ - pdftitle={$title-meta$}, -$endif$ -$if(author-meta)$ - pdfauthor={$author-meta$}, -$endif$ -$if(lang)$ - pdflang={$lang$}, -$endif$ -$if(subject)$ - pdfsubject={$subject$}, -$endif$ -$if(keywords)$ - pdfkeywords={$for(keywords)$$keywords$$sep$, $endfor$}, -$endif$ -$if(colorlinks)$ - colorlinks=true, - linkcolor=$if(linkcolor)$$linkcolor$$else$default-linkcolor$endif$, - filecolor=$if(filecolor)$$filecolor$$else$default-filecolor$endif$, - citecolor=$if(citecolor)$$citecolor$$else$default-citecolor$endif$, - urlcolor=$if(urlcolor)$$urlcolor$$else$default-urlcolor$endif$, -$else$ - hidelinks, -$endif$ - breaklinks=true, - pdfcreator={LaTeX via pandoc with the Eisvogel template}} -\urlstyle{same} % disable monospaced font for URLs -$if(verbatim-in-note)$ -\VerbatimFootnotes % allow verbatim text in footnotes -$endif$ $if(geometry)$ $if(beamer)$ \geometry{$for(geometry)$$geometry$$sep$,$endfor$} @@ -302,7 +326,7 @@ \usepackage[margin=2.5cm,includehead=true,includefoot=true,centering,$for(geometry)$$geometry$$sep$,$endfor$]{geometry} $endif$ $endif$ -$if(logo)$ +$if(titlepage-logo)$ \usepackage[export]{adjustbox} \usepackage{graphicx} $endif$ @@ -368,26 +392,50 @@ $if(graphics)$ \usepackage{graphicx} \makeatletter -\def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth\else\Gin@nat@width\fi} -\def\maxheight{\ifdim\Gin@nat@height>\textheight\textheight\else\Gin@nat@height\fi} -\makeatother -% Scale images if necessary, so that they will not overflow the page -% margins by default, and it is still possible to overwrite the defaults -% using explicit options in \includegraphics[width, height, ...]{} -\setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio} +\newsavebox\pandoc@box +\newcommand*\pandocbounded[1]{% scales image to fit in text height/width + \sbox\pandoc@box{#1}% + \Gscale@div\@tempa{\textheight}{\dimexpr\ht\pandoc@box+\dp\pandoc@box\relax}% + \Gscale@div\@tempb{\linewidth}{\wd\pandoc@box}% + \ifdim\@tempb\p@<\@tempa\p@\let\@tempa\@tempb\fi% select the smaller of both + \ifdim\@tempa\p@<\p@\scalebox{\@tempa}{\usebox\pandoc@box}% + \else\usebox{\pandoc@box}% + \fi% +} % Set default figure placement to htbp -\makeatletter -\def\fps@figure{htbp} +% Make use of float-package and set default placement for figures to H. +% The option H means 'PUT IT HERE' (as opposed to the standard h option which means 'You may put it here if you like'). +\usepackage{float} +\floatplacement{figure}{$if(float-placement-figure)$$float-placement-figure$$else$H$endif$} \makeatother $endif$ -$if(links-as-notes)$ -% Make links footnotes instead of hotlinks: -\DeclareRobustCommand{\href}[2]{#2\footnote{\url{#1}}} +$if(svg)$ +\usepackage{svg} $endif$ $if(strikeout)$ -\usepackage[normalem]{ulem} -% Avoid problems with \sout in headers with hyperref -\pdfstringdefDisableCommands{\renewcommand{\sout}{}} +$-- also used for underline +\ifLuaTeX + \usepackage{luacolor} + \usepackage[soul]{lua-ul} +\else +\usepackage{soul} +$if(beamer)$ + \makeatletter + \let\HL\hl + \renewcommand\hl{% fix for beamer highlighting + \let\set@color\beamerorig@set@color + \let\reset@color\beamerorig@reset@color + \HL} + \makeatother +$endif$ +$if(CJKmainfont)$ + \ifXeTeX + % soul's \st doesn't work for CJK: + \usepackage{xeCJKfntef} + \renewcommand{\st}[1]{\sout{#1}} + \fi +$endif$ +\fi $endif$ \setlength{\emergencystretch}{3em} % prevent overfull lines \providecommand{\tightlist}{% @@ -397,64 +445,110 @@ $else$ \setcounter{secnumdepth}{-\maxdimen} % remove section numbering $endif$ +$if(subfigure)$ +\usepackage{subcaption} +$endif$ $if(beamer)$ $else$ $if(block-headings)$ % Make \paragraph and \subparagraph free-standing +\makeatletter \ifx\paragraph\undefined\else \let\oldparagraph\paragraph - \renewcommand{\paragraph}[1]{\oldparagraph{#1}\mbox{}} + \renewcommand{\paragraph}{ + \@ifstar + \xxxParagraphStar + \xxxParagraphNoStar + } + \newcommand{\xxxParagraphStar}[1]{\oldparagraph*{#1}\mbox{}} + \newcommand{\xxxParagraphNoStar}[1]{\oldparagraph{#1}\mbox{}} \fi \ifx\subparagraph\undefined\else \let\oldsubparagraph\subparagraph - \renewcommand{\subparagraph}[1]{\oldsubparagraph{#1}\mbox{}} + \renewcommand{\subparagraph}{ + \@ifstar + \xxxSubParagraphStar + \xxxSubParagraphNoStar + } + \newcommand{\xxxSubParagraphStar}[1]{\oldsubparagraph*{#1}\mbox{}} + \newcommand{\xxxSubParagraphNoStar}[1]{\oldsubparagraph{#1}\mbox{}} \fi +\makeatother $endif$ $endif$ $if(pagestyle)$ \pagestyle{$pagestyle$} $endif$ - -% Make use of float-package and set default placement for figures to H. -% The option H means 'PUT IT HERE' (as opposed to the standard h option which means 'You may put it here if you like'). -\usepackage{float} -\floatplacement{figure}{$if(float-placement-figure)$$float-placement-figure$$else$H$endif$} - -$for(header-includes)$ -$header-includes$ -$endfor$ +$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} +\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 + \setlength{\leftmargin}{\cslhangindent} + \setlength{\itemindent}{-1\cslhangindent} + \fi + % set entry spacing + \setlength{\itemsep}{#2\baselineskip}}} + {\end{list}} +\usepackage{calc} +\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)$ -\ifxetex - $if(mainfont)$ - $else$ - % See issue https://github.com/reutenauer/polyglossia/issues/127 - \renewcommand*\familydefault{\sfdefault} - $endif$ - % Load polyglossia as late as possible: uses bidi with RTL langages (e.g. Hebrew, Arabic) - \usepackage{polyglossia} - \setmainlanguage[$for(polyglossia-lang.options)$$polyglossia-lang.options$$sep$,$endfor$]{$polyglossia-lang.name$} -$for(polyglossia-otherlangs)$ - \setotherlanguage[$for(polyglossia-otherlangs.options)$$polyglossia-otherlangs.options$$sep$,$endfor$]{$polyglossia-otherlangs.name$} -$endfor$ +\ifLuaTeX +\usepackage[bidi=basic]{babel} +\else +\usepackage[bidi=default]{babel} +\fi +$if(babel-lang)$ +\babelprovide[main,import]{$babel-lang$} +$if(mainfont)$ +\ifPDFTeX \else - \usepackage[$for(babel-otherlangs)$$babel-otherlangs$,$endfor$main=$babel-lang$]{babel} +\babelfont{rm}[$for(mainfontoptions)$$mainfontoptions$$sep$,$endfor$$if(mainfontfallback)$,RawFeature={fallback=mainfontfallback}$endif$]{$mainfont$} +\fi +$endif$ +$endif$ +$for(babel-otherlangs)$ +\babelprovide[import]{$babel-otherlangs$} +$endfor$ +$for(babelfonts/pairs)$ +\babelfont[$babelfonts.key$]{rm}{$babelfonts.value$} +$endfor$ % get rid of language-specific shorthands (see #6817): \let\LanguageShortHands\languageshorthands \def\languageshorthands#1{} -$if(babel-newcommands)$ - $babel-newcommands$ -$endif$ +$if(selnolig-langs)$ +\ifLuaTeX + \usepackage[$for(selnolig-langs)$$it$$sep$,$endfor$]{selnolig} % disable illegal ligatures \fi $endif$ -\ifluatex - \usepackage{selnolig} % disable illegal ligatures -\fi +$endif$ +$for(header-includes)$ +$header-includes$ +$endfor$ $if(dir)$ -\ifxetex - % Load bidi as late as possible as it modifies e.g. graphicx - \usepackage{bidi} -\fi -\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex +\ifPDFTeX \TeXXeTstate=1 \newcommand{\RL}[1]{\beginR #1\endR} \newcommand{\LR}[1]{\beginL #1\endL} @@ -472,38 +566,52 @@ \addbibresource{$bibliography$} $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 \everypar{\setlength{\hangindent}{\cslhangindent}}\ignorespaces\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} +$if(nocite-ids)$ +\nocite{$for(nocite-ids)$$it$$sep$, $endfor$} $endif$ $if(csquotes)$ \usepackage{csquotes} $endif$ - -% -% Martin Jäger: Hack to start each section after clear page -% -\let\stdsection\section -\renewcommand\section{\newpage\stdsection} - +\usepackage{bookmark} +\IfFileExists{xurl.sty}{\usepackage{xurl}}{} % add URL line breaks if available +\urlstyle{$if(urlstyle)$$urlstyle$$else$same$endif$} +$if(links-as-notes)$ +% Make links footnotes instead of hotlinks: +\DeclareRobustCommand{\href}[2]{#2\footnote{\url{#1}}} +$endif$ +$if(verbatim-in-note)$ +\VerbatimFootnotes % allow verbatim text in footnotes +$endif$ +\hypersetup{ +$if(title-meta)$ + pdftitle={$title-meta$}, +$endif$ +$if(author-meta)$ + pdfauthor={$author-meta$}, +$endif$ +$if(lang)$ + pdflang={$lang$}, +$endif$ +$if(subject)$ + pdfsubject={$subject$}, +$endif$ +$if(keywords)$ + pdfkeywords={$for(keywords)$$keywords$$sep$, $endfor$}, +$endif$ +$if(colorlinks)$ + colorlinks=true, + linkcolor={$if(linkcolor)$$linkcolor$$else$default-linkcolor$endif$}, + filecolor={$if(filecolor)$$filecolor$$else$default-filecolor$endif$}, + citecolor={$if(citecolor)$$citecolor$$else$default-citecolor$endif$}, + urlcolor={$if(urlcolor)$$urlcolor$$else$default-urlcolor$endif$}, +$else$ +$if(boxlinks)$ +$else$ + hidelinks, +$endif$ +$endif$ + breaklinks=true, + pdfcreator={LaTeX via pandoc with the Eisvogel template}} $if(title)$ \title{$title$$if(thanks)$\thanks{$thanks$}$endif$} $endif$ @@ -526,46 +634,19 @@ \institute{$for(institute)$$institute$$sep$ \and $endfor$} $endif$ $if(titlegraphic)$ -\titlegraphic{\includegraphics{$titlegraphic$}} +\titlegraphic{\includegraphics$if(titlegraphicoptions)$[$for(titlegraphicoptions)$$titlegraphicoptions$$sep$, $endfor$]$endif${$titlegraphic$}} $endif$ $if(logo)$ \logo{\includegraphics{$logo$}} $endif$ $endif$ + + %% %% added %% -% -% language specification -% -% If no language is specified, use English as the default main document language. -% -$if(lang)$$else$ -\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex - \usepackage[shorthands=off,$for(babel-otherlangs)$$babel-otherlangs$,$endfor$main=english]{babel} -$if(babel-newcommands)$ - $babel-newcommands$ -$endif$ -\else - $if(mainfont)$ - $else$ - % Workaround for bug in Polyglossia that breaks `\familydefault` when `\setmainlanguage` is used. - % See https://github.com/Wandmalfarbe/pandoc-latex-template/issues/8 - % See https://github.com/reutenauer/polyglossia/issues/186 - % See https://github.com/reutenauer/polyglossia/issues/127 - \renewcommand*\familydefault{\sfdefault} - $endif$ - % load polyglossia as late as possible as it *could* call bidi if RTL lang (e.g. Hebrew or Arabic) - \usepackage{polyglossia} - \setmainlanguage[]{english} -$for(polyglossia-otherlangs)$ - \setotherlanguage[$polyglossia-otherlangs.options$]{$polyglossia-otherlangs.name$} -$endfor$ -\fi -$endif$ - $if(page-background)$ \usepackage[pages=all]{background} $endif$ @@ -617,7 +698,7 @@ \item\relax\color{blockquote-text}\ignorespaces}{\unskip\unskip\endlist\end{customblockquote}} % -% Source Sans Pro as the de­fault font fam­ily +% Source Sans Pro as the default font family % Source Code Pro for monospace text % % 'default' option sets the default @@ -693,11 +774,6 @@ \renewcommand{\arraystretch}{1.3} % spacing (padding) $if(table-use-row-colors)$ -% TODO: This doesn't work anymore. I don't know why. -% Reset rownum counter so that each table -% starts with the same row colors. -% https://tex.stackexchange.com/questions/170637/restarting-rowcolors -% % Unfortunately the colored cells extend beyond the edge of the % table because pandoc uses @-expressions (@{}) like so: % @@ -705,18 +781,16 @@ % \end{longtable} % % https://en.wikibooks.org/wiki/LaTeX/Tables#.40-expressions -\let\oldlongtable\longtable -\let\endoldlongtable\endlongtable -\renewenvironment{longtable}{ -\rowcolors{3}{}{table-row-color!100} % row color -\oldlongtable} { -\endoldlongtable -\global\rownum=0\relax} +\usepackage{etoolbox} +\AtBeginEnvironment{longtable}{\rowcolors{2}{}{table-row-color!100}} +\preto{\toprule}{\hiderowcolors}{}{} +\appto{\endhead}{\showrowcolors}{}{} +\appto{\endfirsthead}{\showrowcolors}{}{} $endif$ $endif$ % -% remove paragraph indention +% remove paragraph indentation % \setlength{\parindent}{0pt} \setlength{\parskip}{6pt plus 2pt minus 1pt} @@ -755,7 +829,10 @@ framexleftmargin = 2.5em, $endif$ backgroundcolor = \color{listing-background}, - basicstyle = \color{listing-text-color}\linespread{1.0}$if(code-block-font-size)$$code-block-font-size$$else$\small$endif$\ttfamily{}, + basicstyle = \color{listing-text-color}\linespread{1.0}% + \lst@ifdisplaystyle% + $if(code-block-font-size)$$code-block-font-size$$else$\small$endif$% + \fi\ttfamily{}, breaklines = true, frame = single, framesep = 0.19em, @@ -779,8 +856,8 @@ literate = {á}{{\'a}}1 {é}{{\'e}}1 {í}{{\'i}}1 {ó}{{\'o}}1 {ú}{{\'u}}1 {Á}{{\'A}}1 {É}{{\'E}}1 {Í}{{\'I}}1 {Ó}{{\'O}}1 {Ú}{{\'U}}1 - {à}{{\`a}}1 {è}{{\'e}}1 {ì}{{\`i}}1 {ò}{{\`o}}1 {ù}{{\`u}}1 - {À}{{\`A}}1 {È}{{\'E}}1 {Ì}{{\`I}}1 {Ò}{{\`O}}1 {Ù}{{\`U}}1 + {à}{{\`a}}1 {è}{{\`e}}1 {ì}{{\`i}}1 {ò}{{\`o}}1 {ù}{{\`u}}1 + {À}{{\`A}}1 {È}{{\`E}}1 {Ì}{{\`I}}1 {Ò}{{\`O}}1 {Ù}{{\`U}}1 {ä}{{\"a}}1 {ë}{{\"e}}1 {ï}{{\"i}}1 {ö}{{\"o}}1 {ü}{{\"u}}1 {Ä}{{\"A}}1 {Ë}{{\"E}}1 {Ï}{{\"I}}1 {Ö}{{\"O}}1 {Ü}{{\"U}}1 {â}{{\^a}}1 {ê}{{\^e}}1 {î}{{\^i}}1 {ô}{{\^o}}1 {û}{{\^u}}1 @@ -853,21 +930,25 @@ $else$ $if(disable-header-and-footer)$ $else$ -\usepackage{fancyhdr} +\usepackage[headsepline,footsepline]{scrlayer-scrpage} -\fancypagestyle{eisvogel-header-footer}{ - \fancyhead{} - \fancyfoot{} - \lhead[$if(header-right)$$header-right$$else$$date$$endif$]{$if(header-left)$$header-left$$else$$title$$endif$} - \chead[$if(header-center)$$header-center$$else$$endif$]{$if(header-center)$$header-center$$else$$endif$} - \rhead[$if(header-left)$$header-left$$else$$title$$endif$]{$if(header-right)$$header-right$$else$$date$$endif$} - \lfoot[$if(footer-right)$$footer-right$$else$\thepage$endif$]{$if(footer-left)$$footer-left$$else$$for(author)$$author$$sep$, $endfor$$endif$} - \cfoot[$if(footer-center)$$footer-center$$else$$endif$]{$if(footer-center)$$footer-center$$else$$endif$} - \rfoot[$if(footer-left)$$footer-left$$else$$for(author)$$author$$sep$, $endfor$$endif$]{$if(footer-right)$$footer-right$$else$\thepage$endif$} - \renewcommand{\headrulewidth}{0.4pt} - \renewcommand{\footrulewidth}{0.4pt} +\newpairofpagestyles{eisvogel-header-footer}{ + \clearpairofpagestyles + \ihead*{$if(header-left)$$header-left$$else$$title$$endif$} + \chead*{$if(header-center)$$header-center$$else$$endif$} + \ohead*{$if(header-right)$$header-right$$else$$date$$endif$} + \ifoot*{$if(footer-left)$$footer-left$$else$$for(author)$$author$$sep$, $endfor$$endif$} + \cfoot*{$if(footer-center)$$footer-center$$else$$endif$} + \ofoot*{$if(footer-right)$$footer-right$$else$\thepage$endif$} + \addtokomafont{pageheadfoot}{\upshape} } \pagestyle{eisvogel-header-footer} + +$if(book)$ +\deftripstyle{ChapterStyle}{}{}{}{}{\pagemark}{} +\renewcommand*{\chapterpagestyle}{ChapterStyle} +$endif$ + $if(page-background)$ \backgroundsetup{ scale=1, @@ -946,9 +1027,9 @@ } $endif$ -$if(logo)$ +$if(titlepage-logo)$ \noindent -\includegraphics[width=$if(logo-width)$$logo-width$$else$35mm$endif$, left]{$logo$} +\includegraphics[width=$if(logo-width)$$logo-width$$else$35mm$endif$, left]{$titlepage-logo$} $endif$ $if(titlepage-background)$ @@ -958,6 +1039,7 @@ \end{flushleft} \end{titlepage} \restoregeometry +\pagenumbering{arabic} $endif$ $endif$ @@ -971,6 +1053,9 @@ $if(title)$ $if(beamer)$ \frame{\titlepage} +% don't generate the default title +% $else$ +% \maketitle $endif$ $if(abstract)$ \begin{abstract} @@ -997,7 +1082,8 @@ $if(toc-title)$ \frametitle{$toc-title$} $endif$ - \tableofcontents[hideallsubsections] + \setcounter{tocdepth}{$toc-depth$} + \tableofcontents \end{frame} $if(toc-own-page)$ \newpage @@ -1015,12 +1101,12 @@ } $endif$ $endif$ -$if(lot)$ -\listoftables -$endif$ $if(lof)$ \listoffigures $endif$ +$if(lot)$ +\listoftables +$endif$ $if(linestretch)$ \setstretch{$linestretch$} $endif$