删除 amsbook 文档类中的尾随点并更改页码的位置

删除 amsbook 文档类中的尾随点并更改页码的位置

我正在尝试对 amsbook 文档类进行两项定制。

  1. 删除章节编号后面以及小节标题后面的尾随点。
  2. 页码的位置应始终位于页脚的中央。目前,它出现在每个章节/节的右上角,开头

关于1.我已经尝试过了

\renewcommand\thesection{\thechapter.\arabic{section}}
\renewcommand\thesubsection{\thesection.\arabic{subsection}}

无济于事。关于 2。我不确定从哪里开始定制它。

我正在使用 Texmaker 和 Miktex 2.9

如果有人能帮助我,我会非常高兴,这是我的论文中缺少的最后一部分。

我的 MWE 是

\documentclass[12pt,a4paper,oneside,final]{amsbook}
\usepackage{blindtext}

%Sprache
\usepackage[english]{babel}
\usepackage[T1]{fontenc}

%Zeichensatz
\usepackage[utf8]{inputenc}

%Images
\usepackage{graphicx}

%PDF Integrierung
\usepackage{pdfpages}

%Formatierung
\usepackage[left=3.5cm,right=2.5cm,top=2cm,bottom=2cm]{geometry}
\usepackage[onehalfspacing]{setspace}
\usepackage{booktabs}
\usepackage{tabularx}
\usepackage{makecell}

%diverses
\usepackage[section]{placeins}
\usepackage{lscape}
\usepackage{cite}

\usepackage[nomain,acronym,xindy]{glossaries}
\usepackage[xindy]{imakeidx}
\usepackage[labelsep=space]{caption}

\newcommand{\stoptocwriting}{%
  \addtocontents{toc}{\protect\setcounter{tocdepth}{-5}}}
\newcommand{\resumetocwriting}{%
  \addtocontents{toc}{\protect\setcounter{tocdepth}{\arabic{tocdepth}}}}

\newtheorem{thm}{Theorem}
\newcommand{\HRule}{\rule{\linewidth}{0.5mm}}

\numberwithin{equation}{chapter}
\numberwithin{figure}{chapter}
\numberwithin{table}{chapter}
\numberwithin{section}{chapter}

\begin{document}
\setcounter{secnumdepth}{2}
\setlength{\parindent}{0em}

\makeatletter
\def\l@figure{\@tocline{0}{3pt plus2pt}{0pt}{2.5pc}{}}
\def\l@table{\@tocline{0}{3pt plus2pt}{0pt}{2.5pc}{}}
\def\l@subsection{\@tocline{1}{0pt}{1.5pc}{5pc}{}}
\makeatother

\tableofcontents 

\chapter{Chapter}
\section{Section}
\subsection{Subsection}
\Blindtext
\stoptocwriting
\subsection*{Subsection without number}
\Blindtext
\resumetocwriting

\end{document}

答案1

句号未插入\thesection且类似。

在下面的代码中我只留下了相关的部分。

\documentclass[12pt,a4paper,oneside,final]{amsbook}
\usepackage{etoolbox}

\usepackage{blindtext}

\numberwithin{section}{chapter}
\makeatletter
% remove the period from the toc
\renewcommand{\tocsection}[3]{%
  \indentlabel{\@ifnotempty{#2}{\ignorespaces#1 #2\quad}}#3} % was #2.\quad
\let\tocchapter\tocsection
\let\tocsubsection\tocsection
\let\tocparagraph\tocsection
\let\tocsubparagraph\tocsection
% remove the period from the section numbers
\renewcommand\@seccntformat[1]{%
  \protect\textup{\protect\@secnumfont
    \csname the#1\endcsname
    \protect\enspace % was \@secnumpoint
  }%
}
% remove the period after the titles
\patchcmd{\@sect}{\@addpunct.}{}{}{}
% fix the page style
\def\ps@headings{\ps@empty
  \def\@evenhead{%
    \setTrue{runhead}%
    \normalfont\scriptsize
    \hfil % <---- was \rlap{\thepage}\hfil
    \def\thanks{\protect\thanks@warning}%
    \leftmark{}{}\hfil}%
  \def\@oddhead{%
    \setTrue{runhead}%
    \normalfont\scriptsize \hfil
    \def\thanks{\protect\thanks@warning}%
    \rightmark{}{}\hfil}% <--- was \hfil\llap{\thepage}
  % taken from \ps@plain
  \def\@oddfoot{\normalfont\scriptsize \hfil\thepage\hfil}%
  \let\@evenfoot\@oddfoot
  %
  \let\@mkboth\markboth
  \def\partmark{\@secmark\markboth\partrunhead\partname}%
  \def\chaptermark{%
    \@secmark\markboth\chapterrunhead{}}%
  \def\sectionmark{%
    \@secmark\markright\sectionrunhead\sectionname}%
}
\makeatother
\pagestyle{headings} % set the default style

\begin{document}

\tableofcontents 

\chapter{Chapter}
\section{Section}
\subsection{Subsection}
\Blindtext

\end{document}

在此处输入图片描述

相关内容