当我的章节长度超过 1 页时,页码将从左上角开始

当我的章节长度超过 1 页时,页码将从左上角开始

我有这个目录的新模板,但是当我的章节超过 1 页时,后面的页面的页码会显示在顶部。有什么办法可以将其改为底部吗?另外,我的章节名称显示在页面顶部,我还不想删除它,但是如果您能告诉我哪个命令在执行此操作,那就太好了。

\documentclass[11pt, openany]{book}
\usepackage[dutch]{babel}
\usepackage{amsmath}
\usepackage{xcolor}
\usepackage{framed}
\usepackage{titletoc}
\usepackage{etoolbox}
\usepackage{lmodern}
\definecolor{myred}{RGB}{127,0,0}
\definecolor{myyellow}{RGB}{169,121,69}
\patchcmd{\tableofcontents}{\contentsname}{\sffamily\contentsname}{}{}

\usepackage{xcolor}
\usepackage{framed}

\definecolor{myred}{RGB}{127,0,0}
\definecolor{myyellow}{RGB}{169,121,69}

%\renewenvironment{leftbar}{%
%  \def\FrameCommand{{\color{myyellow}\vrule width 2pt depth 6pt} \hspace{10pt}}%
%  \MakeFramed {\advance\hsize-\width \FrameRestore}}%
% {\endMakeFramed}

\makeatletter
\def\@chapter[#1]#2{\ifnum \c@secnumdepth >\m@ne
                       \if@mainmatter
                         \refstepcounter{chapter}%
                         \typeout{\@chapapp\space\thechapter.}%
                         \addtocontents{toc}%
                                   {%
                                       {\noindent\protect\parbox{3.8em}{\hfill\Huge\color{myred}\bfseries\thepage}}%
                                         \protect\hspace*{.5em}%
                                        \protect\parbox{\dimexpr\linewidth-4.5em\relax}{%
                                           \protect\begin{leftbar}
                                              {\scshape\small\chaptername~\thechapter}\\\sffamily#1%
                                           \protect\end{leftbar}}\par%\noindent
                                    }%
                       \else
                         \addcontentsline{toc}{chapter}{#1}%
                       \fi
                    \else
                      \addcontentsline{toc}{chapter}{#1}%
                    \fi
                    \chaptermark{#1}%
                    \addtocontents{lof}{\protect\addvspace{10\p@}}%
                    \addtocontents{lot}{\protect\addvspace{10\p@}}%
                    \if@twocolumn
                      \@topnewpage[\@makechapterhead{#2}]%
                    \else
                      \@makechapterhead{#2}%
                      \@afterheading
                    \fi}
\makeatother
\usepackage{graphicx}
\usepackage[margin=2cm, paperwidth=210mm, paperheight=297mm]{geometry}
\begin{document}
\renewenvironment{leftbar}
  {\def\FrameCommand{\hspace{6em}%
    {\color{myyellow}\vrule width 2pt depth 6pt}\hspace{1em}}%
    \MakeFramed{\parshape 1 0cm \dimexpr\textwidth-6em\relax\FrameRestore}\vskip2pt%
  }
 {\endMakeFramed}

\titlecontents{section}
  [8.4em]
  {\sffamily\contentslabel{3em}}{}{}
  {\hspace{0.5em}\nobreak\itshape\color{myred}\contentspage}
\titlecontents{subsection}
  [8.4em]
  {\sffamily\contentslabel{3em}}{}{}  
  {\hspace{0.5em}\nobreak\itshape\color{myred}\contentspage}

\tableofcontents
\newpage

\pagenumbering{arabic}

\chapter {one}
hello
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
\end{document}

答案1

只需添加

\pagestyle{plain}

你的序言:

在此处输入图片描述

相关内容