![newtxmath com libertino: 'g' diferente no subscrito](https://rvso.com/image/405381/newtxmath%20com%20libertino%3A%20'g'%20diferente%20no%20subscrito.png)
O exemplo a seguir me dá um 'g' diferente no subscrito simples:
\documentclass{article}
\usepackage{mathtools,amssymb}
\usepackage{libertine}
\usepackage[libertine]{newtxmath}
\begin{document}
\[g \ \mu_g \ A_{\mu_g}\]
\end{document}
Existe uma maneira rápida de corrigir isso? (EDITAR: Usando o MiKTex 2.9.7250, compilar o mesmo código no verso me dá o 'g' "certo" no subscrito.)
EDIT: Isso foi corrigido na versão 1.612 (01/12/2019).
Responder1
Aparentemente, a nxlmi
fonte tem o glifo errado nos tamanhos 10 e 5, enquanto tem o glifo certo no tamanho 7.
Até que o problema seja corrigido no nível da fonte, você pode corrigi-lo dizendo ao LaTeX para obter o “g” de uma fonte diferente.
\documentclass{article}
\usepackage{mathtools,amssymb}
\usepackage{libertine}
\usepackage[libertine]{newtxmath}
\DeclareSymbolFont{libertineg}{\encodingdefault}{\familydefault}{m}{it}
\SetSymbolFont{libertineg}{bold}{\encodingdefault}{\familydefault}{b}{it}
\DeclareMathSymbol{g}{\mathalpha}{libertineg}{`g}
\begin{document}
\[g \ \mu_g \ A_{\mu_g}\ \textit{g}\]
\end{document}
Se você quiser a “variante g”, é um pouco mais complicado: precisamos reduzir o estilo de texto “g” apenas quando estiver no estilo script.
\documentclass{article}
\usepackage{mathtools,amssymb}
\usepackage{libertine}
\usepackage[libertine]{newtxmath}
\usepackage{xfp,graphicx}
\newcommand{\fixg}{{%
\mathchoice
{\normalg}% displaystyle
{\normalg}% textstyle
{\scaledg}% scriptstyle
{\normalg}% scriptscriptstyle
}}
\makeatletter
\newcommand{\scaledg}{%
\scalebox{\fpeval{\sf@size/\f@size}}{$\m@th\normalg$}%
}
\begingroup\lccode`~=`g \lowercase{\endgroup\let~\fixg}
\edef\normalg{\mathchar\the\mathcode`g }
\AtBeginDocument{\mathcode`g="8000 }
\begin{document}
\[g \ \mu_g \ A_{\mu_g}\]
\end{document}