2022 Developer Survey is open! Take survey.
3 of 4
  • 5.6k
  • 25
  • 58

This really should be a comment, but it's a little too complicated.

If your math is either all in-line or displayed using the \[ ... \] notation, suppressing it is quite easy:

some text $xyz$ with embedded \(abc\) math.
some display math as well:
\[ def \]
more text

Things get trickier when you use \begin{xxx} ... \end{xxx} environments, and that doesn't even consider starred environments. I haven't licked that problem yet.

Many of the amsmath environments ingest the entire content between the \begin and \end markers, so could be redefined to just ignore that instead of measuring and setting.

This sounds like an interesting project for a package. Anyone who wants to can steal the ideas laid out above.

barbara beeton
  • 85k
  • 13
  • 213
  • 505