2

I try to use line numbers in text with EBGaramond-math font and Luatex. With the code below, the numbers in math mode are lining, but in the text oldstyle font is used.

\documentclass[]{standalone}
\usepackage[no-math]{fontspec}
\defaultfontfeatures[EBGaramond12]{Numbers={Lining}} 
\setmainfont{EB Garamond}
\usepackage[cmintegrals,cmbraces]{newtxmath}
\usepackage{ebgaramond-maths}

\begin{document}
123

$123$
\end{document}

If I comment \usepackage{ebgaramond-maths} the text numbers are lining.

After looking to the log file it seems that ebgaramond-math brings its own setting to \defaultfontfeatures, as written below numbers is configured twice.

. Font family 'EBGaramond12(4)' created for font 'EBGaramond12' with options . [Ligatures = TeX,Scale = 1,SmallCapsFeatures={Renderer=Basic},Extension = . .otf,Numbers={Lining},Numbers = {Monospaced,OldStyle},UprightFont = . *-Regular,ItalicFont = *-Italic,BoldFont = *-Regular,BoldItalicFont = . *-Italic].

With the commented ebgaramond-maths the log file reads as follow.

. Font family 'EBGaramond(0)' created for font 'EB Garamond' with options . [Ligatures=TeX].

The same behaviour occurs if I use XeLatex. With pdflatex and \usepackage[lf]{ebgaramond} the line numbers are used in text with ebgaramond-math. What options do I need to use to use line numbers in text and math?

1

The ebgaramond-maths package loads ebgaramond, which by default uses oldstyle numbers.

\documentclass{article}
\usepackage[no-math]{fontspec}
\usepackage[lining]{ebgaramond}
\usepackage[cmintegrals,cmbraces]{newtxmath}
\usepackage{ebgaramond-maths}

\setmainfont{EB Garamond}[Numbers=Lining]

\begin{document}

123

$123$

\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.