将整个文档的页码置于右下角

将整个文档的页码置于右下角

我在用简单的论文模板来写我的论文。在 Thesis.cls 文件中,它是这样写的,\def\baseclass{book}我猜它使用书籍类作为基础类。

我使用单面页。

我有 \frontmatter、\mainmatter 和 \backmatter。

\frontmatter 以罗马风格处理下面的这些部分,并且我指出了当前文档中页码的位置:

TITLE page - no page number
DECLARATION - position top right
ABSTRACT (2 pages) - [1st page no page number, 2nd page top right]
ABSTRACT (In Malay language) (2 pages)  - [1st page no page number, 2nd page top right]
ACKNOWLEDGMENTS (2 pages)  -[1st-page bottom center, 2nd and following pages top right]
CONTENTS (4 pages) -[same as above]
LIST OF FIGURES (4 pages) -[same as above]
LIST OF TABLES (2 pages) -[same as above]
LIST OF ABBREVIATIONS (2 pages) -[same as above]
LIST OF SYMBOLS (3 pages) -[same as above]

和 \mainmatter 句柄

Chapter1  - [1st-page bottom center, 2nd and following pages top right]
Chapter2 -[same as above-]
Chapter3 -[same as above-]
Chapter4 -[same as above-]
Chapter5 -[same as above-]
Chapter6 -[same as above-]
Chapter7 -[same as above-]

最后 \backmatter 处理

REFERENCES  - [1st-page bottom center, 2nd and following pages top right]
APENDIX  - [1st-page bottom center, 2nd and following pages top right]
List of Scientific Contributions (3 pages) -[all pages top right]

在 Thesis.cls 文件中,我可以看到页面设置的代码如下:

\newcommand\btypeout[1]{\bhrule\typeout{\space #1}\bhrule}
\def\today{\ifcase\month\or
  January\or February\or March\or April\or May\or June\or
  July\or August\or September\or October\or November\or December\fi
  \space \number\year}
%\usepackage{setspace}
\RequirePackage{setspace}
\onehalfspacing
\setlength{\parindent}{15pt} % VJ-originally 0pt
\setlength{\parskip}{2.0ex plus0.5ex minus0.2ex}
\usepackage{vmargin}
\setmarginsrb           { 1.5in}  % left margin
                        { 0.6in}  % top margin
                        { 1.0in}  % right margin
                        { 0.8in}  % bottom margin
                        {  20pt}  % head height
                        {0.25in}  % head sep
                        {   9pt}  % foot height
                        { 0.3in}  % foot sep
\raggedbottom
\setlength{\topskip}{1\topskip \@plus 5\p@}
\doublehyphendemerits=10000       % No consecutive line hyphens.
\brokenpenalty=10000              % No broken words across columns/pages.
\widowpenalty=9999                % Almost no widows at bottom of page.
\clubpenalty=9999                 % Almost no orphans at top of page.
\interfootnotelinepenalty=9999    % Almost never break footnotes.
\usepackage{fancyhdr}
\lhead[\rm\thepage]{\fancyplain{}{\sl{\rightmark}}}
\rhead[\fancyplain{}{\sl{\leftmark}}]{\rm\thepage}
\chead{}\lfoot{}\rfoot{}\cfoot{}
\pagestyle{fancy}

顺便说一下,我想要的是如下内容(包括图块页面):

\fronmatter  - [roman style at bottom right]
\mainmatter - [arabic style at bottom right]
\backmatter - [arabic style at bottom right]

有什么办法吗?我浏览了一下,但没有人能帮我。

注意:我fancyhdr 也在使用包。

答案1

这应该对你有用:开始章节的页面使用 pagestyle plain,至少在book类中如此,因此你需要重新定义此样式以使其保持一致。另外,顺便说一句,OE分别\fancyfoot[RO,RE]{}是奇数和偶数,由于你正在单面打印,所以不需要。

\documentclass{book}

\usepackage{fancyhdr}

\fancypagestyle{mystyle}{
\fancyhf{}
\renewcommand\headrulewidth{0pt}
\fancyfoot[R]{\thepage}
}

%Renew plain style for chapter pages
\fancypagestyle{plain}{
\fancyhf{}
\renewcommand\headrulewidth{0pt}
\fancyfoot[R]{\thepage}
}

\title{This is a Thesis}
\author{Me}

\begin{document}


\frontmatter
\pagestyle{empty}

\maketitle


\tableofcontents

\pagestyle{mystyle}
\chapter{Abstract}

\chapter{Bla}


\mainmatter
\chapter{C3}


\section{S1}
\section{S2}

\chapter{C4}


\section{S1}
\section{S2}

\end{document}

答案2

我认为您有一份双面文档。在序言中添加以下内容应该可以满足您的要求(奇数页在右侧,偶数页在左侧):

\usepackage{totpages}
\usepackage{fancyhdr}

\pagestyle{fancy}
\fancyfoot[LE,RO]{\theTotPages}

如果您希望它出现在所有页面的右侧,请将最后一行替换为:

\rfoot{\theTotPages}

相关内容