@@ -130,11 +130,23 @@ $if(section-titles)$
130
130
}
131
131
$endif$
132
132
$endif$
133
+
134
+ \usepackage{fontspec}
135
+ \setmainfont{Arial Unicode MS}
136
+ \setsansfont{Arial Unicode MS}
137
+ \setmonofont{Source Code Pro}
138
+
139
+
133
140
$if(beamerarticle)$
134
141
\usepackage{beamerarticle} % needs to be loaded first
135
142
$endif$
136
143
\usepackage{amsmath,amssymb}
137
144
\usepackage{mathtools}
145
+ $if(fontfamily)$
146
+ \usepackage[$for(fontfamilyoptions)$$fontfamilyoptions$$sep$,$endfor$]{$fontfamily$}
147
+ $else$
148
+ \usepackage{lmodern}
149
+ $endif$
138
150
$if(linestretch)$
139
151
\usepackage{setspace}
140
152
$else$
@@ -156,14 +168,70 @@ $if(mathspec)$
156
168
\fi
157
169
$else$
158
170
\usepackage{unicode-math}
171
+ $endif$
172
+ \defaultfontfeatures{Scale=MatchLowercase}
173
+ \defaultfontfeatures[\rmfamily]{Ligatures=TeX,Scale=1}
174
+ $if(mainfont)$
175
+ \setmainfont[$for(mainfontoptions)$$mainfontoptions$$sep$,$endfor$]{$mainfont$}
176
+ $endif$
177
+ $if(sansfont)$
178
+ \setsansfont[$for(sansfontoptions)$$sansfontoptions$$sep$,$endfor$]{$sansfont$}
179
+ $endif$
180
+ $if(monofont)$
181
+ \setmonofont[$for(monofontoptions)$$monofontoptions$$sep$,$endfor$]{$monofont$}
182
+ $endif$
183
+ $for(fontfamilies)$
184
+ \newfontfamily{$fontfamilies.name$}[$for(fontfamilies.options)$$fontfamilies.options$$sep$,$endfor$]{$fontfamilies.font$}
185
+ $endfor$
186
+ $if(mathfont)$
187
+ $if(mathspec)$
188
+ \ifxetex
189
+ \setmathfont(Digits,Latin,Greek)[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$}
190
+ \else
191
+ \setmathfont[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$}
192
+ \fi
193
+ $else$
194
+ \setmathfont[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$}
195
+ $endif$
196
+ $endif$
197
+ $if(CJKmainfont)$
198
+ \ifxetex
199
+ \usepackage{xeCJK}
200
+ \setCJKmainfont[$for(CJKoptions)$$CJKoptions$$sep$,$endfor$]{$CJKmainfont$}
201
+ \fi
159
202
$endif$
160
203
$if(luatexjapresetoptions)$
161
204
\ifluatex
162
205
\usepackage[$for(luatexjapresetoptions)$$luatexjapresetoptions$$sep$,$endfor$]{luatexja-preset}
163
206
\fi
164
207
$endif$
208
+ $if(CJKmainfont)$
209
+ \ifluatex
210
+ \usepackage[$for(luatexjafontspecoptions)$$luatexjafontspecoptions$$sep$,$endfor$]{luatexja-fontspec}
211
+ \setmainjfont[$for(CJKoptions)$$CJKoptions$$sep$,$endfor$]{$CJKmainfont$}
212
+ \fi
213
+ $endif$
165
214
\fi
166
-
215
+ $if(beamer)$
216
+ $if(theme)$
217
+ \usetheme[$for(themeoptions)$$themeoptions$$sep$,$endfor$]{$theme$}
218
+ $endif$
219
+ $if(colortheme)$
220
+ \usecolortheme{$colortheme$}
221
+ $endif$
222
+ $if(fonttheme)$
223
+ \usefonttheme{$fonttheme$}
224
+ $endif$
225
+ $if(mainfont)$
226
+ \usefonttheme{serif} % use mainfont rather than sansfont for slide text
227
+ $endif$
228
+ $if(innertheme)$
229
+ \useinnertheme{$innertheme$}
230
+ $endif$
231
+ $if(outertheme)$
232
+ \useoutertheme{$outertheme$}
233
+ $endif$
234
+ $endif$
167
235
% Use upquote if available, for straight quotes in verbatim environments
168
236
\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
169
237
\IfFileExists{microtype.sty}{% use microtype if available
@@ -578,10 +646,43 @@ $endif$
578
646
\unskip\unskip\endlist\end{customblockquote}
579
647
}
580
648
581
- \usepackage{fontspec}
582
- \setmainfont{Arial Unicode MS}
583
- \setsansfont{Arial Unicode MS}
584
- \setmonofont{Source Code Pro}
649
+ %
650
+ % Source Sans Pro as the default font family
651
+ % Source Code Pro for monospace text
652
+ %
653
+ % 'default' option sets the default
654
+ % font family to Source Sans Pro, not \sfdefault.
655
+ %
656
+ \ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
657
+ $if(fontfamily)$
658
+ $else$
659
+ \usepackage{sourcecodepro}
660
+ $endif$
661
+ \else % if not pdftex
662
+ $if(mainfont)$
663
+ $else$
664
+ \usepackage{sourcecodepro}
665
+
666
+ % XeLaTeX specific adjustments for straight quotes: https://tex.stackexchange.com/a/354887
667
+ % This issue is already fixed (see https://github.com/silkeh/latex-sourcecodepro/pull/5) but the
668
+ % fix is still unreleased.
669
+ % TODO: Remove this workaround when the new version of sourcecodepro is released on CTAN.
670
+ \ifxetex
671
+ \makeatletter
672
+ \defaultfontfeatures[\ttfamily]
673
+ { Numbers = \sourcecodepro@figurestyle,
674
+ Scale = \SourceCodePro@scale,
675
+ Extension = .otf }
676
+ \setmonofont
677
+ [ UprightFont = *-\sourcecodepro@regstyle,
678
+ ItalicFont = *-\sourcecodepro@regstyle It,
679
+ BoldFont = *-\sourcecodepro@boldstyle,
680
+ BoldItalicFont = *-\sourcecodepro@boldstyle It ]
681
+ {SourceCodePro}
682
+ \makeatother
683
+ \fi
684
+ $endif$
685
+ \fi
585
686
586
687
%
587
688
% heading color
0 commit comments