我想用它llncs.cls
来做一本书。但我把
\numberwithin{equation}{section}
\newtheorem{theorem1}{Theorem}[section]
\newtheorem{lem}[theorem1]{Lemma}
\newtheorem{thm}[theorem1]{Theorem}
\newtheorem{pro}[theorem1]{Proposition}
\newtheorem{cor}[theorem1]{Corollary}
\newtheorem{defi}[theorem1]{Definition}
\newtheorem{rem}[theorem1]{Remark}
\newtheorem{exa}[theorem1]{Example}
在头部,定理编号中的点丢失了。例如,在第 2 节中,第一个定理应该是定理 2.1,但我得到的是定理 21。如何修复?
多谢!
答案1
该类llncs
不鼓励添加另一个计数器作为前缀,例如用于节的计数器。如果您更改此设置,Springer 很可能会放弃此更改。
话虽这么说,你可以使用
\numberwithin{theorem1}{section}
后定义theorem1
:
\documentclass{llncs}
\usepackage{amsmath}
\newtheorem{theorem1}{Theorem}[section]
\numberwithin{theorem1}{section}
\newtheorem{lem}[theorem1]{Lemma}
\newtheorem{thm}[theorem1]{Theorem}
\newtheorem{pro}[theorem1]{Proposition}
\newtheorem{cor}[theorem1]{Corollary}
\newtheorem{defi}[theorem1]{Definition}
\newtheorem{rem}[theorem1]{Remark}
\newtheorem{exa}[theorem1]{Example}
\begin{document}
\section{Test}
\begin{theorem1}
Test theorem
\end{theorem1}
\begin{pro}
Test proposition
\end{pro}
\end{document}
结果:
另外,请注意,该类通过它自己的方式处理定理类结构\spnewtheorem
,因此您可以更好地使用
\documentclass{llncs}
\usepackage{chngcntr}
\spnewtheorem{theorem1}{Theorem}{\bfseries}{\itshape}
\counterwithin{theorem1}{section}
\spnewtheorem{lem}[theorem1]{Lemma}{\bfseries}{\itshape}
\spnewtheorem{thm}[theorem1]{Theorem}{\bfseries}{\itshape}
\spnewtheorem{pro}[theorem1]{Proposition}{\bfseries}{\itshape}
\spnewtheorem{cor}[theorem1]{Corollary}{\bfseries}{\itshape}
\spnewtheorem{defi}[theorem1]{Definition}{\bfseries}{\itshape}
\spnewtheorem{rem}[theorem1]{Remark}{\bfseries}{\itshape}
\spnewtheorem{exa}[theorem1]{Example}{\bfseries}{\itshape}
\begin{document}
\section{Test}
\begin{theorem1}
Test theorem
\end{theorem1}
\begin{pro}
Test proposition
\end{pro}
\end{document}
完全符合llncs
风格:
特别注意计数器后的最后一个点(使用amsmath
and时不使用\newtheorem
)