git.iko.soy/typeable/pandoc
on master help sign in
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: <https://ctan.org/pkg/fontspec>. 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.

commit666bf8ac5cf2574303874be2cd8234e8b99ad459 authorAndrew Dunning <adunning@users.noreply.github.com> dateThu 10 Jan 2019, 14:24 (8 years ago) parent3597149
5 files changed+9−14
data/templates/default.latex+9−10 test/lhs-test.latex−1 test/lhs-test.latex+lhs−1 test/writer.latex−1 test/writers-lang-and-dir.latex−1
data/templates/default.latex+9−10
@@ -110,31 +110,30 @@ $if(mathspec)$
110110$else$
111111 \usepackage{unicode-math}
112112$endif$
113− \defaultfontfeatures{Ligatures=TeX,Scale=MatchLowercase}
114−$for(fontfamilies)$
115− \newfontfamily{$fontfamilies.name$}[$for(fontfamilies.options)$$fontfamilies.options$$sep$,$endfor$]{$fontfamilies.font$}
116−$endfor$
117113$if(mainfont)$
118114 \setmainfont[$for(mainfontoptions)$$mainfontoptions$$sep$,$endfor$]{$mainfont$}
119115$endif$
120116$if(romanfont)$
121− \setromanfont[$for(romanfontoptions)$$romanfontoptions$$sep$,$endfor$]{$romanfont$}
117+ \setromanfont[$if(romanfontoptions)$$for(romanfontoptions)$$romanfontoptions$$sep$,$endfor$$else$Scale=MatchLowercase$endif$]{$romanfont$}
122118$endif$
123119$if(sansfont)$
124− \setsansfont[$for(sansfontoptions)$$sansfontoptions$$sep$,$endfor$]{$sansfont$}
120+ \setsansfont[$if(sansfontoptions)$$for(sansfontoptions)$$sansfontoptions$$sep$,$endfor$$else$Scale=MatchLowercase$endif$]{$sansfont$}
125121$endif$
126122$if(monofont)$
127− \setmonofont[Mapping=tex-ansi$if(monofontoptions)$,$for(monofontoptions)$$monofontoptions$$sep$,$endfor$$endif$]{$monofont$}
123+ \setmonofont[$if(monofontoptions)$$for(monofontoptions)$$monofontoptions$$sep$,$endfor$$else$Scale=MatchLowercase$endif$]{$monofont$}
128124$endif$
125+$for(fontfamilies)$
126+ \newfontfamily{$fontfamilies.name$}[$if(fontfamilies.options)$$for(fontfamilies.options)$$fontfamilies.options$$sep$,$endfor$$else$Scale=MatchLowercase$endif$]{$fontfamilies.font$}
127+$endfor$
129128$if(mathfont)$
130129$if(mathspec)$
131130 \ifxetex
132− \setmathfont(Digits,Latin,Greek)[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$}
131+ \setmathfont(Digits,Latin,Greek)[$if(mathfontoptions)$$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$$else$Scale=MatchLowercase$endif$]{$mathfont$}
133132 \else
134− \setmathfont[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$}
133+ \setmathfont[$if(mathfontoptions)$$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$$else$Scale=MatchLowercase$endif$]{$mathfont$}
135134 \fi
136135$else$
137− \setmathfont[$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$]{$mathfont$}
136+ \setmathfont[$if(mathfontoptions)$$for(mathfontoptions)$$mathfontoptions$$sep$,$endfor$$else$Scale=MatchLowercase$endif$]{$mathfont$}
138137$endif$
139138$endif$
140139$if(CJKmainfont)$
test/lhs-test.latex−1
@@ -12,7 +12,6 @@
1212 \usepackage{textcomp} % provides euro and other symbols
1313\else % if luatex or xelatex
1414 \usepackage{unicode-math}
15− \defaultfontfeatures{Ligatures=TeX,Scale=MatchLowercase}
1615\fi
1716% use upquote if available, for straight quotes in verbatim environments
1817\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
test/lhs-test.latex+lhs−1
@@ -12,7 +12,6 @@
1212 \usepackage{textcomp} % provides euro and other symbols
1313\else % if luatex or xelatex
1414 \usepackage{unicode-math}
15− \defaultfontfeatures{Ligatures=TeX,Scale=MatchLowercase}
1615\fi
1716% use upquote if available, for straight quotes in verbatim environments
1817\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
test/writer.latex−1
@@ -12,7 +12,6 @@
1212 \usepackage{textcomp} % provides euro and other symbols
1313\else % if luatex or xelatex
1414 \usepackage{unicode-math}
15− \defaultfontfeatures{Ligatures=TeX,Scale=MatchLowercase}
1615\fi
1716% use upquote if available, for straight quotes in verbatim environments
1817\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
test/writers-lang-and-dir.latex−1
@@ -13,7 +13,6 @@
1313 \usepackage{textcomp} % provides euro and other symbols
1414\else % if luatex or xelatex
1515 \usepackage{unicode-math}
16− \defaultfontfeatures{Ligatures=TeX,Scale=MatchLowercase}
1716\fi
1817% use upquote if available, for straight quotes in verbatim environments
1918\IfFileExists{upquote.sty}{\usepackage{upquote}}{}