
我想使用 (i) 、 (ii) 等為引理建立編號,如以下螢幕截圖中突出顯示的黃色所示。
然後,我創建的程式碼如下。
\documentclass[journal]{IEEEtran}
\newtheorem{lemma}{Lemma}
\begin{document}
\begin{lemma}\label{lemma:min_req_time}
The new sequence has following properties.
\renewcommand{\labelenumi}{\Roman{enumi}}
\begin{enumerate}
\item The minimum required time of the robot operation is $(n-1)w + nv$ in between the processing and cleaning states, including vice versa, of every step.
\item In addition, the minimum required time of the robot operation is $(n+1)w + (n+2)v$ after finishing the processing or cleaning for the first time and repeating the same cycle for the next cleaning or processing.
\end{enumerate}
\end{lemma}
\end{document}
Tex Live 2022 的背頁結果如下。
誰能建議需要對程式碼進行哪些修改才能獲得 (i)、(ii) 等的編號樣式?
謝謝。
答案1
我建議使用該enumitem
包,因為(在我看來)它提供了一種重新定義標籤的更清晰的方式。此外,它允許以相同的格式列印參考文獻。看看下面的例子沒有 enumitem
:
\documentclass[journal]{IEEEtran}
\begin{document}
\renewcommand{\labelenumi}{(\roman{enumi})}
\noindent The new sequence has following properties.
\begin{enumerate}
\item The minimum\ldots\label{item:one}
\item In addition\ldots\label{item:two}
\end{enumerate}
Here are references to \ref{item:one} and \ref{item:two}.
\end{document}
這會產生
如果使用上面的包,我們可以實現以下功能:
\documentclass[journal]{IEEEtran}
\usepackage{enumitem} % <- load enumitem
\begin{document}
%\renewcommand{\labelenumi}{(\roman{enumi})} % <- not needed anymore
\noindent The new sequence has following properties.
\begin{enumerate}[label=(\roman*)] % <- specify label format
\item The minimum\ldots\label{item:one}
\item In addition\ldots\label{item:two}
\end{enumerate}
Here are references to \ref{item:one} and \ref{item:two}. % <- produce matching references
\end{document}
如果您不希望引用看起來像標籤,這也沒有問題,因為您可以指定ref
:使用例如,您將得到像,\begin{enumerate}[label=(\roman*),ref=[\alph*-]
一樣的標籤,但像,一樣的引用(不知道為什麼您應該想要這個,但這是可能的)。(i)
(ii)
[a-
[b-
\setlist[enumerate]{label=(\roman*)}
如果您放入序言,也可以在全球範圍內進行這些變更。
答案2
我建議你改變
\renewcommand{\labelenumi}{\Roman{enumi}}
到
\renewcommand{\labelenumi}{(\roman{enumi})}
如果您只想變更一種環境的編號樣式lemma
,請在 後面執行指令\begin{lemma}
。如果您希望變更適用於全部 enumerate
環境,請務必執行文件序言中的指令。
\documentclass[journal]{IEEEtran}
\newtheorem{lemma}{Lemma}
\usepackage{newtxmath} % Times Roman math font (optional)
\begin{document}
\begin{lemma}\label{lemma:min_req_time}
\renewcommand{\labelenumi}{(\roman{enumi})}
The new sequence has following properties.
\begin{enumerate}
\item The minimum required time of the robot operation is $(n-1)w + nv$ in between the processing and cleaning states, including vice versa, of every step.
\item In addition, the minimum required time of the robot operation is $(n+1)w + (n+2)v$ after finishing the processing or cleaning for the first time and repeating the same cycle for the next cleaning or processing.
\item \dots\dots
\item \dots\dots
\item \dots\dots
\item \dots\dots
\item \dots\dots
\end{enumerate}
\end{lemma}
\end{document}