Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
quarto-dev
GitHub Repository: quarto-dev/quarto-cli
Path: blob/main/src/resources/formats/beamer/pandoc/font-settings.latex
12923 views
1
$-- User font settings (must come after default font and Beamer theme)
2
$if(fontfamily)$
3
\usepackage[$for(fontfamilyoptions)$$fontfamilyoptions$$sep$,$endfor$]{$fontfamily$}
4
$endif$
5
\ifPDFTeX\else
6
% xetex/luatex font selection
7
$if(mainfont)$
8
$if(mainfontfallback)$
9
\ifLuaTeX
10
\usepackage{luaotfload}
11
\directlua{luaotfload.add_fallback("mainfontfallback",{
12
$for(mainfontfallback)$"$mainfontfallback$"$sep$,$endfor$
13
})}
14
\fi
15
$endif$
16
\setmainfont[$for(mainfontoptions)$$mainfontoptions$$sep$,$endfor$$if(mainfontfallback)$,RawFeature={fallback=mainfontfallback}$endif$]{$mainfont$}
17
$endif$
18
$if(sansfont)$
19
$if(sansfontfallback)$
20
\ifLuaTeX
21
\usepackage{luaotfload}
22
\directlua{luaotfload.add_fallback("sansfontfallback",{
23
$for(sansfontfallback)$"$sansfontfallback$"$sep$,$endfor$
24
})}
25
\fi
26
$endif$
27
\setsansfont[$for(sansfontoptions)$$sansfontoptions$$sep$,$endfor$$if(sansfontfallback)$,RawFeature={fallback=sansfontfallback}$endif$]{$sansfont$}
28
$endif$
29
$if(monofont)$
30
$if(monofontfallback)$
31
\ifLuaTeX
32
\usepackage{luaotfload}
33
\directlua{luaotfload.add_fallback("monofontfallback",{
34
$for(monofontfallback)$"$monofontfallback$"$sep$,$endfor$
35
})}
36
\fi
37
$endif$
38
\setmonofont[$for(monofontoptions)$$monofontoptions$$sep$,$endfor$$if(monofontfallback)$,RawFeature={fallback=monofontfallback}$endif$]{$monofont$}
39
$endif$
40
$for(fontfamilies)$
41
\newfontfamily{$fontfamilies.name$}[$for(fontfamilies.options)$$fontfamilies.options$$sep$,$endfor$]{$fontfamilies.font$}
42
$endfor$
43
$if(mathfont)$
44
$if(mathspec)$
45
\ifXeTeX
46
\setmathfont(Digits,Latin,Greek)[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$}
47
\else
48
\setmathfont[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$}
49
\fi
50
$else$
51
\setmathfont[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$}
52
$endif$
53
$endif$
54
$if(CJKmainfont)$
55
\ifXeTeX
56
\usepackage{xeCJK}
57
\setCJKmainfont[$for(CJKoptions)$$CJKoptions$$sep$,$endfor$]{$CJKmainfont$}
58
$if(CJKsansfont)$
59
\setCJKsansfont[$for(CJKoptions)$$CJKoptions$$sep$,$endfor$]{$CJKsansfont$}
60
$endif$
61
$if(CJKmonofont)$
62
\setCJKmonofont[$for(CJKoptions)$$CJKoptions$$sep$,$endfor$]{$CJKmonofont$}
63
$endif$
64
\fi
65
$endif$
66
$if(luatexjapresetoptions)$
67
\ifLuaTeX
68
\usepackage[$for(luatexjapresetoptions)$$luatexjapresetoptions$$sep$,$endfor$]{luatexja-preset}
69
\fi
70
$endif$
71
$if(CJKmainfont)$
72
\ifLuaTeX
73
\usepackage[$for(luatexjafontspecoptions)$$luatexjafontspecoptions$$sep$,$endfor$]{luatexja-fontspec}
74
\setmainjfont[$for(CJKoptions)$$CJKoptions$$sep$,$endfor$]{$CJKmainfont$}
75
\fi
76
$endif$
77
\fi
78
$if(zero-width-non-joiner)$
79
%% Support for zero-width non-joiner characters.
80
\makeatletter
81
\def\zerowidthnonjoiner{%
82
% Prevent ligatures and adjust kerning, but still support hyphenating.
83
\texorpdfstring{%
84
\TextOrMath{\nobreak\discretionary{-}{}{\kern.03em}%
85
\ifvmode\else\nobreak\hskip\z@skip\fi}{}%
86
}{}%
87
}
88
\makeatother
89
\ifPDFTeX
90
\DeclareUnicodeCharacter{200C}{\zerowidthnonjoiner}
91
\else
92
\catcode`^^^^200c=\active
93
\protected\def ^^^^200c{\zerowidthnonjoiner}
94
\fi
95
%% End of ZWNJ support
96
$endif$
97
% Use upquote if available, for straight quotes in verbatim environments
98
\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
99
\IfFileExists{microtype.sty}{% use microtype if available
100
\usepackage[$for(microtypeoptions)$$microtypeoptions$$sep$,$endfor$]{microtype}
101
\UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
102
}{}
103
104
105