5

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}

enter image description here

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

marc k
  • 203
  • 2
  • 6

1 Answers1

8

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}

enter image description here

egreg
  • 1,121,712