# Problem with accents in math mode using eulerpx package

The following code

\documentclass{amsart}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{newpxtext,eulerpx}

\begin{document}

$\textsf{á\ â\ ã\ ä}\qquad\mathsf{\acute{a}\ \hat{a}\ \tilde{a}\ \ddot{a}}\qquad\mathsf{\Delta\ \Theta\ \Lambda\ \Xi}$

$\textrm{á\ â\ ã\ ä}\qquad\mathrm{\acute{a}\ \hat{a}\ \tilde{a}\ \ddot{a}}$

\end{document}


has the following output:

As you can see, Roman font poses no problems, unlike Sans Serif font (Greek letters at the right were included just for comparison). Is this a bug from eulerpx package? can this problem be (temporarily) solved with additional code?

• In math sans-serif font is commonly used only for letters (to give them special meaning), and not for accents. I would use \hat{\mathsf{a}} for accented sans-serif math. If your surrounded text would be sans-serif and you would want math to blend in then it'd be another story. – Sergei Golovan Mar 21 '19 at 6:38
• @SergeiGolovan You just beat me to posting a MWE. – Davislor Mar 21 '19 at 7:12
• @SergeiGolovan Indeed! unfortunately to me, I want operator names to use sans serif type, with accents in some cases ("máx", for example, which is the abbreviation for "máximo" (maximum) in Portuguese). – Matemáticos Chibchas Mar 21 '19 at 19:59
• You already know this, but I’ll leave a link for anyone who finds this question in a search: the reason you were getting overstruck Greek letters in place of accents is that you set the font encoding to T1 but chose an OT1 operator font. The codepoints of those accents in T1 map to Greek capital letters in OT1. Solutions to your follow-up question here. – Davislor Mar 26 '19 at 15:35

# Workaround

\documentclass[varwidth=10cm]{standalone} % Replace this!
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{newpxtext, classico, textcomp, eulerpx}

\begin{document}

$\textsf{á\ â\ ã\ ä}\qquad{\acute{\mathsf a}\ \hat{\mathsf a}\ \tilde{\mathsf a}\ \ddot{\mathsf a}}\qquad\mathsf{\Delta\ \Theta\ \Lambda\ \Xi}$

$\textrm{á\ â\ ã\ ä}\qquad\mathrm{\acute{a}\ \hat{a}\ \tilde{a}\ \ddot{a}}$

\end{document}


This sets the sans-serif font to the one recommended for the eulerpx package, classico. It requires getnonfreefonts to install. However, the lowercase a in Palatino (newpx) and Optima (Classico) look very similar to each other, and therefore you might prefer another sans-serif math font if you need to distinguish \mathrm{a} and \mathsans{a}.

# In the Modern Toolchain

AMS Euler, Palatino and Optima all have free OpenType clones usable in unicode-math.

\documentclass[varwidth=10cm]{standalone}
\usepackage{mathtools}
\usepackage[math-style=upright]{unicode-math}

\defaultfontfeatures{Scale = MatchLowercase}
\setmainfont{TeX Gyre Pagella}[Scale = 1.0]
\setsansfont{URW Classico}
\setmathfont{Asana Math}
%\setmathfont[range=sfup]{URW Classico}
%\setmathfont[range=bfsfup]{URW Classico Bold}
%\setmathfont[range=sfit]{URW Classico Italic}
%\setmathfont[range=bfsfit]{URW Classico Bold Italic}
\setmathfont[range={up, bfup, cal, bfcal, frak, bffrak}]{Neo Euler}

\begin{document}

$\textsf{á\ â\ ã\ ä} \qquad \symsfup{\acute{a}\ \hat{a}\ \tilde{a}\ \ddot{a}} \qquad \symsfup{\Delta\ \Theta\ \Lambda\ \Xi} \hfill$
$\textrm{á\ â\ ã\ ä} \qquad \mathnormal{\acute{a}\ \hat{a}\ \tilde{a}\ \ddot{a}} \qquad \mathrm{\acute{a}\ \hat{a}\ \tilde{a}\ \ddot{a}}$

\end{document}


If you load URW Classico with range=sfup, the placement of your math accents over sans-serif letters will be wrong, so I simply left the default sans-serif math letters from Asana in place. I would suggest defining a different math version for sans-serif math, but (as of March 2019) the range = and version = options of \setmathfont do not work together.