1

I use TeX Live 2020 on Debian Testing; version of amsmath is 2.17e. I have noticed that I get the error

Package amsmath Error: \begin{split} won't work here. \end{split}

whenever there is an \everydisplay command and try to use the split env. within any math environment, whether display math (any delimiter), equation, eqnarray, and their starred versions. Here's a MnWE:

\documentclass{article}

\usepackage{amsmath} \usepackage{color}

\everydisplay{\color{blue}}

\let\equation\gather \let\endequation\endgather

\begin{document}

Line. \begin{equation} \begin{split} a & = b\ c & = d \end{split} \end{equation}

\end{document}

I tried using the solution here by modifying \equation using \let as seen above, but it doesn't work.

Is this some sort of bug? Should I report this somewhere? Is it just me? The only reference to this error in the amsmath doc. is the description of split ("it is not standalone" etc).

epR8GaYuh
  • 2,432
mathbekunkus
  • 1,389
  • note you have redefined equation but not endequation \let\endequatoin\endgather – David Carlisle Aug 30 '20 at 16:55
  • Related: you have a typo in the \endequat.... part. Though split really does not like that \everydisplay. I hardly ever use split anymore, if you don't redefine equation and use aligned instead of split then it works just fine. Unrelated: I'd use xcolor instead of color it can do more. – daleif Aug 30 '20 at 16:55
  • @DavidCarlisle it seems to give an error even when one does spell correctly? – daleif Aug 30 '20 at 16:56
  • @daleif sure but at least it has a chance of working – David Carlisle Aug 30 '20 at 16:56
  • Right, got the typo. Still doesn't work. The error changes, though: Improper \halign inside $$'s. \next@ ...skip \z@skip \global \row@ \@ne \halign to\displaywidth \bgroup \s.... No matter, the point is that split doesn't work when using \everydisplay. – mathbekunkus Aug 30 '20 at 17:02
  • My solution works with TL2020 – daleif Aug 30 '20 at 17:08
  • Okay, I can use aligned, but I'd still want to know why this happens. :) – mathbekunkus Aug 30 '20 at 17:11
  • 1
    Color is a strange beast and so is table like constructions. (align, split etc are table like constructions). And so things needs to be added to a "good" way. And that is probably not the case here. Given that not may people chooses to change the color of every equation, this has not been dealt with (it will probably need a rewrite of certain parts of amsmath). – daleif Aug 30 '20 at 17:21
  • Right. Color was just an example. I still get the error even if I just type \everydisplay{}. I'll use other environments if I have this command present. Thanks. :) – mathbekunkus Aug 30 '20 at 17:23

0 Answers0