From 666bf8ac5cf2574303874be2cd8234e8b99ad459 Mon Sep 17 00:00:00 2001 From: Andrew Dunning Date: Thu, 10 Jan 2019 14:24:27 -0500 Subject: LaTeX template: Prevent scaling of main font (#5212) When `Scale=MatchLowercase` is set as a default font option, this scales `mainfont` against the old default, meaning that it resizes whatever is set as the main font to match the metrics of Latin Modern. This can result, for example, in a document set to 12pt appearing in 11pt or 13pt. Setting this option for individual families allows everything to scale against the main font, and permits the user to override the setting if desired. Note that it is not necessary to specify `Ligatures=TeX`, as this is already set by default for the appropriate families. See the `fontspec` manual: . Those who specify font-options in metadata may need to add `Scale=MatchLowercase`, which will now only be provided if `(roman|sans|math|mono)fontoptions` aren't given explicitly. --- data/templates/default.latex | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'data') diff --git a/data/templates/default.latex b/data/templates/default.latex index 723e0091f..0701054c0 100644 --- a/data/templates/default.latex +++ b/data/templates/default.latex @@ -110,31 +110,30 @@ $if(mathspec)$ $else$ \usepackage{unicode-math} $endif$ - \defaultfontfeatures{Ligatures=TeX,Scale=MatchLowercase} -$for(fontfamilies)$ - \newfontfamily{$fontfamilies.name$}[$for(fontfamilies.options)$$fontfamilies.options$$sep$,$endfor$]{$fontfamilies.font$} -$endfor$ $if(mainfont)$ \setmainfont[$for(mainfontoptions)$$mainfontoptions$$sep$,$endfor$]{$mainfont$} $endif$ $if(romanfont)$ - \setromanfont[$for(romanfontoptions)$$romanfontoptions$$sep$,$endfor$]{$romanfont$} + \setromanfont[$if(romanfontoptions)$$for(romanfontoptions)$$romanfontoptions$$sep$,$endfor$$else$Scale=MatchLowercase$endif$]{$romanfont$} $endif$ $if(sansfont)$ - \setsansfont[$for(sansfontoptions)$$sansfontoptions$$sep$,$endfor$]{$sansfont$} + \setsansfont[$if(sansfontoptions)$$for(sansfontoptions)$$sansfontoptions$$sep$,$endfor$$else$Scale=MatchLowercase$endif$]{$sansfont$} $endif$ $if(monofont)$ - \setmonofont[Mapping=tex-ansi$if(monofontoptions)$,$for(monofontoptions)$$monofontoptions$$sep$,$endfor$$endif$]{$monofont$} + \setmonofont[$if(monofontoptions)$$for(monofontoptions)$$monofontoptions$$sep$,$endfor$$else$Scale=MatchLowercase$endif$]{$monofont$} $endif$ +$for(fontfamilies)$ + \newfontfamily{$fontfamilies.name$}[$if(fontfamilies.options)$$for(fontfamilies.options)$$fontfamilies.options$$sep$,$endfor$$else$Scale=MatchLowercase$endif$]{$fontfamilies.font$} +$endfor$ $if(mathfont)$ $if(mathspec)$ \ifxetex - \setmathfont(Digits,Latin,Greek)[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$} + \setmathfont(Digits,Latin,Greek)[$if(mathfontoptions)$$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$$else$Scale=MatchLowercase$endif$]{$mathfont$} \else - \setmathfont[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$} + \setmathfont[$if(mathfontoptions)$$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$$else$Scale=MatchLowercase$endif$]{$mathfont$} \fi $else$ - \setmathfont[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$} + \setmathfont[$if(mathfontoptions)$$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$$else$Scale=MatchLowercase$endif$]{$mathfont$} $endif$ $endif$ $if(CJKmainfont)$ -- cgit v1.2.3