3

I want to use the two packages hepparticles and breqn together in the same document. But the hepparticles package does not seem to work well with breqn. Here is a minimal not-working example.

\documentclass{article}
\usepackage{hepparticles}
\usepackage{breqn}
\begin{document}
This is the notation for an electron neutrino \HepParticle{\nu}{e}{}.\\
This is the notation for an electron anti-neutrino \HepAntiParticle{\nu}{e}{}.
\end{document}

Compiling with pdflatex shows strange symbols for the greek letters \nu, although the subscripts "e" are displayed fine.

enter image description here

The \HepParticle command works fine when breqn is not used. Is there a way I can use both packages hepparticles and breqn?

2 Answers 2

4

A really minimal example actually doesn't require hepparticle:

\documentclass{article}
\usepackage{breqn}

\begin{document}

$\mathit{\nu}$

\end{document}

If you try it, you'll see the same strange symbol you get with your code, which is the ring accent from the italic font. The fact is that eventually \HepParticle{\nu}{e}{} wants to do

\mathit{\nu}

Such a command would simply produce a standard nu letter, with the default LaTeX setting; hepparticles uses this to italicize letters, but not using math italic.

However, breqn (or, better, flexisym) changes the meaning of \nu so that it gives essentially a random result if in the argument to \mathit. For very strange reasons, Greek letters are redeclared by flexisym to be of type 7 instead of 0, so they obey the current math group.

You can fix \nu, but you'll have similar problems with other characters, probably. Look in cmbase.sym and copy the offending definitions changing Var into Ord as I did for \nu.

\documentclass{article}
\usepackage{hepparticles}
\usepackage{breqn}

% Fix the wrong assignment to \nu
\DeclareFlexSymbol{\nu}{Ord}{greek}{17}

\begin{document}
Electron neutrino \HepParticle{\nu}{e}{}.

Electron anti-neutrino \HepAntiParticle{\nu}{e}{}.
\end{document}

enter image description here

This is clearly a bug of flexisym; but I usually recommend against using breqn in the first place. A nice idea which simply doesn't work.


On the other hand, it seems that at least this example works with unicode-math. Compile with XeLaTeX:

\documentclass{article}
\usepackage{hepparticles}
\usepackage{breqn}
\usepackage{unicode-math}

\begin{document}
Electron neutrino \HepParticle{\nu}{e}{}.

Electron anti-neutrino \HepAntiParticle{\nu}{e}{}.
\end{document}

enter image description here

2
  • Thank you for your comments and suggestions. I've been also having other compatibility problems between breqn and a few other packages, and the more hacks I put in to use breqn the more I began to doubt if it's something I should be using. I wonder why many other people regard breqn so highly on tex.stackexchange.com.
    – mich
    Jul 10, 2015 at 20:50
  • 3
    @mich I'm not among them. I find it buggy and more difficult to use than manually breaking. It may be beneficial for “automated” typesetting, but the typographic quality is surely not the best.
    – egreg
    Jul 10, 2015 at 20:51
0

There is now an alternative to breqn: the autobreak package was released recently. It is less sophisticated than breqn, e.g. it requires you to place newlines on possible breakpoints. However, according to my experience, it has less clashes with other packages.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .