I am trying to get the hepparticles/hepnames packages to work with XeLaTeX. I am using Libertine as serif font and Biolinum as sans font. The particle names are somehow rendered in the wrong font.
The HEP packages insert glyphs for particle names used in high-energy physics. They should (I think) use the current font and style, but which font they actually use is inconsistent. In the MWEs below, I used a simple particle name (B) for comparison of a normal rendering of the letter B and the particle name inserted with the \PB macro, which should be identical.
I tried different orders for the loading of the packages:
fontspec loaded before HEP packages
\documentclass{minimal}
\usepackage{fontspec}
\setmainfont{Linux Libertine}
\setsansfont{Linux Biolinum}
\usepackage{hepparticles}
\usepackage{hepnames}
\begin{document}
\begin{tabular}{p{1.5cm}p{1.5cm}p{1.5cm}p{1.5cm}p{1.5cm}}
~ & Normal & textsf & textit & textsf+textit \\
B & B & \textsf{B} & \textit{B} & \textit{\textsf{B}} \\
PB & \PB & \textsf{\PB} & \textit{\PB} & \textit{\textsf{\PB}} \\
\end{tabular}
\end{document}
The normal glyph uses the wrong font, the sf glyph uses the wrong font and serifs, but the italic versions are both correct:
fontspec loaded after HEP packages
\documentclass{minimal}
\usepackage{hepparticles}
\usepackage{hepnames}
\usepackage{fontspec}
\setmainfont{Linux Libertine}
\setsansfont{Linux Biolinum}
\begin{document}
\begin{tabular}{p{1.5cm}p{1.5cm}p{1.5cm}p{1.5cm}p{1.5cm}}
~ & Normal & textsf & textit & textsf+textit \\
B & B & \textsf{B} & \textit{B} & \textit{\textsf{B}} \\
PB & \PB & \textsf{\PB} & \textit{\PB} & \textit{\textsf{\PB}} \\
\end{tabular}
\end{document}
All glyphs use the correct style, but all have the wrong font except the serif-italic glyph.
Next I used the libertine/biolinum packages instead of fontspec, and compiled the file with pdflatex as well for comparison:
font packages loaded after HEP packages
\documentclass{minimal}
\usepackage{hepparticles}
\usepackage{hepnames}
\usepackage{libertineRoman}
\usepackage{biolinum}
\begin{document}
\begin{tabular}{p{1.5cm}p{1.5cm}p{1.5cm}p{1.5cm}p{1.5cm}}
~ & Normal & textsf & textif & textsf+textit \\
B & B & \textsf{B} & \textit{B} & \textit{\textsf{B}} \\
PB & \PB & \textsf{\PB} & \textit{\PB} & \textit{\textsf{\PB}} \\
\end{tabular}
\end{document}
pdflatex
All glyphs have correct style and wrong font:
xelatex
All glyphs use the correct style, but all have the wrong font except the serif-italic glyph.
font packages loaded before HEP packages
\documentclass{minimal}
\usepackage{libertineRoman}
\usepackage{biolinum}
\usepackage{hepparticles}
\usepackage{hepnames}
\begin{document}
\begin{tabular}{p{1.5cm}p{1.5cm}p{1.5cm}p{1.5cm}p{1.5cm}}
~ & Normal & textsf & textit & textsf+textit \\
B & B & \textsf{B} & \textit{B} & \textit{\textsf{B}} \\
PB & \PB & \textsf{\PB} & \textit{\PB} & \textit{\textsf{\PB}} \\
\end{tabular}
\end{document}
pdflatex
All glyphs use the correct style, and all have the correct font except the serif-italic glyph. (This would be fine for me, except that I want to use xelatex.)
xelatex
The normal glyph uses the wrong font, the sf glyph uses the wrong font and serifs, but the italic versions are both correct:
\PB
use math mode for their job. This is surely going to give problems.