4

I'd like to use the Libertine italic w and g as math italic letters, rather than the variant letters employed by newtxmath with the libertine option. The option liby allows one to revert to the Libertine y. What is the simplest way to accomplish the same for w and g?

Note 1: I know there might be good reasons to prefer a single-story g in mathematics. Here, I would like to use the double-story version.

Note 2: I'm aware of K. Hosny's Libertinus Math – and keeping an eye on its development. At the moment, I'd prefer to stick with pdfLaTeX/Type 1 fonts.

1 Answer 1

3

I think you are talking about “g” and “v”, because the “w” is exactly the same as the italic one.

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{libertine}
\usepackage[libertine]{newtxmath}

\makeatletter
\DeclareSymbolFont{altitalic}{\tx@enc}{\rmdefaultB}{m}{it}
\SetSymbolFont{altitalic}{bold}{\tx@enc}{\rmdefaultB}{b}{it}
\DeclareMathSymbol{g}{\mathord}{altitalic}{`g}
\DeclareMathSymbol{v}{\mathord}{altitalic}{`v}
\DeclareSymbolFontAlphabet{\mathit}{altitalic}
\makeatother

\begin{document}
$abgwv$ \textit{gwv} $\mathit{abgwv}$
\end{document}

enter image description here

Here's the output without the changes:

enter image description here

Without a new symbol font:

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{libertine}
\usepackage[libertine]{newtxmath}

\mathchardef\mathg=\numexpr"7000+`g\relax
\mathchardef\mathv=\numexpr"7000+`v\relax
\begingroup\lccode`~=`g \lowercase{\endgroup\def~}{\mathit{\mathg}}
\begingroup\lccode`~=`v \lowercase{\endgroup\def~}{\mathit{\mathv}}
\AtBeginDocument{%
  \mathcode`g="8000
  \mathcode`v="8000
}

\begin{document}
$abgwv$ \textit{gwv} $\mathit{abgwv}$
\end{document}

You must log in to answer this question.

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