unicode-math: use fuente de texto para dígitos numéricos en modo matemático

unicode-math: use fuente de texto para dígitos numéricos en modo matemático

Usando XeTeX con fontspecyunicode-math , me gustaría usar la fuente principal de los documentos paradígitos(números) en modo matemático. Además, me gustaría que \text{}en el modo matemático se utilicen números de revestimiento, mientras que los números predeterminados para el documento son números de estilo antiguo. ¿Cómo puedo lograr este comportamiento?

Intenté insertar \setmathfont[range=\mathup/{num}]{Linux Libertine O}pero no da el resultado deseado.

Aquí hay un MWE que señala los problemas:

\documentclass{article}
\usepackage{iftex}

\usepackage{libertine}
\usepackage{fontspec} 
\setmainfont[Numbers=OldStyle]{Linux Libertine O} 

\usepackage{amsmath}

\usepackage{unicode-math}
% Here I try to set up the normal text font for digits in mathmode: 
\setmathfont[range=\mathup/{num}]{Linux Libertine O}

\parindent0pt

\begin{document}

This is \ifXeTeX XeTeX\fi\ifLuaTeX LuaTeX\fi 
with \fontname\font
\bigskip

Text numbers: 
0123456789; italic: \textit{0123456789}; bold: \textbf{0123456789} 

Text numbers lining: 
\liningnums{0123456789; italic: \textit{0123456789}; bold: 
\textbf{0123456789}}

Numbers in mathmode: $0123456789$ (ok)\\
mathit: $\mathit{0123456789}$ (wrong font)\\
mathbf: $\mathbf{0123456789}$ (wrong font)\\
mathrm: $\mathrm{0123456789}$ (wrong font)\\
text (math): $\text{0123456789}$ (should be lining)

In big equation, fonts for big brackets $\big( \Big( \bigg( \Bigg($ are
missing: 
\[
\left(\frac{12a}{34b}\right)
\]

\end{document}

Usando XeTeX, esto da como resultado:

ingrese la descripción de la imagen aquí

Entonces hay 3 problemas:

  1. Linux Libertine Opara dígitos no aparece en \mathrm, \mathit, \mathbfetc.
  2. Los soportes grandes no funcionan. (Vea más sobre esto a continuación).
  3. ¿Hay alguna manera de lograr números de revestimiento en modo matemático \text{}aunque el estilo del número de documento sea OldStyle?

En cuanto al problema 1, esto se debe a que range=\mathup/{num}solo se aplica al texto matemático vertical. ¿Alguien sabe cómo aplicar este comando para todos los números en todos los rangos? usar solo range={num}resulta en un error.

Respecto al problema 2, tengo dos datos más. A) Usando LuaTeX en el mismo archivo, los corchetesaparecen, pero sin ser escalado:

ingrese la descripción de la imagen aquí

B) Si comento la línea \setmathfont[range=\mathup/{num}]{Linux Libertine O}, el problema no ocurre en absoluto. Esto sugiere que el mecanismo de corchetes se ve afectado al cambiar la fuente de los números, lo cual no debería ser así, ¿verdad?

ingrese la descripción de la imagen aquí

Este problema, por cierto, no es específico de Linux Libertine O. También apareció cuando lo estaba usando SabonNextLTProcomo fuente del documento principal.

Respuesta1

Mientras tanto, hasta que a alguien se le ocurra una idea, pensé en compartir una solución alternativa. Básicamente se trata de volver a mathspecen lugar de unicode-math. Casi todo funciona de inmediato en solo tres líneas:

\documentclass{article}
\usepackage{iftex}

\usepackage[no-math]{fontspec} 
\usepackage{libertine}
\setmainfont[Numbers=OldStyle]{Linux Libertine O} 

\usepackage{amsmath}
\usepackage{mathspec}
\setmathfont(Digits){Linux Libertine O}

\parindent0pt

\begin{document}

This is \ifXeTeX XeTeX\fi\ifLuaTeX LuaTeX\fi 
with \fontname\font
\bigskip

Text numbers: 
0123456789; italic: \textit{0123456789}; bold: \textbf{0123456789} 

Text numbers lining: 
\liningnums{0123456789; italic: \textit{0123456789}; bold: 
\textbf{0123456789}}

Numbers in mathmode: $0123456789$ (ok)\\
mathit: $\mathit{0123456789}$ (correct font but no italic)\\
mathbf: $\mathbf{0123456789}$ (correct font but no boldface)\\
mathrm: $\mathrm{0123456789}$ (ok)\\
text (math): $\text{0123456789}$ (should be lining)

In equations, testing fonts for big brackets $\big( \Big( \bigg( \Bigg($: 
\[
\left(\frac{12a}{34b}\right)
\]

\end{document}

ingrese la descripción de la imagen aquí

información relacionada