How to have multiple lines of intertext within align* environment?

by Dennis   Last Updated January 11, 2018 10:23 AM

So I have two sets of equations that I'd like to be aligned, but they're broken up by two lines of text, the second of which should be indented.

MWE with Comments

\documentclass{article}
\usepackage{amsmath,mathtools,amssymb}
\DeclarePairedDelimiter{\sbar}{\lvert}{\rvert}
\newcommand{\tsbar}[1]{\sbar{#1}^\sigma_s}
\begin{document}
For this first one, I can't figure out an appropriate width for the parbox and I can't figure out how to indent the second line of text (neither the indent command nor an hspace works).
\begin{align*}
        \tsbar{\phi x_1,\dots,v_k} &= T \text{ iff } \langle \sigma(v_1),\dots,\sigma(v_k) \rangle \in \sbar{\phi}_s;\\
        \tsbar{\lnot \phi} &= T \text{ iff } \tsbar{\phi} \neq T;\\
        \tsbar{\phi \rightarrow \psi} &= T \text{ iff } \tsbar{\phi}\neq T \text{ or } \tsbar{\psi}=T;\\
        \tsbar{\forall x \phi} &= T \text{ iff, for every } a\in D_s,\ \sbar{\phi}^{[v/a]} = T;\\
        \tsbar{\Box_> \phi} &= T \text{ iff, for every } t > s, \tsbar{\phi} = T;\\
        \tsbar{\Box_< \phi} &= T \text{ iff, for every } t < s, \tsbar{\phi} = T.\\
\parbox{15em}{(Later-than is given the obvious definition: $t > s =_{df} s < t$.)\\[1ex]
%
\indent Then, the defined operators:}\\
        \tsbar{\Box_\geq \phi} &= T \text{ iff, for every } t \geq s, \tsbar{\phi} = T;\\
        \tsbar{\Box_\leq \phi} &= T \text{ iff, for every } t \leq s, \tsbar{\phi} = T;\\
        \tsbar{\Box \phi} &= T \text{ iff, for every } t \leq s \vee s \leq t, \tsbar{\phi} = T.
\end{align*}
This one gives me everything I want, but yields a ``misplaced alignment character'' error that only disappears when I remove the double backslash before the second line in the intertext (and I haven't figured out how to produce the requisite spacing without it). 
\begin{align*}
        \tsbar{\phi x_1,\dots,v_k} &= T \text{ iff } \langle \sigma(v_1),\dots,\sigma(v_k) \rangle \in \sbar{\phi}_s;\\
        \tsbar{\lnot \phi} &= T \text{ iff } \tsbar{\phi} \neq T;\\
        \tsbar{\phi \rightarrow \psi} &= T \text{ iff } \tsbar{\phi}\neq T \text{ or } \tsbar{\psi}=T;\\
        \tsbar{\forall x \phi} &= T \text{ iff, for every } a\in D_s,\ \sbar{\phi}^{[v/a]} = T;\\
        \tsbar{\Box_> \phi} &= T \text{ iff, for every } t > s, \tsbar{\phi} = T;\\
        \tsbar{\Box_< \phi} &= T \text{ iff, for every } t < s, \tsbar{\phi} = T.\\
\intertext{(The later-than relation on stages is given the obvious definition: $t > s =_{df} s < t$.)\\
%
Then, the defined operators:}
        \tsbar{\Box_\geq \phi} &= T \text{ iff, for every } t \geq s, \tsbar{\phi} = T;\\
        \tsbar{\Box_\leq \phi} &= T \text{ iff, for every } t \leq s, \tsbar{\phi} = T;\\
        \tsbar{\Box \phi} &= T \text{ iff, for every } t \leq s \vee s \leq t, \tsbar{\phi} = T.
\end{align*}
\end{document}

The desired formatting (the one produced by the second attempt in the MWE, the one with the alignment character error) is as follows:

enter image description here

How can I get this accomplished?

Tags : spacing align


Answers 3


\\ is defined for the alignment, but you can use \newline

\intertext{(The later-than relation on stages is given the obvious definition: $t > s =_{df} s < t$.)\newline
%
Then, the defined operators:}

(But you get a terrible line break with the text width in the MWE, just before the forced break)

enter image description here

David Carlisle
David Carlisle
November 29, 2015 23:30 PM

An alternative solution (with desired indent and vertical space between lines in the inter text):

    \documentclass{article}
    \usepackage{amsmath,mathtools,amssymb}
    \DeclarePairedDelimiter{\sbar}{\lvert}{\rvert}
    \newcommand{\tsbar}[1]{\sbar{#1}^\sigma_s}

\begin{document}
    For this first one, I can't figure out an appropriate width for the parbox and I can't figure out how to indent the second line of text (neither the indent command nor an hspace works).
        \begin{align*}
    \tsbar{\phi x_1,\dots,v_k} 
        &= T \text{ iff } \langle \sigma(v_1),\dots,\sigma(v_k) \rangle \in \sbar{\phi}_s;\\
    \tsbar{\lnot \phi} 
        &= T \text{ iff } \tsbar{\phi} \neq T;\\
    \tsbar{\phi \rightarrow \psi} 
        &= T \text{ iff } \tsbar{\phi}\neq T \text{ or } \tsbar{\psi}=T;\\
    \tsbar{\forall x \phi} 
        &= T \text{ iff, for every } a\in D_s,\ \sbar{\phi}^{[v/a]} = T;\\
    \tsbar{\Box_> \phi} 
        &= T \text{ iff, for every } t > s, \tsbar{\phi} = T;\\
    \tsbar{\Box_< \phi} 
        &= T \text{ iff, for every } t < s, \tsbar{\phi} = T.\\
    \intertext{(Later-than is given the obvious definition: $t > s =_{df} s < t$.)
        \smallskip\newline
        \hspace*{\parindent}
               Then, the defined operators:}
    \tsbar{\Box_\geq \phi}  
        & = T \text{ iff, for every } t \geq s, \tsbar{\phi} = T;\\
    \tsbar{\Box_\leq \phi}  
        & = T \text{ iff, for every } t \leq s, \tsbar{\phi} = T;\\
    \tsbar{\Box \phi}       
        & = T \text{ iff, for every } t \leq s \vee s \leq t, \tsbar{\phi} = T.
        \end{align*}
    \end{document}

enter image description here

Edit: Before David Carlisle comment I was not aware of \endgraf. By it can be rude solution:

        \smallskip\newline
        \hspace*{\parindent}

replaced by simple

        \endgraf
Zarko
Zarko
November 29, 2015 23:35 PM

I'd use \linewidth for the width of the \parbox. There is a small catch: the macro called by align (or the *-variant thereof) doesn't accept \par inside it, so you can't use \par (or a blank line) for ending paragraphs in the \longintertext macro I suggest. A workaround is to use \endgraf.

\documentclass{article}
\usepackage{amsmath,mathtools,amssymb}
\DeclarePairedDelimiter{\sbar}{\lvert}{\rvert}

\newcommand{\tsbar}[1]{\sbar{#1}^\sigma_s}

\newlength{\normalparindent}
\AtBeginDocument{\setlength{\normalparindent}{\parindent}}
\newcommand{\longintertext}[1]{%
  \intertext{%
    \parbox{\linewidth}{%
      \setlength{\parindent}{\normalparindent}
      \noindent#1%
    }%
  }%
}

\begin{document}

For this first one, I can't figure out an appropriate width for the parbox and I can't figure out how 
to indent the second line of text (neither the indent command nor an hspace works).
\begin{align*}
        \tsbar{\phi x_1,\dots,v_k} &= T \text{ iff } \langle \sigma(v_1),\dots,\sigma(v_k) \rangle \in \sbar{\phi}_s;\\
        \tsbar{\lnot \phi} &= T \text{ iff } \tsbar{\phi} \neq T;\\
        \tsbar{\phi \rightarrow \psi} &= T \text{ iff } \tsbar{\phi}\neq T \text{ or } \tsbar{\psi}=T;\\
        \tsbar{\forall x \phi} &= T \text{ iff, for every } a\in D_s,\ \sbar{\phi}^{[v/a]} = T;\\
        \tsbar{\Box_> \phi} &= T \text{ iff, for every } t > s, \tsbar{\phi} = T;\\
        \tsbar{\Box_< \phi} &= T \text{ iff, for every } t < s, \tsbar{\phi} = T.\\
\longintertext{%
  (Later-than is given the obvious definition: $t > s =_{df} s < t$.)\endgraf
  Then, the defined operators:
}
        \tsbar{\Box_\geq \phi} &= T \text{ iff, for every } t \geq s, \tsbar{\phi} = T;\\
        \tsbar{\Box_\leq \phi} &= T \text{ iff, for every } t \leq s, \tsbar{\phi} = T;\\
        \tsbar{\Box \phi} &= T \text{ iff, for every } t \leq s \vee s \leq t, \tsbar{\phi} = T.
\end{align*}
\end{document}

enter image description here

egreg
egreg
November 29, 2015 23:54 PM

Related Questions


Remove vertical space around align equations

Updated April 09, 2015 21:09 PM

how to align words?

Updated August 08, 2015 18:10 PM

What could make align use so much spacing?

Updated May 05, 2015 21:10 PM


Remove vertical space around align

Updated December 31, 2016 08:09 AM