答案1
顯然,該nxlmi
字體在尺寸 10 和 5 處有錯誤的字形,而在尺寸 7 處有正確的字形。
在問題在字體層級解決之前,您可以透過告訴 LaTeX 從不同的字體中獲取“g”來解決它。
\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}
如果你想要“變體g”,那就有點複雜了:我們只需要在腳本樣式中縮小文字樣式“g”。
\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}