我在论文中对定理(按章节)进行编号时遇到了问题。我的问题是,我希望对我的定理和命题进行编号,使它们看起来像这样:
定理3.1,命题3.1等。
但是,使用我当前的命令列表,我得到了以下结果:
定理31,命题31等等。
至少对于我输入的定理命令来说,它是尝试按部分编号定理时通常调用的命令,所以我有点困惑为什么会收到这个错误。
这是我的软件包和命令列表:
\documentclass[smallextended,referee]{svjour3}
\smartqed
\usepackage{graphicx}
\usepackage{epstopdf}% To incorporate .eps illustrations using PDFLaTeX, etc.
\usepackage{subfigure}% Support for small, `sub' figures and tables
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amscd}
\usepackage{epsfig}
\usepackage{amsfonts}
\usepackage{amsthm}
\usepackage{color}
\theoremstyle{plain}
\newtheorem{thm}{Theorem}[section]
\newtheorem{cor}[theorem]{Corollary}
\newtheorem{lem}[theorem]{Lemma}
\newtheorem{ntn}{Notations}[section]
\newtheorem{pro}{Proposition}[section]
\newtheorem{dfn}{Definition}[section]
\newtheorem{as}{Assumption}[section]
\newtheorem{rem}{Remark}[section]
\newtheorem{ob}{Observation}[section]
\renewcommand{\thefigure}{\arabic{section}.\arabic{figure}}
\renewcommand{\theequation}{\arabic{section}.\arabic{equation}}
\def\div{\mathop{\rm div}}
\def\D{\mathop{\bf \rm D}}
\def\FP{\mathop{\rm p}}
\def\Span{\mathop{\rm Span}}
\def\boldalpha{\mbox{\boldmath $\alpha$}}
\def\boldpi{\mbox{\boldmath $\pi$}}
\def\boldzeta{\mbox{\boldmath $\zeta$}}
\def\boldtheta{\mbox{\boldmath $\theta$}}
\begin{document}
\section{Solution}\label{Solution}
\begin{lem}\label{conditions}
Words for lemma
\end{lem}
\begin{thm}\label{mainthm}
Words for theorem
\end{thm}
\begin{rem}\label{remone}
Words for remark
\end{rem}
\section{Analysis}\label{Analysis}
\begin{pro}\label{observation}
Words for proposition
\end{pro}
\begin{rem}\label{remtwo}
Words for remark
\end{rem}
\begin{thm}\label{secondthm}
Words for remark
\end{thm}
\begin{pro}\label{proposition}
Words for proposition
\end{pro}
\end{document}
答案1
应该使用类来定义类似定理的环境svjour3
,方法是使用
\spnewtheorem
而不是\newtheorem
。你应该这样做:
\documentclass[smallextended,referee,envcountsect]{svjour3}
\usepackage{amsmath}
\usepackage{bm}
\smartqed
\journalname{foo}
% Theorem-like environments are defined with \spnewtheorem
%
% Usage:
%
% \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{thm}{Theorem}[section]{\bfseries}{\itshape}
\spnewtheorem{cor}[theorem]{Corollary}{\bfseries}{\itshape}
\spnewtheorem{lem}[theorem]{Lemma}{\bfseries}{\itshape}
\spnewtheorem{ntn}{Notations}[section]{\bfseries}{\itshape}
\spnewtheorem{pro}{Proposition}[section]{\bfseries}{\itshape}
\spnewtheorem{dfn}{Definition}[section]{\bfseries}{\itshape}% maybe \upshape?
\spnewtheorem{as}{Assumption}[section]{\bfseries}{\itshape}
\spnewtheorem{rem}{Remark}[section]{\bfseries}{\itshape}
\spnewtheorem{ob}{Observation}[section]{\bfseries}{\itshape}
\DeclareMathOperator{\Div}{div} % \div is already defined
\DeclareMathOperator{\D}{\mathbf{D}}
\DeclareMathOperator{\FP}{p}
\DeclareMathOperator{\Span}{Span}
\newcommand{\boldalpha}{\bm{\alpha}}
\newcommand{\boldpi}{\bm{\pi}}
\newcommand{\boldzeta}{\bm{\zeta}}
\newcommand\boldtheta{\bm{\theta}}
\begin{document}
\section{Solution}\label{Solution}
\begin{lem}\label{conditions}
Words for lemma
\end{lem}
\begin{thm}\label{mainthm}
Words for theorem
\end{thm}
\begin{rem}\label{remone}
Words for remark
\end{rem}
\section{Analysis}\label{Analysis}
\begin{pro}\label{observation}
Words for proposition
\end{pro}
\begin{rem}\label{remtwo}
Words for remark
\end{rem}
\begin{thm}\label{secondthm}
Words for remark
\end{thm}
\begin{pro}\label{proposition}
Words for proposition
\end{pro}
\end{document}
请注意,我只留下了示例运行所需的包。还请注意我如何以正确的方式重新定义您的个人命令:特别是,不重新定义您不知道的命令(\div
在本例中为)。
关于您在示例中加载的包:
amsfonts
已经加载amssymb
amsthm
不兼容svjour3
epsfig
不能在新文档中加载(这只是为了向后兼容)subfigure
已经过时 10 多年了,请致电\usepackage[caption=false]{subfig}
相反,
\subfigure
命令变成\subfloat
。
关于定理编号:为各种陈述设置单独的计数器会不必要地给读者带来混淆,当读者引用时会很难找到陈述:引理 1.1 是在命题 1.1 之前还是之后?
答案2
其实我已经尝试过的解决方案egreg
,然后发现你不需要创建命令\spnewtheorem{xx}{XX}[section]
envcountsect
课堂上的选项 svjour3
确实有帮助。
\documentclass[envcountsect]{svjour3}
如果您查看文件svjour.cls
并搜索\spnewtheorem{theorem}{Theorem}
,大约在第 888 行,您会发现类似@envcntsect
按部分编号的先决条件之类的内容。
然后你只需使用
\begin{theorem}
your theorem here.
\end{theorem}
包装你的定理。证明、引理、定义、案例……同样如此。
答案3
你应该使用 \documentclass[natbib,smallextended, envcountsect]{svjour3}