Path: blob/main/src/resources/formats/pdf/pandoc/font-settings.latex
12923 views
$-- User font settings (must come after default font and Beamer theme)1$if(fontfamily)$2\usepackage[$for(fontfamilyoptions)$$fontfamilyoptions$$sep$,$endfor$]{$fontfamily$}3$endif$4\ifPDFTeX\else5% xetex/luatex font selection6$if(mainfont)$7$if(mainfontfallback)$8\ifLuaTeX9\usepackage{luaotfload}10\directlua{luaotfload.add_fallback("mainfontfallback",{11$for(mainfontfallback)$"$mainfontfallback$"$sep$,$endfor$12})}13\fi14$endif$15\setmainfont[$for(mainfontoptions)$$mainfontoptions$$sep$,$endfor$$if(mainfontfallback)$,RawFeature={fallback=mainfontfallback}$endif$]{$mainfont$}16$endif$17$if(sansfont)$18$if(sansfontfallback)$19\ifLuaTeX20\usepackage{luaotfload}21\directlua{luaotfload.add_fallback("sansfontfallback",{22$for(sansfontfallback)$"$sansfontfallback$"$sep$,$endfor$23})}24\fi25$endif$26\setsansfont[$for(sansfontoptions)$$sansfontoptions$$sep$,$endfor$$if(sansfontfallback)$,RawFeature={fallback=sansfontfallback}$endif$]{$sansfont$}27$endif$28$if(monofont)$29$if(monofontfallback)$30\ifLuaTeX31\usepackage{luaotfload}32\directlua{luaotfload.add_fallback("monofontfallback",{33$for(monofontfallback)$"$monofontfallback$"$sep$,$endfor$34})}35\fi36$endif$37\setmonofont[$for(monofontoptions)$$monofontoptions$$sep$,$endfor$$if(monofontfallback)$,RawFeature={fallback=monofontfallback}$endif$]{$monofont$}38$endif$39$for(fontfamilies)$40\newfontfamily{$fontfamilies.name$}[$for(fontfamilies.options)$$fontfamilies.options$$sep$,$endfor$]{$fontfamilies.font$}41$endfor$42$if(mathfont)$43$if(mathspec)$44\ifXeTeX45\setmathfont(Digits,Latin,Greek)[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$}46\else47\setmathfont[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$}48\fi49$else$50\setmathfont[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$}51$endif$52$endif$53$if(CJKmainfont)$54\ifXeTeX55\usepackage{xeCJK}56\setCJKmainfont[$for(CJKoptions)$$CJKoptions$$sep$,$endfor$]{$CJKmainfont$}57$if(CJKsansfont)$58\setCJKsansfont[$for(CJKoptions)$$CJKoptions$$sep$,$endfor$]{$CJKsansfont$}59$endif$60$if(CJKmonofont)$61\setCJKmonofont[$for(CJKoptions)$$CJKoptions$$sep$,$endfor$]{$CJKmonofont$}62$endif$63\fi64$endif$65$if(luatexjapresetoptions)$66\ifLuaTeX67\usepackage[$for(luatexjapresetoptions)$$luatexjapresetoptions$$sep$,$endfor$]{luatexja-preset}68\fi69$endif$70$if(CJKmainfont)$71\ifLuaTeX72\usepackage[$for(luatexjafontspecoptions)$$luatexjafontspecoptions$$sep$,$endfor$]{luatexja-fontspec}73\setmainjfont[$for(CJKoptions)$$CJKoptions$$sep$,$endfor$]{$CJKmainfont$}74\fi75$endif$76\fi77$if(zero-width-non-joiner)$78%% Support for zero-width non-joiner characters.79\makeatletter80\def\zerowidthnonjoiner{%81% Prevent ligatures and adjust kerning, but still support hyphenating.82\texorpdfstring{%83\TextOrMath{\nobreak\discretionary{-}{}{\kern.03em}%84\ifvmode\else\nobreak\hskip\z@skip\fi}{}%85}{}%86}87\makeatother88\ifPDFTeX89\DeclareUnicodeCharacter{200C}{\zerowidthnonjoiner}90\else91\catcode`^^^^200c=\active92\protected\def ^^^^200c{\zerowidthnonjoiner}93\fi94%% End of ZWNJ support95$endif$96% Use upquote if available, for straight quotes in verbatim environments97\IfFileExists{upquote.sty}{\usepackage{upquote}}{}98\IfFileExists{microtype.sty}{% use microtype if available99\usepackage[$for(microtypeoptions)$$microtypeoptions$$sep$,$endfor$]{microtype}100\UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts101}{}102103104105