2

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}

\usepackage[osf]{Baskervaldx}
\usepackage[baskervaldx]{newtxmath}

\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}
  • 1
    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. – gwenj Mar 4 '17 at 10:33
3

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}
\usepackage[osf]{Baskervaldx}
\usepackage[baskervaldx]{newtxmath}
\SetSymbolFont{operators}   {normal}{T1}{Baskervaldx-LF} {m}{n}
\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}

tweaked font configuration

  • 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 . – gwenj 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

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.