4

I am here again to seek your help. I would like all numbers in my document to be the same (in text or math mode). Now I have

enter image description here

Please note also the size difference. What is the way to have all numbers in Libertine irrespective of their environment? I mean leaving siunitx behaviour as it is and changing only the font for numbers (and for numbers alone) in math mode?

If I try

\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 complains there are no such shapes.

Here is the minimal example

% !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 Answer 1

3
\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}
[ ... ]

enter image description here

1
  • Wow, that was so easy. Thank you very much!
    – Emmet
    Feb 8, 2016 at 9:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .