
我使用llncs
(不是文章!)作為\documentclass
包ams
。現在編號不起作用。它是可以簡單地使用\begin{theorem
} 並對我的定理 1,2,... 進行編號,但不能通過添加\newtheorem{mytheorem}{Theorem}[section]
and\begin{mytheorem}
來進行編號,因為這會產生諸如 11,12,21,22 之類的結果 - 沒有點。我顯然更喜歡 1.1 甚至 1.1.1。定理\renewcommand
只會導致TeX
愚蠢:錯誤,不存在。好吧,那麼\newcommand
:
錯誤,確實存在。 (要麼與 TeX 具有某種禪宗大師有關,要麼與 \newtheorem 有參數有關:-) MWE:
\documentclass[10pt,a4paper]{llncs}
\usepackage{amsmath}
\newtheorem{mytheorem}{Theorem}[section]
\begin{document}
\section{foo}
\begin{mytheorem}
\end{mytheorem}
\begin{theorem}
\end{theorem}
\section{bar}
\begin{mytheorem}
\end{mytheorem}
\begin{theorem}
\end{theorem}
\end{document}
答案1
該類別llncs
有自己的方法來定義類似定理的環境,使用\spnewtheorem
.
\documentclass[10pt,a4paper,envcountsect]{llncs}
\usepackage{amsmath}
% \spnewtheorem{env_nam}{caption}[within]{cap_font}{body_font}
% or \spnewtheorem{env_nam}[numbered_like]{caption}{cap_font}{body_font}
% or \spnewtheorem*{env_nam}{caption}{cap_font}{body_font}
\spnewtheorem{mytheorem}{Theorem}[section]{\bfseries}{\itshape}
\begin{document}
\section{foo}
\begin{mytheorem}
Some text.
\end{mytheorem}
\begin{theorem}
Some text.
\end{theorem}
\section{bar}
\begin{mytheorem}
Some text.
\end{mytheorem}
\begin{theorem}
Some text.
\end{theorem}
\end{document}