[Tex/LaTex] Upright small greek via newtxmath without replacing the math font

fontsgreeklibertinenewtxmath

I am trying to conform to the International Standard ISO 80000-2. The isomath package does a nice job, but it does not solve the problem of the missing upright/roman small Greek letters, needed for pi, Kronecker delta and the Levi-Civita symbol. This can be achieved in many ways, but usually the resulting Greek letters are clearly of a different font than their italics counterpart ones (I'm using the standard Computer Modern font).

The following code implements a very nice upright delta (all greek letters can be achieved in a similar fashion).

\documentclass{article}
\usepackage[libertine]{newtxmath}
\DeclareMathSymbol{\deltaup}{\mathord}{lettersA}{14}

\begin{document}
$\delta\deltaup$
\end{document}

That is, the above code declares the wanted macro \deltaup using the symbol font lettersA, which itself is loaded by newtxmath. This works correctly, but as an unwanted side effect, loading newtxmath replaces the used math font in the document, which I do not want to alter.

Best Answer

You can use the CBfonts by Claudio Beccari, that are based on the Computer Modern design.

\documentclass{article}
\usepackage[LGR,T1]{fontenc} % or OT1, if you prefer

\DeclareSymbolFont{upgreek}{LGR}{cmr}{m}{n}
\DeclareMathSymbol{\deltaup}{\mathord}{upgreek}{`d}
\DeclareMathSymbol{\piup}{\mathord}{upgreek}{`p}
\DeclareMathSymbol{\epsilonup}{\mathord}{upgreek}{`e}

\begin{document}
$\delta\deltaup$

$\pi\piup$

$\varepsilon\epsilonup$
\end{document}

enter image description here

A less efficient solution that doesn't waste a math font family, is with textalpha:

\documentclass{article}
\usepackage{amsmath}
\usepackage{textalpha}

\newcommand{\deltaup}{\text{\textdelta}}
\newcommand{\epsilonup}{\text{\textepsilon}}
\newcommand{\piup}{\text{\textpi}}

\begin{document}
$\delta\deltaup$

$\pi\piup$

$\varepsilon\epsilonup$
\end{document}

The output is the same.

If you want to use the upright Greek used when \usepackage[libertine]{newtxmath} is loaded, then here's the trick

\documentclass{article}
\usepackage{amsmath}

\makeatletter
\let\iftx@libertine\iftrue
\let\iftx@minion\iffalse
\def\ntxmath@scaled{s*[1.02]}
\makeatother
\DeclareSymbolFont{upgreek}{U}{ntxmia}{m}{it}
\SetSymbolFont{upgreek}{bold}{U}{ntxmia}{b}{it}
\DeclareMathSymbol{\deltaup}{\mathord}{upgreek}{14}
\DeclareMathSymbol{\varepsilonup}{\mathord}{upgreek}{34}
\DeclareMathSymbol{\piup}{\mathord}{upgreek}{25}

\begin{document}
$\delta\deltaup$

$\pi\piup$

$\varepsilon\varepsilonup$
\end{document}

enter image description here

In my opinion the result is decidedly worse.

Related Question