Skip to content

Commit 56be54a

Browse files
committed
put some of the font magic back
1 parent 4e7e0c3 commit 56be54a

File tree

1 file changed

+106
-5
lines changed

1 file changed

+106
-5
lines changed

template/eisvogel.latex

Lines changed: 106 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -130,11 +130,23 @@ $if(section-titles)$
130130
}
131131
$endif$
132132
$endif$
133+
134+
\usepackage{fontspec}
135+
\setmainfont{Arial Unicode MS}
136+
\setsansfont{Arial Unicode MS}
137+
\setmonofont{Source Code Pro}
138+
139+
133140
$if(beamerarticle)$
134141
\usepackage{beamerarticle} % needs to be loaded first
135142
$endif$
136143
\usepackage{amsmath,amssymb}
137144
\usepackage{mathtools}
145+
$if(fontfamily)$
146+
\usepackage[$for(fontfamilyoptions)$$fontfamilyoptions$$sep$,$endfor$]{$fontfamily$}
147+
$else$
148+
\usepackage{lmodern}
149+
$endif$
138150
$if(linestretch)$
139151
\usepackage{setspace}
140152
$else$
@@ -156,14 +168,70 @@ $if(mathspec)$
156168
\fi
157169
$else$
158170
\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
159202
$endif$
160203
$if(luatexjapresetoptions)$
161204
\ifluatex
162205
\usepackage[$for(luatexjapresetoptions)$$luatexjapresetoptions$$sep$,$endfor$]{luatexja-preset}
163206
\fi
164207
$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$
165214
\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$
167235
% Use upquote if available, for straight quotes in verbatim environments
168236
\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
169237
\IfFileExists{microtype.sty}{% use microtype if available
@@ -578,10 +646,43 @@ $endif$
578646
\unskip\unskip\endlist\end{customblockquote}
579647
}
580648

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 de­fault font fam­ily
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
585686

586687
%
587688
% heading color

0 commit comments

Comments
 (0)