1

I recently found out about the breqn package and have been using it profusely. However, I notice that my article's title section is thrown off by this package. Specifically, the affiliation part of my text appears without spacing and the compiler throws a missing $ inserted at the \maketitle line. In constructing an MWE, I see that the breqn package is causing this glitch. How do I resolve this?

\documentclass[%
reprint,
amsmath,amssymb,
aps,floatfix
]{revtex4-2}
\usepackage{breqn}
\usepackage{blindtext}
\begin{document}
\title{Sample title}
\author{Aritra Das}
\affiliation{Dept. of Physics, Indian Institute of Technology, Kanpur, Uttar Pradesh 208016, India}
\date{\today}
\maketitle
\section{Introduction}
\blindtext
\end{document}

Compiled document with error in affiliation text Any help is appreciated, thanks.

  • Erh, did you try without breqn (hint: it is also italic without breqn). Note that breqn is not recommended to use as it is very incompatible with other stuff. – daleif Jun 2 at 14:19
  • Yes, the error goes away on removing the breqn package, but I was relying on it at a number of points throughout the article, so removing it was not my top choice. – Aritra Das Jun 2 at 14:22
  • 1
    the title error goes away, not the fact that the affiliations are italic – daleif Jun 2 at 14:31
  • 1
    Sorry that was my mistake, I've edited the question accordingly. The italics are supposed to stay. – Aritra Das Jun 2 at 16:03
3

Nice find!

The revtex4-2 class loads the affiliation under a setting where the comma is made active, with replacement text \active@comma. But breqn defines the active comma in a very different way, only useful in math mode.

The solution is to not use breqn, of course. If you insist on it:

\documentclass[
  reprint,
  amsmath,amssymb,
  aps,floatfix
]{revtex4-2}

\usepackage{breqn}
\usepackage{blindtext}

%%% let's try and fix the issue
\begingroup\makeatletter
\catcode`,=\active
\global\let\breqn@comma,
\protected\gdef,{\ifmmode\expandafter\breqn@comma\else\expandafter\active@comma\fi}
\endgroup

\begin{document}

\title{Sample title}
\author{Aritra Das}
\affiliation{Dept. of Physics, Indian Institute of Technology, Kanpur, Uttar Pradesh 208016, India}
\date{\today}

\maketitle

\section{Introduction}

$a,b$

\blindtext

\end{document}
| improve this answer | |
  • Wow, thanks a lot! I only prefer breqn as it seems more consistent than arbitrarily breaking long equations manually. – Aritra Das Jun 2 at 14:27
  • 1
    @AritraDas there are rules as to where to break math, in most cases it is better to apply these by hand not automatically. See ams.org/arc/styleguide/mit-2.pdf some of the rules – daleif Jun 2 at 14:32
  • 1
    @AritraDas To the contrary, I think that breqn decides quite arbitrarily where to place a break. – egreg Jun 2 at 14:39
  • @daleif that is a very helpful guide, thanks. Nonetheless, it does not specify where to break in my case: I'm working with long polynomial-type expressions with several terms, each separated by plus/minus signs. Arbitrarily choosing one of those to break the equation is what I was referring to. Surely 'breqn' does a better job than me? – Aritra Das Jun 2 at 16:09
  • @AritraDas not really, it will just fill up from the left. In many cases (you'll know with experience) there are often break points that are more pleasing or more readable that others. – daleif Jun 2 at 16:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.