There are many previous questions on the topic of “how do I keep over-wide content centered?”: for displayed math, figures, equations. Their answers (mostly using \mathclap) are well-suited to the use-case of centering individual over-wide content that you have specifically decided to tolerate in a document.
I would like to do the same thing — centering over-wide equation* environments — but for a different use-case: the document is still in preparation, and I intend to fix the over-wide equations later, but while preparing the document, I’d like to keep them centered for readability. So my extra desiderata are:
do not suppress the
overfull hboxwarnings (I still want to find/fix these wide equations later)apply globally to all
equation*environments (presumably by patching the environment definition)
The solutions with mathclap put the equation content in a zero-width box, so have the effect of suppressing warnings. Some of the other solutions retain the warnings, but work by hand-coding a suitable box around the wide content, and I can’t figure out how to patch them into the environment definition. (Also, some of these alter the vertical spacing of the equation, which I’d like to avoid if possible.)
In other words, I’d like to change the behaviour from “over-wide equations spill into the right margin” to “over-wide equations spill equally into both margins”, without changing anything else, as far as possible.
Possibly-relevant note: I’m using amsmath.
adjustwidthenvironment fromchangepageand remove it later. – Bernard May 02 '20 at 19:03equation*is a thin wrapper around the primitive$$display math and the behaviour of overfull boxes to overflow on the right is deep in the tex primitive and not something you can control from tex macros, so while it is no doubt possible you would have to extensively re-implement a lot of the math layout logic, and probably be incompatible with existing macros, so it might be more trouble than worth just for debugging drafts. – David Carlisle May 02 '20 at 19:27