You might want to file a feature request to the developer of newtxmath
; in the meantime you can change the definitions of the Greek lowercase letters.
\documentclass{report}
\usepackage[T1]{fontenc}
\usepackage[type1]{libertine}
\usepackage[libertine]{newtxmath}
\usepackage{bm}
\makeatletter
\re@DeclareMathSymbol{\alpha}{\mathord}{lettersA}{11}
\re@DeclareMathSymbol{\beta}{\mathord}{lettersA}{12}
\re@DeclareMathSymbol{\gamma}{\mathord}{lettersA}{13}
\re@DeclareMathSymbol{\delta}{\mathord}{lettersA}{14}
\re@DeclareMathSymbol{\epsilon}{\mathord}{lettersA}{15}
\re@DeclareMathSymbol{\zeta}{\mathord}{lettersA}{16}
\re@DeclareMathSymbol{\eta}{\mathord}{lettersA}{17}
\re@DeclareMathSymbol{\theta}{\mathord}{lettersA}{18}
\re@DeclareMathSymbol{\iota}{\mathord}{lettersA}{19}
\re@DeclareMathSymbol{\kappa}{\mathord}{lettersA}{20}
\re@DeclareMathSymbol{\lambda}{\mathord}{lettersA}{21}
\re@DeclareMathSymbol{\mu}{\mathord}{lettersA}{22}
\re@DeclareMathSymbol{\nu}{\mathord}{lettersA}{23}
\iftx@altnu
\re@DeclareMathSymbol{\nu}{\mathord}{lettersA}{40}
\fi
\re@DeclareMathSymbol{\xi}{\mathord}{lettersA}{24}
\re@DeclareMathSymbol{\pi}{\mathord}{lettersA}{25}
\re@DeclareMathSymbol{\rho}{\mathord}{lettersA}{26}
\re@DeclareMathSymbol{\sigma}{\mathord}{lettersA}{27}
\re@DeclareMathSymbol{\tau}{\mathord}{lettersA}{28}
\re@DeclareMathSymbol{\upsilon}{\mathord}{lettersA}{29}
\re@DeclareMathSymbol{\phi}{\mathord}{lettersA}{30}
\re@DeclareMathSymbol{\chi}{\mathord}{lettersA}{31}
\re@DeclareMathSymbol{\psi}{\mathord}{lettersA}{32}
\re@DeclareMathSymbol{\omega}{\mathord}{lettersA}{33}
\re@DeclareMathSymbol{\varepsilon}{\mathord}{lettersA}{34}
\re@DeclareMathSymbol{\vartheta}{\mathord}{lettersA}{35}
\re@DeclareMathSymbol{\varpi}{\mathord}{lettersA}{36}
\re@DeclareMathSymbol{\varrho}{\mathord}{lettersA}{37}
\re@DeclareMathSymbol{\varsigma}{\mathord}{lettersA}{38}
\re@DeclareMathSymbol{\varphi}{\mathord}{lettersA}{39}
\makeatother
\begin{document}
What I get: $\theta \bm{\theta}$
What I want: $\uptheta \bm{\uptheta}$
\end{document}
Note that \mathbf{\theta}
won't do any good, only Latin letters are affected by \mathbf
.
You can also define \mathup
and \mathbfup
:
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[type1]{libertine}
\usepackage[libertine]{newtxmath}
\usepackage{bm}
\DeclareRobustCommand{\mathup}[1]{\begingroup\changegreek\mathrm{#1}\endgroup}
\DeclareRobustCommand{\mathbfup}[1]{\begingroup\changegreekbf\mathbf{#1}\endgroup}
\makeatletter
\def\changegreek{\@for\next:={%
alpha,beta,gamma,delta,epsilon,zeta,eta,theta,kappa,lambda,mu,nu,xi,pi,rho,sigma,%
tau,upsilon,phi,chi,psi,omega,varepsilon,vartheta,varpi,varrho,varsigma,varphi}%
\do{\expandafter\let\csname\next\expandafter\endcsname\csname\next up\endcsname}}
\def\changegreekbf{\@for\next:={%
alpha,beta,gamma,delta,epsilon,zeta,eta,theta,kappa,lambda,mu,nu,xi,pi,rho,sigma,%
tau,upsilon,phi,chi,psi,omega,varepsilon,vartheta,varpi,varrho,varsigma,varphi}%
\do{\expandafter\def\csname\next\expandafter\endcsname\expandafter{%
\expandafter\bm\expandafter{\csname\next up\endcsname}}}}
\makeatother
\begin{document}
$\mathup{d}\mathup{\theta}d\theta$
$\mathbfup{d}\mathbfup{\theta}\bm{d}\bm{\theta}$
\end{document}
Best Answer
This answer comes following discussion in the comments to the question, to which I refer the reader. I pointed out that my solution at Upright Greek font fitting to Computer Modern works directly at unslanting a font (it is based on Bruno's answer at Shear transform a "box"). I show there how to apply it to greek letter forms, but noted that it only applies to pdflates, whereas the OP had lualatex invocations in the preamble.
The OP then tells me that the
\unslant
method works in lua as well (halle-lua-jah), but that the underlying\slantbox
has a problem accepting the color oftikz
nodes. That was news to me, since\slantbox
accepts color just fine as part of a\textcolor
argument, or following a\color
declaration.I then came across a pgf bug report, https://sourceforge.net/p/pgf/bugs/362/, that would seem to be related to the problem. Since I can't solve that problem myself, I looked for a workaround.
Heiko's answer at How to save the current colour shows a cool technique of
\colorlet{slantcolor}{.}
to save the current color (before going into the\mbox
, and then I just re-issued a\color{slantcolor}
inside the\foobox
. That seemed to fix the problem.To recap, the
\unslant
method allows existing italic letters to be made upright in the same font design, and the\colorlet
fix allows this solution to work with coloredtikz
nodes. The overall approach works with pdflatex and lualatex.