From 01fcce9cc0698ce915fab6af54be8f2ee74b2308 Mon Sep 17 00:00:00 2001 From: Wandmalfarbe Date: Sat, 18 Jan 2025 12:33:47 +0100 Subject: [PATCH] feat: merge changes from pandoc 3.6 LaTeX template --- template-multi-file/common.latex | 15 ---- template-multi-file/eisvogel.beamer | 37 ++++----- template-multi-file/eisvogel.latex | 1 + template-multi-file/font-settings.latex | 103 ++++++++++++++++++++++++ template-multi-file/fonts.latex | 103 ------------------------ 5 files changed, 123 insertions(+), 136 deletions(-) create mode 100755 template-multi-file/font-settings.latex diff --git a/template-multi-file/common.latex b/template-multi-file/common.latex index 7b504c5..070da48 100755 --- a/template-multi-file/common.latex +++ b/template-multi-file/common.latex @@ -6,7 +6,6 @@ $else$ \usepackage{setspace} \setstretch{1.2} $endif$ - $-- $-- paragraph formatting $-- @@ -51,14 +50,12 @@ $if(block-headings)$ \makeatother $endif$ $endif$ - $-- $-- verbatim in notes $-- $if(verbatim-in-note)$ \usepackage{fancyvrb} $endif$ - $-- highlighting $if(listings)$ \usepackage{listings} @@ -88,7 +85,6 @@ $highlighting-macros$ \DefineVerbatimEnvironment{Highlighting}{Verbatim}{breaklines,fontsize=$if(code-block-font-size)$$code-block-font-size$$else$\small$endif$,commandchars=\\\{\}} $endif$ - $-- $-- tables $-- @@ -115,7 +111,6 @@ $else$ \makesavenoteenv{longtable} $endif$ $endif$ - $-- $-- graphics $-- @@ -142,7 +137,6 @@ $endif$ $if(svg)$ \usepackage{svg} $endif$ - $-- $-- strikeout/underline $-- @@ -170,7 +164,6 @@ $if(CJKmainfont)$ $endif$ \fi $endif$ - $-- $-- CSL citations $-- @@ -209,7 +202,6 @@ $if(csl-refs)$ \newcommand{\CSLRightInline}[1]{\parbox[t]{\linewidth - \csllabelwidth}{\strut#1\strut}} \newcommand{\CSLIndent}[1]{\hspace{\cslhangindent}#1} $endif$ - $-- $-- Babel language support $-- @@ -243,32 +235,27 @@ $if(selnolig-langs)$ \fi $endif$ $endif$ - $-- $-- pagestyle $-- $if(pagestyle)$ \pagestyle{$pagestyle$} $endif$ - $-- $-- prevent overfull lines $-- \setlength{\emergencystretch}{3em} % prevent overfull lines - $-- $-- tight lists $-- \providecommand{\tightlist}{% \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}} - $-- $-- subfigure support $-- $if(subfigure)$ \usepackage{subcaption} $endif$ - $-- $-- text direction support for pdftex $-- @@ -281,7 +268,6 @@ $if(dir)$ \newenvironment{LTR}{\beginL}{\endL} \fi $endif$ - $-- $-- bibliography support support for natbib and biblatex $-- @@ -298,7 +284,6 @@ $endif$ $if(nocite-ids)$ \nocite{$for(nocite-ids)$$it$$sep$, $endfor$} $endif$ - $-- $-- csquotes $-- diff --git a/template-multi-file/eisvogel.beamer b/template-multi-file/eisvogel.beamer index a501cad..642cf28 100644 --- a/template-multi-file/eisvogel.beamer +++ b/template-multi-file/eisvogel.beamer @@ -103,6 +103,24 @@ $endif$ $for(beameroption)$ \setbeameroption{$beameroption$} $endfor$ +% Prevent slide breaks in the middle of a paragraph +\widowpenalties 1 10000 +\raggedbottom +$if(section-titles)$ +\AtBeginPart{ + \frame{\partpage} +} +\AtBeginSection{ + \ifbibliography + \else + \frame{\sectionpage} + \fi +} +\AtBeginSubsection{ + \frame{\subsectionpage} +} +$endif$ +$fonts.latex()$ $-- Set Beamer theme before user font settings so they can override theme $if(theme)$ \usetheme[$for(themeoptions)$$themeoptions$$sep$,$endfor$]{$theme$} @@ -122,24 +140,7 @@ $endif$ $if(outertheme)$ \useoutertheme[$for(outerthemeoptions)$$outerthemeoptions$$sep$,$endfor$]{$outertheme$} $endif$ -% Prevent slide breaks in the middle of a paragraph -\widowpenalties 1 10000 -\raggedbottom -$if(section-titles)$ -\AtBeginPart{ - \frame{\partpage} -} -\AtBeginSection{ - \ifbibliography - \else - \frame{\sectionpage} - \fi -} -\AtBeginSubsection{ - \frame{\subsectionpage} -} -$endif$ -$fonts.latex()$ +$font-settings.latex()$ $common.latex()$ $for(header-includes)$ $header-includes$ diff --git a/template-multi-file/eisvogel.latex b/template-multi-file/eisvogel.latex index aa469da..26c4e33 100644 --- a/template-multi-file/eisvogel.latex +++ b/template-multi-file/eisvogel.latex @@ -92,6 +92,7 @@ $else$ \setcounter{secnumdepth}{-\maxdimen} % remove section numbering $endif$ $fonts.latex()$ +$font-settings.latex()$ $common.latex()$ $for(header-includes)$ $header-includes$ diff --git a/template-multi-file/font-settings.latex b/template-multi-file/font-settings.latex new file mode 100755 index 0000000..f9362b0 --- /dev/null +++ b/template-multi-file/font-settings.latex @@ -0,0 +1,103 @@ +$-- 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)$ + $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)$ + $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 + \setmathfont(Digits,Latin,Greek)[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$} + \else + \setmathfont[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$} + \fi +$else$ + \setmathfont[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$} +$endif$ +$endif$ +$if(CJKmainfont)$ + \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 + \usepackage[$for(luatexjapresetoptions)$$luatexjapresetoptions$$sep$,$endfor$]{luatexja-preset} + \fi +$endif$ +$if(CJKmainfont)$ + \ifLuaTeX + \usepackage[$for(luatexjafontspecoptions)$$luatexjafontspecoptions$$sep$,$endfor$]{luatexja-fontspec} + \setmainjfont[$for(CJKoptions)$$CJKoptions$$sep$,$endfor$]{$CJKmainfont$} + \fi +$endif$ +\fi +$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}}{} +\IfFileExists{microtype.sty}{% use microtype if available + \usepackage[$for(microtypeoptions)$$microtypeoptions$$sep$,$endfor$]{microtype} + \UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts +}{} + diff --git a/template-multi-file/fonts.latex b/template-multi-file/fonts.latex index 3faf41d..53a8e3c 100755 --- a/template-multi-file/fonts.latex +++ b/template-multi-file/fonts.latex @@ -21,106 +21,3 @@ $else$ $-- Set default font before Beamer theme so the theme can override it \usepackage{lmodern} $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)$ - $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)$ - $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 - \setmathfont(Digits,Latin,Greek)[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$} - \else - \setmathfont[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$} - \fi -$else$ - \setmathfont[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$} -$endif$ -$endif$ -$if(CJKmainfont)$ - \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 - \usepackage[$for(luatexjapresetoptions)$$luatexjapresetoptions$$sep$,$endfor$]{luatexja-preset} - \fi -$endif$ -$if(CJKmainfont)$ - \ifLuaTeX - \usepackage[$for(luatexjafontspecoptions)$$luatexjafontspecoptions$$sep$,$endfor$]{luatexja-fontspec} - \setmainjfont[$for(CJKoptions)$$CJKoptions$$sep$,$endfor$]{$CJKmainfont$} - \fi -$endif$ -\fi -$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}}{} -\IfFileExists{microtype.sty}{% use microtype if available - \usepackage[$for(microtypeoptions)$$microtypeoptions$$sep$,$endfor$]{microtype} - \UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts -}{} -