如何在 align* 环境中拥有多行互文?

如何在 align* 环境中拥有多行互文?

因此,我有两组想要对齐的方程式,但它们被两行文本分开,其中第二行应该缩进。

MWE 与评论

\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}

所需的格式(MWE 中第二次尝试产生的格式,具有对齐字符错误的格式)如下:

在此处输入图片描述

我怎样才能实现这个目标?

答案1

我会使用\linewidth来表示 的宽度\parbox。有一个小问题:由 调用的宏align(或其 * 变体)不接受\par它内部的内容,因此您不能使用\par(或空白行)来结束\longintertext我建议的宏中的段落。一种解决方法是使用\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}

在此处输入图片描述

答案2

您可以使用两种可能性:

  • \intertext{text... \endgraf text...}(受到推崇的)
  • \intertext{text... \smallskip\newline\hspace*{\parindent} 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}

在此处输入图片描述

答案3

\\是为对齐定义的,但您可以使用\newline

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

(但是在强制换行之前,MWE 中的文本宽度会出现一个可怕的换行符)

在此处输入图片描述

相关内容