![将枚举列表放在方程计数器上](https://linux22.com/image/475685/%E5%B0%86%E6%9E%9A%E4%B8%BE%E5%88%97%E8%A1%A8%E6%94%BE%E5%9C%A8%E6%96%B9%E7%A8%8B%E8%AE%A1%E6%95%B0%E5%99%A8%E4%B8%8A.png)
我想将某些枚举列表放在与显示的方程式相同的计数器上。有人能建议我该怎么做吗?
接近下面的最小工作示例。
\documentclass{amsart}
\usepackage{enumitem}
\renewcommand{\baselinestretch}{1.3}
\parskip=5pt
\parindent=0pt
\numberwithin{equation}{section}
\begin{document}
\section{My section}
\subsection{My subsection}
This is an equation that I want to display:
\begin{equation}\label{first}
\mbox{An equation I want to display.}
\end{equation}
I like to be able to refer to \eqref{first}.
Sometimes I like to make normal enumerated lists.
\begin{enumerate}
\item So interesting.
\item Also interesting.
\end{enumerate}
But sometimes, I like to make an enumerated lists that formatted the same way as displayed equations.
\begin{enumerate}
\item \label{second} First enumerated fact.
\item \label{third} Second enumerated fact.
\item \label{fourth} Third enumerated fact.
\end{enumerate}
And then I want to refer to \eqref{third} the same way that I refer to \eqref{first}.
\end{document}
我希望能够进行设置,以便第二个列表中的条目标记为 (1.2)、(1.3)、(1.4),样式与显示的方程 (1.1) 相同。
答案1
以下端口campa 指出的答案使用包\newlist
定义的公式enumitem
,因此将与其间距命令兼容,如下所示OP 的请求。
\documentclass{amsart}
\usepackage{enumitem}
\newlist{eqenum}{enumerate}{1}
\setlist[eqenum]{before=\setcounter{eqenumi}{\value{equation}},after=\setcounter{equation}{\value{eqenumi}},label=(\thesection.\arabic*),ref=\thesection.\arabic*}
\renewcommand{\baselinestretch}{1.3}
\parskip=5pt
\parindent=0pt
\numberwithin{equation}{section}
\begin{document}
\section{My section}
\subsection{My subsection}
This is an equation that I want to display:
\begin{equation}\label{first}
\mbox{An equation I want to display.}
\end{equation}
I like to be able to refer to \eqref{first}.
Sometimes I like to make normal enumerated lists.
\begin{enumerate}
\item So interesting.
\item Also interesting.
\end{enumerate}
But sometimes, I like to make an enumerated lists that formatted the same way as displayed equations.
\begin{eqenum}
\item \label{second} First enumerated fact.
\item \label{third} Second enumerated fact.
\item \label{fourth} Third enumerated fact.
\end{eqenum}
And then I want to refer to \eqref{third} the same way that I refer to \eqref{first}.
\end{document}
笔记:
- 该语句
\newlist{eqenum}{enumerate}{1}
告诉enumitem
创建一个只能在第一级使用的新枚举列表(不能嵌套)。 - 的
before
和after
键enumitem
可用于将equation
计数器复制到用于列表的计数器eqenum
,反之亦然。之后,我仅使用label
和ref
键来设置标签的外观。这两个应该分开设置,因为我假设您希望标签显示为(1.3)
并且希望\eqref{third}
显示(1.3)
而不是((1.3))
。