I guess I want to define a new environment, but perhaps it already exists and I didn't know what to search for.
The environment I want should leave the equations center aligned if no &
is present and should keep the =
signs aligned if present.
\documentclass{article}
\begin{document}
\begin{customEnv}%behave like gather
a=1,\\
b=1111111111111111111111111111.
\end{customEnv}
\begin{customEnv}%behave like align
a&=1,\\
b&=1111111111111111111111111111.
\end{customEnv}
\end{document}
PS: Bonus points if we can use some parameter to change the environment's behavior when without &
, so that it defaults to center, left or right depending on this parameter!!!
PPS: If possible try to use only the standar packages available.