4

Using the isomath trick to get upright greek pis works fine almost always, but not inside an amsthm theorem environment.

\documentclass{amsart}
\newtheorem{theorem}{Theorem}[section]
\usepackage[greek, english]{babel}
\let\mathpi\pi{}
\renewcommand{\pi}{\text{\textrm{\greektext{p}}}}

\begin{document}
\begin{theorem} \pi \end{theorem}
not the same as $\pi$.
\end{document}

How to force pi to be the same inside the environment?

Damien L
  • 621

3 Answers3

5

You can do like the following:

\documentclass{amsart}
\usepackage{bm}
\usepackage{pdftexcmds}
\usepackage{textgreek}

\newtheorem{theorem}{Theorem}[section]

\makeatletter
\DeclareRobustCommand{\cpi}{%
  \textnormal{%
    \ifnum\pdf@strcmp{\math@version}{bold}=\z@\bfseries\fi
    \textpi
  }%
}
\makeatother

\begin{document}

\begin{theorem}
$\cpi$
\end{theorem}

That's the same as $\cpi$. Also $\bm{\cpi}$.

\end{document}

I wouldn't redefine \pi.

enter image description here

egreg
  • 1,121,712
4

The default font doesn't have upright lowercase Greek letters. The upgreek package makes them available, from the Euler maths font, or from Adobe Symbol, depending on an option. I defines \uppi (and actually \upalpha,\upbeta, …).

Bernard
  • 271,350
0

In unicode-math, an upright π is available as either \uppi (for compatibility with \upgreek), \muppi, or \symup{pi}. (See here for several examples.) Several packages compatible with legacy NFSS also provide \uppi, including \usepackage[lcgreek]{stix} and upgreek. The \mathrm{\pi} command might also be acceptable.

Davislor
  • 44,045