I use libertine
and newtxmath
font packages, they provide upright greek letters. However, there is no way to conveniently swith between italic and upright greek letters. I need a command, simillar to what is discussed here, to change normal greek letters to upright bold symbols.
None of the commands \mathrm
, \mathbf
, \boldsymbol
or \bm
makes\theta
to appear as \uptheta
. Moreover, isomath
package does not work with the encoding and its typeface is not desired. I don't want to globally switch to upright greek letters or change the font shape.
\documentclass{report}
\usepackage[T1]{fontenc}
\usepackage[type1]{libertine}
\usepackage[libertine]{newtxmath}
\usepackage{bm}
\begin{document}
What I get: $\theta \bm{\theta} \mathrm{\theta} \bm{\mathrm{\theta}}$
What I want: $\theta \bm{\theta} \uptheta \bm{\uptheta}$
\end{document}
--- Partial Solution ---
I found that a new upgreek
command may be defined to replace all greek letter macros (e.g. \theta
) with their upside variants (e.g. \uptheta
) in its argument. Following example does it for three greek letters. The scope of the command is local, so both variants can be used in a single equation.
\documentclass{report}
\usepackage[T1]{fontenc}
\usepackage[type1]{libertine}
\usepackage[libertine]{newtxmath}
\usepackage{bm}
\newcommand{\upgreek}[1]{{
\renewcommand{\beta}{\upbeta}
\renewcommand{\theta}{\uptheta}
\renewcommand{\zeta}{\upzeta}
#1
}}
\begin{document}
$\upgreek{\theta} \bm{\upgreek{\theta}} \theta \bm{\theta}$
\end{document}
Questions:
- Is it safe to patch
\mathrm
to run\upgreek
on its argument?
isomath
is not working withlibertine
, and globally forcing greek letters to upright form is not wanted. I need\mathrm
or any other command to modify\theta
to appear as\uptheta
.\mathup
, not\mathrm
. I can't compile the MWE for come reason so I can't offer much help. How about loadingamsmath
and try\operatorname{\theta}
?