Latex - \multicolumn within an align* environment

12,186

Solution 1


\begin{align*}
  1 & 2 & 3 & 4 & 5 \\
  \omit\rlap{Some text that I want to appear here...}\\
  7 & 8 & 9 & 10 & 11 & 12
\end{align*}

Generally, as a replacement for \multicolumn within align-like environments, one could try to experiment with \multispan, but it seems to interfere badly with the alignment in this case.

Solution 2

Apparently in math mode, the commands \llap and \rlap for horizontal alignment don't work. The package mathtools provides \mathllap and \mathrlap, which do work there.

Source: this post.

Share:
12,186
ARV
Author by

ARV

Updated on June 30, 2022

Comments

  • ARV
    ARV almost 2 years

    I would like to have a \multicolumn like effect within an align* environment, as shown in the code snippet (which doesn't work) below. I.e., I want the text to be aligned with the leftmost column, but it shouldn't affect the alignment characteristics of the equation otherwise. \intertext{...} unfortunately flushes everything to the left margin, even when the equation is centered.

        \begin{align*}
          1 & 2 & 3 & 4 & 5 \\
          \multicolumn{5}{l}{Some text that I want to appear here..} \\
          %\intertext{Some text that I want to appear here} \\
          7 & 8 & 9 & 10 & 11 & 12
        \end{align*}
    

    How do I make this happen?

    Many thanks in advance!