1

When using \DeclareMathOperator from the amsmath package and the mathpazo package (for fonts) the greek letters aren't printed correctly.

For example, with the following code

\documentclass{article}
\usepackage{mathpazo}
\usepackage{amsmath}
\DeclareMathOperator{\proj}{\pi}

\begin{document}
    $\proj$
\end{document}

I should get a pi, but I don't get a pi at all, instead I get an esszet (a german letter that looks like a beta).

Does anyone understand why this happens?

Thanks in advance! Any help will be appreciated.

3
  • Could you tell us, why you are trying to do this? \DeclareMathOperator is meant for stuff like sin, cos, Max, Min... The problem you are seeing here appears already for ` $\operatorname{\pi}$. Depending on what you want to get, I would just go for \newcommand{\proj}{\pi}`.
    – LaRiFaRi
    Jul 5, 2017 at 12:16
  • Thanks for your answer! Indeed using \newcommand{\proj}{\pi} worked, thanks! The reason why I used \DeclareMathOperator is because I was defined a series of operators with it (most of them like \DeclareMathOperator{\defrag}{defrag} and some of them much more simple like \DeclareMathOperator{\proj}{\pi}
    – Jack B.
    Jul 5, 2017 at 12:31
  • \DeclareMathOperator is intended to be applied to alphabetic strings. \pi doesn't count as alphabetic, but only as a math symbol, so i'm not surprised that the result is "unpredictable". Jul 7, 2017 at 21:39

1 Answer 1

0

I found a solution elsewhere: by using \mathchar"119 instead of \pi the problem doesn't show up (cf. mathpazo + siunitx: π turns into ß ; I hadn't seen it before)

In this particular case LaRiFaRi's suggestion of using \newcommand{\proj}{\pi} works too :) .

2
  • you might want to use \newcommand{\proj}{\mathop{{}\pi}} to get the same mathop spacing as other operators Jul 5, 2017 at 18:34
  • Yes, that also would keep the spacing that I want without conflicting with mathpazo. Thanks
    – Jack B.
    Jul 6, 2017 at 15:22

You must log in to answer this question.

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