I use align* often and sometimes it is preferable to add text to the right hand side of an equation instead of using \intertext, or \shortintertext, which tends to interrupt the math flow. This is pretty straightforward using \text{}, except if the text is longer than the amount of space available. In this case I use a \parbox and tweak the width of it until it fits, as in the first set of equations:

However, I am wondering if there is a way to define the \RemainingSpace macro below as some \dimexpr expression so that it computes the amount of horizontal space that is available to the \parbox?
Or, is there a better way to do this? I realize a tabularx solution would work, but align is really preferable when it comes to equations.
Minipage:
- The problem is much worse when working in a
minipagewas the width is reduced. An image of that is not included here but is on Page 2 of the output generated by the MWE below.
Notes:
- I am not really worried about the issue of numbering equations, but that might be useful for others.
- Am assuming that the same solution would work with
alignat*, but have added a test case for that just in case.
Code:
\documentclass{article}
\usepackage{showframe}
\usepackage[fleqn]{amsmath}
\newcommand*{\RemainingSpace}{9.0cm}%
\newcommand{\Note}[1]{\parbox[t]{\RemainingSpace}{#1}}%
\newcommand*{\RubbishText}{This was obvious once it was determined that the earlier versions $E = mc$ and $E = mc^3$ were not quite accurate.}%
\newcommand{\TestCases}{%
First using \textbf{align} with a \textbf{quad} for spacing:
\begin{align}
E &= mc^2 \quad\Note{\RubbishText}\
F &= ma + \sin^2 x + \cos^2 x - 1.
\end{align}
Or could use double ampersand for spacing (but less important than the above version):
\begin{align}
E &= mc^2 &&\Note{\RubbishText}\
F &= ma + \sin^2 x + \cos^2 x - 1
\end{align}
Or, using \textbf{alignat}
\begin{alignat}{2}
E &= mc^2 \quad\Note{\RubbishText}\
F &= ma + \sin^2 x + \cos^2 x - 1
\end{alignat}%
}%
\begin{document}\noindent
\TestCases
\clearpage\noindent
Same code as above but put in a \verb|\minipage{0.70\linewidth}|:
\bigskip
\hspace*{0.25\linewidth}%
\begin{minipage}{0.70\linewidth}
\TestCases
\end{minipage}%
\end{document}


cos-->\cos;) – Svend Tveskæg Mar 03 '13 at 07:14\sinbefore.... Thanks. Am fixing... – Peter Grill Mar 03 '13 at 07:18cos. Still thanks for pointing it out. – Peter Grill Mar 03 '13 at 07:26