I would like to automatically replace the align environment by an equation + aligned combination. Specifically, whenever \begin{align}
occurs, it should automatically read it as \begin{equation}\begin{aligned}
. Similarly, \end{align}
should be replaced by \end{aligned}\end{equation}
. Occurrences of \nonumber
also need to be gobbled up and ignored.
\documentclass[a4paper]{article}
\usepackage{amsmath}
\begin{document}
Any align such as
\begin{align}
x & = y + z, \nonumber \\
\alpha &= \beta + \gamma,
\end{align}
should automatically be replaced by an equation + aligned combination, effectively becoming
\begin{equation}
\begin{aligned}
x & = y + z, \\
\alpha &= \beta + \gamma.
\end{aligned}
\end{equation}
\end{document}
Ideally, I would like to achieve this without having to perform a manual replaceall throughout my document. The simplest solution I see would be to create a new environment that achieves the required effects, but then I would still need to replace all existing uses of the align environment with the new environment.
I've not been able to find or create an implemention of this. The most related answer I've been able to find is: Modify eqnarray to match amsmath align.
\begin{align}
with\begin{equation}\begin{aligned}
and similarly\end{align}
withend{align}\end{equation}
. Editors are able to replace all occurrences of this replacing without any manual intervention.