This is very similar to A vertically centered equation number on a multline environment, but the answers won't apply to my case it seems.
I have
\begin{multline}
X = \\
LOOOOOOOOOOOOOOOOOOOOOOOOOOONG
\end{multline}
and like how the output looks without a line number. Now I want to add a line number to the right, but the second line is too long. How do I put it in the first line (to the right!)?
I know about \raisetag
, but I would prefer an exact solution. My second line has a non-trivial height.
Edit: I should add that LOOOOOOOOOONG is nearly as long as my text width.
Edit: This is a more appropriate example:
\begin{multline}
X = \\
\framebox[\linewidth]{LONG}
\end{multline}
Edit: Once again a more elaborate example to show that egreg's answer does not answer my question. My use case is an integral expression that I do not want to break. It does not matter how it looks or what its contents is. Its line is pretty damn close to the available linewidth.
\documentclass{article}
\usepackage{mathtools}
\usepackage[showframe]{geometry}
\setlength{\multlinegap}{0pt}
\begin{document}
This works fine:
\begin{equation}
\begin{multlined}[t]%
X = \\%
\framebox[\dimexpr.9\linewidth\relax]{some expression shorter than the next}%
\end{multlined}%
\end{equation}%
Note the equation number in this harder case:
\begin{equation}%
\begin{multlined}[t]%
X = \\%
\framebox[\dimexpr\linewidth-1.666666pt\relax]{long expression that I do not want to break}%
\end{multlined}%
\end{equation}%
This solves the equation number problem, but messes up horizontal positioning. It actually goes over the right border:
\begin{equation}%
\begin{multlined}[t]%
X = \\%
\mathmakebox[.9\width][l]{%
\framebox[\dimexpr\linewidth-1.666666pt\relax]{long expression that I do not want to break}%
}%
\end{multlined}%
\end{equation}
\end{document}