# Babel discarding lining figures?

I am using Baskervaldx’s Baskerville for main text with osf option and Newtx’s Times for math with baskervaldx option.

When pdflatex compiles without babel enabled, text figures are oldstyle and math figures are lining. Since babel is enabled, all figures switch to oldstyle, which I don’t want for math…

How can oldstyle figures be kept for text, and lining for math?

MWE :

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
%\usepackage[english]{babel}

\begin{document}

Baskervaldx text with old-style figures: 012345.

Math font is NewTXmath with baskervaldx option,
in \emph{inline math} ($x = 425^{28}$)
and \emph{display math:}

$x = 425^{28}$

\end{document}

• Have you tried reading the documentation? It does explain how to do this. I'm not sure that it will help, but you should at least see what it has to say.
– cfr
Mar 4 '17 at 2:16
• @cfr: NewTX documentation advises to declare babel before newtxtext to avoid an etoolbox incompatibility. Baskervaldx also requires etoolbox, but this advice does not seem to work. Mar 4 '17 at 10:33

It is strange that you do not mention looking at the documentation for newtxmath, which includes detailed instructions for using lining figures for maths and hanging for text, when Babel is used.

Unfortunately, they appear to be applicable only if the newtxtext fonts are used, although the documentation doesn't actually say so.

So the most straightforward option is probably to just rewrite the required configuration explicitly.

For example,

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[american]{babel}
\SetSymbolFont{operators}   {bold}  {T1}{Baskervaldx-LF} {b}{n}

\begin{document}

Baskervaldx text with old-style figures: 012345.

Math font is NewTXmath with baskervaldx option,
in \emph{inline math} ($x = 425^{28}$)
and \emph{display math:}

$x = 425^{28}$

\end{document}


• Thank you, this works well. I’ll add that the \SetSymbolFont command usage is described in the Latex2e font selection guide at latex-project.org/help/documentation . Mar 4 '17 at 11:27
• @gwenj I copied it from cfr-lm.sty but, yes, I'm sure the NFSS documentation covers it, too.
– cfr
Mar 4 '17 at 22:38