For example
\begin{align*}
\Omega \phantom{\Omega..}(A\phantom{\Omega..})
\end{align*}
Prints: O (A )
I want it to print O(A) without resorting to
\begin{align*}
\Omega
%\Omega..
(A
%\Omega..
)
\end{align*}
which is just terrible
For example
\begin{align*}
\Omega \phantom{\Omega..}(A\phantom{\Omega..})
\end{align*}
Prints: O (A )
I want it to print O(A) without resorting to
\begin{align*}
\Omega
%\Omega..
(A
%\Omega..
)
\end{align*}
which is just terrible
Instead of \phantom, consider something like \gobble where you add
\makeatletter
\let\gobble\@gobble
\makeatother
in your preamble. Note that the use of \gobble inside math mode is probably fine as spacing is corrected based on the surrounding elements. However, using \gobble as-is in text mode might result in unwanted/spurious spaces in the output if not used properly.
\gobbleinstead of\phantomwhere you have\makeatletter\let\gobble\@gobble\makeatotherin the preamble. – Werner Sep 15 '21 at 05:41\newcommand\gobble[1]{}– David Carlisle Sep 15 '21 at 06:44