Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

How do I achieve lining figures with mhchem while maintaining text figures in the text (lualatex).

My MWE is:

\documentclass{minimal}

\RequirePackage[paperwidth=70mm, paperheight=20mm, left=10pt, top=20pt]{geometry}%

\RequirePackage{fontspec}
\setmainfont[Ligatures=TeX, Numbers=OldStyle]{Tex Gyre Pagella}%
%\setmainfont[Ligatures=TeX]{Tex Gyre Pagella}%

\usepackage{mhchem}

\begin{document}
Chemical formula: \ce{Al2O3}
\end{document}

which produces

text figure example

but the desired output is (and as far as I am concerned should be)

desired chemical formula

share|improve this question

1 Answer 1

up vote 11 down vote accepted

Put

\mhchemoptions{textfontcommand=\addfontfeature{Numbers=Lining}}

inside your document. But: I have never used that package, so I don't know if there is a better way.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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