如何对齐 itemize 中不同项目中的方程式

如何对齐 itemize 中不同项目中的方程式

我想对齐align*环境中位于不同\item环境中的方程式itemize。这是我的 MWE:

\documentclass{article}

\usepackage{amsmath}

\begin{document}

\begin{itemize}
\item First item with equation:
   \begin{align*}
      a+b+c+d &= e,\\
      1+2+3+4 &= 5.
   \end{align*}
\item Second item without equation.
\item Third item with equation, that should be aligned with the equation
   of the first item:
   \begin{align*}
      x &= x, \\
      3 &= 3.
   \end{align*}
\end{itemize}

\end{document}

答案1

您可以\shortintertext使用mathtools

\documentclass{article}

\usepackage{amsmath,mathtools}

\begin{document}

\begin{itemize}
\item First item with equation:
   \begin{align*}
      a+b+c+d &= e,\\
      1+2+3+4 &= 5.\\
\shortintertext{%
  \item Second item without equation.
  \item Third item with equation, that should be aligned with the equation
   of the first item:%
}
      x &= x, \\
      3 &= 3.
   \end{align*}
\end{itemize}

\end{document}

在此处输入图片描述

答案2

可以使用 来完成\intertext。以下是 MWE:

\documentclass{article}

\usepackage{amsmath}

\begin{document}

\begin{itemize}
\item First item with equation:
   \begin{align*}
      a+b+c+d &= e,\\
      1+2+3+4 &= 5.
   \end{align*}
\item Second item without equation.
\item Third item with equation, that should be aligned with the equation
   of the first item:
   \begin{align*}
      x &= x, \\
      3 &= 3.
   \end{align*}
\end{itemize}

Some other test for seraration.

\begin{itemize}
\item First item with equation:
   \begin{align*}
      a+b+c+d &= e,\\
      1+2+3+4 &= 5.
\intertext{      
\item Second item without equation.
\item Third item with equation, that should be aligned with the equation
   of the first item:
}
      x &= x, \\
      3 &= 3.
   \end{align*}
\end{itemize}

\end{document}

得到以下结果:


上述 MWE 的输出


可以看到,遗憾的是,开头和结尾的空格\intertext似乎有点太大了。

相关内容