我想根据附图将定理编号为定理 I、定理 II、定理 III 等,但我无法在代码中修复它。这是我的乳胶代码:
\documentclass[journal]{journal}
\usepackage[cmex10]{amsmath}
\newtheorem{theorem}{Theorem}[section]
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{example}[theorem]{Example}
\newtheorem{definition}[theorem]{Definition}
这是pdf文件的图片:
答案1
尝试一下这个模板。
当你创建一个新的环境定理时
\newtheorem{<environment name>}{<heading>}
将创建一个与环境同名的计数器。例如
\newtheorem{definition}{Definition}
将创建计数器definition
并使用以下命令:
\renewcommand{\thedefinition}{\Roman{definition}}
示例将用罗马数字编号。
每个环境将在整个文档中连续编号(I,II,III,IV......),而不管其他环境如何。
% !TeX TS-program = pdflatex
\documentclass[journal]{journal}
%% \newtheorem{<environment name>}{<heading>} a counter with the same name of the enviroment will be created
\newtheorem{theorem}{Theorem}
\renewcommand{\thetheorem}{\Roman{theorem}} % Use Roman numbering
\newtheorem{definition}{Definition}
\renewcommand{\thedefinition}{\Roman{definition}}
\newtheorem{example}{Example}
\renewcommand{\theexample}{\Roman{example}}
\begin{document}
\section{Definitions}
\begin{definition}
Given two line segments whose lengths are \(a\) and \(b\) respectively there is a
real number \(r\) such that \(b=ra\).
\end{definition}
\begin{definition}
Given two line segments whose lengths are \(a\) and \(b\) respectively there is a
real number \(r\) such that \(b=ra\).
\end{definition}
\section{Theorems}
\begin{theorem}
This is a theorem about right triangles and can be summarised in the next
equation
\[ x^2 + y^2 = z^2 \]
\end{theorem}
\begin{theorem}
This is a theorem about right triangles and can be summarised in the next
equation
\[ x^2 + y^2 = z^2 \]
\end{theorem}
\begin{theorem}
This is a theorem about right triangles and can be summarised in the next
equation
\[ x^2 + y^2 = z^2 \]
\end{theorem}
\section{Examples}
\begin{example}
There's no right rectangle whose sides measure 3cm, 4cm, and 6cm.
\end{example}
\begin{example}
There's no right rectangle whose sides measure 3cm, 4cm, and 6cm.
\end{example}
\section{Final}
\begin{theorem}
This is a theorem about right triangles and can be summarised in the next
equation
\[ x^2 + y^2 = z^2 \]
\end{theorem}
\begin{example}
There's no right rectangle whose sides measure 3cm, 4cm, and 6cm.
\end{example}
\end{document}