# non-italic symbols of the hepnames package not printing with pdflatex

for typsetting particles from physics the hepnames package is often used. After an upgrade to a win10 PC, I found that the symbols are not printing anymore - no error messages.

I use pdfLatex and found relating topics for

Here is my minimal example:

  \documentclass{report}
\usepackage{hepnames}

\begin{document}

\begin{itemize}
\item $\Pneutron$ should give $\mathrm{n}$   %does not print
\item $\Pfermion$ should give an $f$         %prints
\item $\APnue$ should give $\bar{\nu}$       %does not print
\end{itemize}

\end{document}


This is likely related to the italic font style. Using

\usepackage[italic]{hepnames}


will print all of the above examples.

This is however hardly a good fix for the package and will typeset all particle symbols in italic. Unfortunately pdflatex does not throw an error or a warning during compilation.

Any suggestions?

Best, Marc

• your example works in texlive 2018 but not 2019 or 2020, so it should be possible to trace the differences and see what changed. I'll look later if no one else has answered (welcome to the site by the way and thanks for the nice minimal example) Apr 28 '20 at 8:51
• @DavidCarlisle It's the change of NFSS: the detection code in hepnames doesn't 'know' up as a shape Apr 28 '20 at 8:51
• @JosephWright that was my guess but was confused by it working in 2019, or perhaps my tl2019 install is not exactly standard anymore:-) Apr 28 '20 at 8:53
• @DavidCarlisle we changed that already in tl2019. Apr 28 '20 at 9:04
• @UlrikeFischer that would explain it... Apr 28 '20 at 9:09

The hepnames package relies on \updefault being n, but this has changed to up and n is now \shapedefault.

Fix:

\documentclass{report}
\usepackage{hepnames}
\usepackage{xpatch}

\makeatletter
\xpatchcmd\@HepConStyle
{\edef\@upcode{\updefault}}
{\ifdefined\shapedefault\edef\@upcode{\shapedefault}\else\edef\@upcode{\updefault}\fi}
{}{}
\makeatother

\begin{document}

\begin{itemize}
\item $\Pneutron$ should give $\mathrm{n}$   %does not print

\item $\Pfermion$ should give an $f$         %prints

\item $\APnue$ should give $\bar{\nu}$       %does not print
\end{itemize}

\end{document}