[Tex/LaTex] How to use AMS Euler font in functions such as \sin and \cos

amsmathcomputer-moderneulereulervmfonts

Looking carefully at a basic AMS Euler example, we see that the output of\sin and \cos macros are rendered using Computer Modern font instead of the AMS Euler font. So, how to use AMS Euler font in functions such as \sin and \cos? If possible, please explain why is this the default behaviour?

This is the example:

\documentclass[a5paper]{article}
\usepackage{euler}
\pagestyle{empty}
\begin{document}

\[ AMS\ Euler \]

\[ \int_0^3 9x^2 + 2x + 4\, dx = 3x^3 + x^2 + 4x + C \Big\rbrack_0^3 = 102 \]

\[ e^{x+iy} = e^x(\cos y + i\sin y) \]

\[ x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a} \]

\end{document}

and this is the output:

AMS Euler sample

Best Answer

Euler is not really compatible with Computer Modern, it's better with Palatino, in my opinion.

As a rule, the operator names such as sine, cosine and logarithm are typeset with the normal (upright) text font, in order not to be confused with products of quantities: “sin” does not mean the product “s by i by n”.

\documentclass[border=2]{standalone}

\usepackage{newpxtext,newpxmath}
\usepackage{eulervm}

\begin{document}

$e^{x+iy} = e^x(\cos y + i\sin y)$

\end{document}

Note that eulervm is to be preferred to the outdated euler package.

enter image description here

You can surely see that the appearance is better.

You can change the font for operator names to be the same as for variables:

\documentclass[border=2]{standalone}

\usepackage{newpxtext,newpxmath}
\usepackage{eulervm}

\makeatletter
\renewcommand{\operator@font}{\mathgroup\symletters}
\makeatother

\begin{document}

$e^{x+iy} = e^x(\cos y + i\sin y)$

\end{document}

enter image description here

I recommend not doing it.

Related Question