我再次来这里寻求您的帮助。我希望我的文档中的所有数字都相同(在文本或数学模式下)。现在我有
还请注意大小差异。无论环境如何,如何让 Libertine 中的所有数字都显示出来?我的意思是保持 siunitx 行为不变,只在数学模式下更改数字的字体(仅更改数字的字体)?
如果我尝试
\DeclareSymbolFont{numbers}{T1}{LinuxLibertineO}{m}{n}
\SetSymbolFont{numbers}{bold}{T1}{LinuxLibertineO}{bx}{n}
\DeclareMathSymbol{0}\mathalpha{numbers}{"30}
\DeclareMathSymbol{1}\mathalpha{numbers}{"31}
\DeclareMathSymbol{2}\mathalpha{numbers}{"32}
\DeclareMathSymbol{3}\mathalpha{numbers}{"33}
\DeclareMathSymbol{4}\mathalpha{numbers}{"34}
\DeclareMathSymbol{5}\mathalpha{numbers}{"35}
\DeclareMathSymbol{6}\mathalpha{numbers}{"36}
\DeclareMathSymbol{7}\mathalpha{numbers}{"37}
\DeclareMathSymbol{8}\mathalpha{numbers}{"38}
\DeclareMathSymbol{9}\mathalpha{numbers}{"39}
LuaLaTex 抱怨说没有这样的形状。
这是最小的例子
% !Mode:: "TeX:UTF-8"
%
\documentclass[a4paper,11pt]{book}
\usepackage{fontspec}
\usepackage{unicode-math}
\setmainfont{Linux Libertine O}
\addfontfeatures{Numbers={Lining,Monospaced}}
\setsansfont{Linux Biolinum O}
\setmonofont{Consolas}
\setmathfont[math-style=ISO,bold-style=ISO]{Cambria Math}
\usepackage{siunitx}
\begin{document}
Now I have
\begin{itemize}
\item Libertine in text mode: 123456789
\item Libertine using siunitx in text mode: \SI{123456789}{\km\per\hour}
\item Cambria in math mode: $123456789$
\item Libertine using siunitx in math mode: $\SI{123456789}{\km\per\hour}$
\end{itemize}
I would like libertine in math mode too $123456789$.
\end{document}
答案1
\documentclass[a4paper,11pt]{book}
\usepackage{unicode-math}
\usepackage{libertine}
\addfontfeatures{Numbers={Lining,Monospaced}}
%\setmonofont{Consolas}% not available for me
\setmathfont[math-style=ISO,bold-style=ISO]{Cambria Math}
\setmathfont[range=0048-0057]{Linux Libertine O}
\usepackage{siunitx}
\begin{document}
[ ... ]