在 Springer 模板中更改定理计数器

在 Springer 模板中更改定理计数器

我使用 Springer 模板来写我的书,更具体地说,我使用了 svmono。

这是 MWE,它是我的模板文件的缩短版本。

  \documentclass[graybox,envcountsec,sectrefs,vecarrow,envcountresetsect]{svmono}
  \usepackage[utf8]{inputenc}
  \usepackage[vietnam]{babel}
  \usepackage{savesym}
  \usepackage{mathptmx}
  \savesymbol{hbar}
  \usepackage{helvet}
  \usepackage{courier}
  \usepackage{type1cm}           
  \usepackage{fouriernc}
  \usepackage{esvect}   
  \let\remark\relax
  \let\endremark\relax
  \renewcommand{\thesection}{\arabic{section}.}
  \renewcommand\definitionname{Định nghĩa}
  \spnewtheorem*{remark}{Remark}{\itshape}{\rmfamily}
  \renewcommand\remarkname{Chú ý}
  \renewcommand\lemmaname{Bổ đề}
  \begin{document}
  \chapter{The direction of a segment}
  \section{Some basics definition}
  \begin{definition}
  That is definition
  \end{definition}
  \begin{theorem}
  This is theorem. 
  \end{theorem}
  \begin{remark}
  This is remark
  \end{remark}
  \begin{lemma}
  this is lemma
  \end{lemma}
  \end{document}

我想像第一章那样对章节进行编号,而不是像此模板中那样对第 1 章进行编号。我还想按节对定理、定义、注释、引理进行编号,即定理 2.1(第 2 节中的第一个定理),下一个环境(定义、引理,..)将是定义 2.2,..即在节中对每个环境(证明环境除外)使用相同的计数器?

但是我该如何更改模板来实现这一点呢?请帮帮我。

答案1

这是一种可能性。使用 中的预定义结构svmono.cls,没有简单的方法可以更改计数器。您有两种可能性:

  1. 使用所需的编号模式定义新结构,如下面我所说明的定义、引理和定理:

    \documentclass[graybox,sectrefs,vecarrow,envcountresetsect]{svmono}
      \usepackage[utf8]{inputenc}
      \usepackage[vietnam]{babel}
      \usepackage{savesym}
      \usepackage{mathptmx}
      \savesymbol{hbar}
      \usepackage{helvet}
      \usepackage{courier}
      \usepackage{type1cm}           
      \usepackage{fouriernc}
      \usepackage{esvect}   
      \usepackage{chngcntr}   
    % chapter numbering in Roman numerals
      \renewcommand{\thechapter}{\Roman{chapter}}
    % section numbering arabic, without chapter counter
      \renewcommand{\thesection}{\arabic{section}}
      \renewcommand\definitionname{Định nghĩa}
    
      \let\remark\relax
      \let\endremark\relax
    
    \spnewtheorem*{remark}{Remark}{\itshape}{\rmfamily}
    \spnewtheorem{theo}{Theorem}[section]{\bfseries}{\itshape}
    \spnewtheorem{lemm}[theo]{Lemma}{\bfseries}{\itshape}
    \spnewtheorem{defi}[theo]{Definition}{\bfseries}{\itshape}
    
    
      \renewcommand\remarkname{Chú ý}
      \renewcommand\lemmaname{Bổ đề}
    
    \usepackage{titlesec}
    % Add a period after the section number
    \titleformat{\section}
      {\normalfont\large\bfseries}{\thesection.}{0.4em}{}
    
    % counters within section counter
      \counterwithin{definition}{section}
      \counterwithin{theorem}{section}
      \counterwithin{lemma}{section}
    
      \begin{document}
      \chapter{The direction of a segment}
      \section{Some basics definition}
      \begin{defi}
      That is definition
      \end{defi}
      \begin{theo}
      This is theorem. 
      \end{theo}
      \begin{remark}
      This is remark
      \end{remark}
      \begin{lemm}
      this is lemma
      \end{lemm}
      \end{document}
    

在此处输入图片描述

  1. 如果由于某种原因,新的结构是不可能的(也许您已经编写了大量文本),那么您可以首先消灭原始定义(通过\let将相应的宏设置为\relax),然后使用所需的编号模式创建新的定义:

    \documentclass[graybox,sectrefs,vecarrow,envcountresetsect]{svmono}
      \usepackage[utf8]{inputenc}
      \usepackage[vietnam]{babel}
      \usepackage{savesym}
      \usepackage{mathptmx}
      \savesymbol{hbar}
      \usepackage{helvet}
      \usepackage{courier}
      \usepackage{type1cm}           
      \usepackage{fouriernc}
      \usepackage{esvect}   
      \usepackage{chngcntr}   
    % chapter numbering in Roman numerals
      \renewcommand{\thechapter}{\Roman{chapter}}
    % section numbering arabic, without chapter counter
      \renewcommand{\thesection}{\arabic{section}}
      \renewcommand\definitionname{Định nghĩa}
    
      \let\remark\relax
      \let\endremark\relax
      \let\definition\relax
      \let\enddefinition\relax
      \let\lemma\relax
      \let\endlemma\relax
      \let\theorem\relax
      \let\endtheorem\relax
    
    \spnewtheorem*{remark}{Remark}{\itshape}{\rmfamily}
    \spnewtheorem{theorem}{Theorem}[section]{\bfseries}{\itshape}
    \spnewtheorem{lemma}[theorem]{Lemma}{\bfseries}{\itshape}
    \spnewtheorem{definition}[theorem]{Definition}{\bfseries}{\itshape}
    
      \renewcommand\remarkname{Chú ý}
      \renewcommand\lemmaname{Bổ đề}
    
    \usepackage{titlesec}
    % Add a period after the section number
    \titleformat{\section}
      {\normalfont\large\bfseries}{\thesection.}{0.4em}{}
    
    % counters within section counter
      \counterwithin{definition}{section}
      \counterwithin{theorem}{section}
      \counterwithin{lemma}{section}
    
      \begin{document}
      \chapter{The direction of a segment}
      \section{Some basics definition}
      \begin{definition}
      That is definition
      \end{definition}
      \begin{theorem}
      This is theorem. 
      \end{theorem}
      \begin{remark}
      This is remark
      \end{remark}
      \begin{lemma}
      this is lemma
      \end{lemma}
      \end{document}
    

答案2

您不需要任何新包。只需重新定义定理环境:

\documentclass[
  graybox,envcountsec,sectrefs,
  vecarrow,envcountresetsect
]{svmono}

\usepackage[utf8]{inputenc}
\usepackage[vietnam]{babel}

\usepackage{fouriernc}

%%% chapters will have a Roman number
\renewcommand{\thechapter}{\Roman{chapter}}
\renewcommand{\thesection}{\arabic{section}.}

%%% remove the predefined environments
\let\remark\relax
\let\theorem\relax
\let\lemma\relax
\let\definition\relax

%%% redefine the theorem environments
\spnewtheorem{theorem}{Theorem}[section]{\bfseries}{\itshape}
\renewcommand\thetheorem{\thesection\arabic{theorem}}
\spnewtheorem{lemma}[theorem]{Lemma}{\bfseries}{\itshape}
\spnewtheorem{definition}[theorem]{Definition}{\bfseries}{\upshape}

\spnewtheorem*{remark}{Remark}{\itshape}{\rmfamily}

%\renewcommand\theoremname{???}
\renewcommand\lemmaname{Bổ đề}
\renewcommand\definitionname{Định nghĩa}
\renewcommand\remarkname{Chú ý}


\begin{document}

\chapter{The direction of a segment}
\section{Some basics definition}
\begin{definition}
That is definition
\end{definition}
\begin{theorem}
This is theorem. 
\end{theorem}
\begin{remark}
This is remark
\end{remark}
\begin{lemma}
this is lemma
\end{lemma}
\end{document}

在此处输入图片描述

相关内容