# Use of bm package change symbols [duplicate]

The following code

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

\begin{document}

$a<b\quad\bm{a<b}$

\end{document}


Provides the following output:

The inequality symbol is not changed when I use, say, newpxmath instead. The problem seems to be indeed with the eulerpx package. How can this be solved?

• I’m pretty sure this is a duplicate – egreg Mar 15 '19 at 17:51

Not sure what all this breaks, but I redefined a symbol font and made < active inside of \bm.

The \begingroup...\endgroup isolates the catcode change, while still allowing binary operators inside the \bm to see what is outside of the \bm, shown in the MWE as y\bm{-y}.

\documentclass{amsart}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{eulerpx,bm}
\SetSymbolFont{letters}{bold}    {U}{zeur}{m}{n}
\let\svbm\bm
\renewcommand\bm{\begingroup\catcode<=\active \xbm}
\newcommand\xbm[1]{\svbm{#1}\endgroup}
\let\svlt<
{\catcode<=\active \gdef<{\mathop{\mathrm{\svlt}}}}
\begin{document}
$a<b\quad\bm{a<b}\quad y\bm{-y}$
\end{document}


To apply this approach to both < and > relations requires just a little extra:

\documentclass{amsart}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{eulerpx,bm}
\SetSymbolFont{letters}{bold}    {U}{zeur}{m}{n}
\let\svbm\bm
\renewcommand\bm{\begingroup%
\catcode>=\active %
\catcode<=\active %
\xbm}
\newcommand\xbm[1]{\svbm{#1}\endgroup}
\let\svlt<
\let\svgt>
{\catcode>=\active
\gdef>{\mathop{\mathrm{\svgt}}}
\catcode<=\active
\gdef<{\mathop{\mathrm{\svlt}}}}
\begin{document}
$a<b\quad\bm{a<>b}\quad y\bm{-y}$
\end{document}