![结合枚举和对齐在定理环境中有效,但在定理环境之外无效](https://linux22.com/image/314381/%E7%BB%93%E5%90%88%E6%9E%9A%E4%B8%BE%E5%92%8C%E5%AF%B9%E9%BD%90%E5%9C%A8%E5%AE%9A%E7%90%86%E7%8E%AF%E5%A2%83%E4%B8%AD%E6%9C%89%E6%95%88%EF%BC%8C%E4%BD%86%E5%9C%A8%E5%AE%9A%E7%90%86%E7%8E%AF%E5%A2%83%E4%B9%8B%E5%A4%96%E6%97%A0%E6%95%88.png)
我之前使用的是 MWE 1(运行良好),但现在我想摆脱定理环境(MWE 2)。但是,这不起作用,我收到以下错误。有什么想法可以让 MWE 2 正常工作吗?
错误
! LaTeX Error: Something's wrong--perhaps a missing \item
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
1.14 \end{align}
%
微波能量吸收 1
\documentclass{article}
\usepackage{amsmath,amsthm}
\newtheorem{theorem}{Theorem}[section]
\begin{document}%
\begin{theorem}%
\begin{enumerate}%
\begin{align}%
\intertext{\item Condition $A$}
a &= b
\intertext{\item Condition $B$}
c &= d
\end{align}%
\end{enumerate}%
\end{theorem}%
\end{document}%
微波辐射计 2
\documentclass{article}
\usepackage{amsmath,amsthm}
\newtheorem{theorem}{Theorem}[section]
\begin{document}%
\begin{enumerate}%
\begin{align}%
\intertext{\item Condition $A$}
a &= b
\intertext{\item Condition $B$}
c &= d
\end{align}%
\end{enumerate}%
\end{document}%
答案1
我不知道定理的最佳实践,但正常情况下,你至少需要一个\item
数学模式之外的定理。请看我的第二个示例,这是正确的语法。
% arara: pdflatex
\documentclass{article}
\usepackage{mathtools,amsthm}
\newtheorem{theorem}{Theorem}[section]
\begin{document}
\begin{theorem}
\begin{enumerate}
\begin{align}
\intertext{\item Condition $A$}
a &= b
\intertext{\item Condition $B$}
c &= d
\end{align}
\end{enumerate}
\end{theorem}
\begin{enumerate}
\item Condition $A$ % move this out from the align
\begin{align}
a &= b
\intertext{\item Condition $B$}
c &= d
\end{align}
\end{enumerate}
\end{document}
题外话:\shortintertext{}
在这里看起来会更好。
就我个人而言,我会这样做:
% arara: pdflatex
\documentclass{article}
\usepackage{mathtools,amsthm}
\newtheorem{theorem}{Theorem}[section]
\usepackage{enumitem}
\usepackage{blindtext}
\begin{document}
\blindtext
\begin{theorem}\leavevmode
\begin{enumerate}[labelindent=0pt,labelwidth=\widthof{Condition \textit{A}},label=Condition \Alph*,itemindent=4em,leftmargin=!]
\item
\begin{align}
a &= b
\shortintertext{\item\mbox}
c &= d
\end{align}
\end{enumerate}
\end{theorem}
\begin{enumerate}[labelindent=0pt,labelwidth=\widthof{Condition \textit{A}},label=Condition \Alph*,itemindent=4em,leftmargin=!]
\item
\begin{align}
a &= b
\shortintertext{\item\mbox}
c &= d
\end{align}
\end{enumerate}
\end{document}