
我想將某些枚舉列表與我顯示的方程式放在同一個計數器上。誰能建議我如何做到這一點?
接近下面的最小工作範例。
\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
以下端口坎帕指出的答案使用套件\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))