Is there is a way to modify the behaviour of the $$ .... $$ display math in order to make automatic line breaking? I am aware of the breqn package, but to use it I would need to retype all the equations in all the documents and that is a lot of work.

I need the breqn package, or a similar functionality, because I am switching all my documents to two column format, which I find it a lot more readable (I suppose it has something to do with age). The problem is that there are lots of equations which do not fit in the shorter line and the result is terrible. In addition when you are writing it is difficult to think where the line-breaking should go, so, for to my needs, it is better to leave LaTeX the decision of where to break and later correct manually when needed.

Thanks for your help.

  • 3
    TeX is designed not to do automatic line breaking in math displays, because this cannot be done by machine as it requires understanding the meaning of a formula. The breqn package uses some heuristics that, most of the time, fail.
    – egreg
    Mar 30, 2021 at 22:04
  • @egreg Yes, I have seen it, but many times it does a good job even if some times it fails, and I feel that it saves a lot of work. Mar 30, 2021 at 22:08
  • If you're only aiming for personal use, I would go for large margins, large font, and 1.5 or double spacing.
    – Teepeemm
    Mar 30, 2021 at 22:17
  • 1
    note that $$ is not latex syntax and should not be used at all in latex. tex display math is really explicitly designed to only support manual line breaks. breqn was an experiment to do automatic breaking but not entirely successful, Mar 30, 2021 at 22:44
  • @DavidCarlisle I started with TeX 40 years ago, and it is difficult to change a lifelong routine. I understand that there is no way in LaTeX to redefine the $$ to use breqn so I will try with a different solution. Thank you. Mar 31, 2021 at 8:02

1 Answer 1


TeX was designed to generate high quality output. It leaves the decision of math formula breaking to human, because there are not simple rules how to do it and it often depend on aesthetic views on matter. Only human can give good decision.

Of course, today we have neural networks, deep learning and similar technologies, but nothing similar was present when TeX was born. And the concept of TeX as "monolitic" program does not facilitate connection with external modern libraries to solve such particular tasks.

If you compromise on high quality requirements then you can convert $$...$$ to

\par\medskip $\displaystyle ...$\par\medskip 

It should be done using a script which converts TeX source or at macro level. But there is more problems: many $$...$$ are manually modified using alignment macros (for example \eqalign{...}) or the equation number is added. These macros cannot simply work in $\displaystyle ...$ environment.

  • 2
    Worth noting that breqn uses the idea of avoiding TeX's display math mode (almost) entirely: I do like that part of the plan (do everything using inline math mode).
    – Joseph Wright
    Mar 31, 2021 at 10:14

You must log in to answer this question.

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