This is a followup to an old thread
I'm starting a new one because it's hard to write all this in a comment. In the original thread, @egreg proposed the following commands
\makeatletter
\newcommand{\pushright}[1]{\ifmeasuring@#1\else\omit\hfill$\displaystyle#1$\fi\ignorespaces}
\newcommand{\pushleft}[1]{\ifmeasuring@#1\else\omit$\displaystyle#1$\hfill\fi\ignorespaces}
\makeatother
as a way to obtain the effect of \hfill within an align environment.
The first pushes text to the right, the second to the left, of the line.
I've been trying to modify these command, and am getting inconsistent results. To avoid &\pushright{\text{foo}} I would like to put the text and the atsign in the macro, then just say, for example, \rightPush{foo}. I've succeeded to construct \rightPush, but for some baffling reason, the analog \leftPush doesn't work. Here are my two macros.
\def\rightPush#1{& \ifmeasuring@#1\else\omit\hfill$\displaystyle\text{#1}$\fi\ignorespaces}
\def\leftPush#1{\ifmeasuring@#1\else\omit$\displaystyle\text{#1}$\hfill & \fi\ignorespaces}
I'd be happy to leave the & out of the macro, but that doesn't help: the \text in the \leftPush is what generates the errors (though not in the \rightPush). As a followup question, if somebody could explain what the \ifmeasuring@ and omit are doing in this macro, I'd really appreciate it.
Thanks very much for any advice
\documentclass{...}and ending with\end{document}. Otherwise it is difficult to figure out how precisely you are using\leftPushand\rightPush. – jarauh Oct 28 '15 at 15:34