I am trying to use old-style numbers in my LuaLaTeX document. My main font is "Cambria", which I do not want to change.
As you can see in this picture (line 2) there is a change in font. I do not want that change to happen if using the \oldstylenums
command. The strange thing is that the normal text uses the right numbers. How can I easily change the style of that command too?
\documentclass{article}
\usepackage{fontspec}
\usepackage[math-style=ISO,bold-style=ISO]{unicode-math}%
\usepackage{MnSymbol}%
\setmainfont[Numbers={OldStyle,Proportional}]{Cambria}%
\setsansfont{Calibri}%
\setmonofont{Consolas}%
\setmathfont[range={it,sfit}]{Cambria Italic}%
\setmathfont[range={bfit,bfsfit}]{Cambria Bold Italic}%
\setmathfont{Cambria Math}%
\begin{document}
\section{This should have an old-style figure}
This is a text containing some figures: 123456. They should be old-style and not lining. This is specifically old-style: \oldstylenums{123456}. And this is lining: \liningnums{123456}. And in math it shall be lining: \( 123456\)
\end{document}
Update: As you can see in the next picture there is a ordinary LaTeX font used in that document which is not supposed to be there.
Best Answer
To sum up the discussion in the comments, there is one main problem with the code: It uses
MnSymbol
. That loads, among others,textcomp
, a package not intended for use with unicode fonts. The issue is resolved not loading theMnSymbol
package.Probably that is no real disadvantage, because the
unicode-math
provided font support is sufficient, especially using a font like "Cambria Math".