aboutsummaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorJohn MacFarlane <[email protected]>2024-10-23 20:46:27 -0700
committerJohn MacFarlane <[email protected]>2024-10-23 20:46:27 -0700
commit233301bacb054da25f0cf744e36f302d7ae8f924 (patch)
treebe8bc944b64e6fa02361d5899baa5ed9a3db453a /data
parentc17c2040ed888df62568e227b5322ee0467795a1 (diff)
Add font-settings.latex partial to the repository.
Fixes th efix to #6160.
Diffstat (limited to 'data')
-rw-r--r--data/templates/font-settings.latex103
1 files changed, 103 insertions, 0 deletions
diff --git a/data/templates/font-settings.latex b/data/templates/font-settings.latex
new file mode 100644
index 000000000..f9362b010
--- /dev/null
+++ b/data/templates/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
+}{}
+