# Merging inside align-environment

An align-environment allows for line-splitting and aligning as in table columns when writing math in latex:

\documentclass{article}
\usepackage{amsmath}
\begin{document}

\begin{align*}
lefthandside1 &= righthandside1\\
lefthandside2 &= righthandside2\\
lefthandside3 &= righthandside3\\
lefthandside4 &= righthandside4
\end{align*}

\end{document}


All equal-signs = will be right under one another because of &.

I need to add a remark in-between two math-lines. Something like the following:

\documentclass{article}
\usepackage{amsmath}
\begin{document}

\begin{align*}
lefthandside1 &= righthandside1\\
lefthandside2 &= righthandside2\\
This is a remark before the third line.\\
lefthandside3 &= righthandside3\\
lefthandside4 &= righthandside4
\end{align*}

\end{document}


Essentially this extra line must merge the two "columns" that the & symbol has created on all other lines. It should act like a normal text-line and not be split or aligned. If I don't include a &, then the end of the remark is still aligned according to the other lines.

Is it possible to merge "columns" (or "ignore" the & splitting) on a specific line, without altering the others?

## 3 Answers

If this remark line is not part of the math lines, then using intertext{..} is another way for doing this.

\documentclass{article}
\usepackage{amsmath}
\begin{document}

\begin{align*}
lefthandside1 &= righthandside1\\
lefthandside2 &= righthandside2
\intertext{This is a remark before the third line.}
lefthandside3 &= righthandside3\\
lefthandside4 &= righthandside4
\end{align*}

\end{document}


Another method is to use \noalign{..}. This will be similar to the \shortintertext.

\documentclass{article}
\usepackage{amsmath}
\begin{document}

\begin{align*}
lefthandside1 &= righthandside1\\
lefthandside2 &= righthandside2\\
\noalign{This is a remark before the third line.}
lefthandside3 &= righthandside3\\
lefthandside4 &= righthandside4
\end{align*}

\end{document}


You could use TeX's multispan (inspiration here).

\documentclass{article}
\usepackage{amsmath}
\begin{document}

\begin{align*}
lefthandside1 &= righthandside1\\
lefthandside2 &= righthandside2\\
\multispan2{Remark before the third line\hfil}\\
lefthandside3 &= righthandside3\\
lefthandside4 &= righthandside4
\end{align*}

\end{document}


You can use shortintertext of the mathtools-package:

\documentclass{article}
\usepackage{amsmath}
\usepackage{mathtools}

\begin{document}

\begin{align*}
lefthandside1 &= righthandside1\\
lefthandside2 &= righthandside2\\
\shortintertext{\hfil This is a remark before the third line.}
lefthandside3 &= righthandside3\\
lefthandside4 &= righthandside4
\end{align*}

\end{document}


If you leave out the \hfil the remark is flushed left.

• I don't see why the remark should not be flushleft? Jun 26 '17 at 18:56
• I added a comment in the answer. Jun 27 '17 at 9:49