
Я хотел бы создать нумерацию для леммы, используя (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}