如何在 LaTeX 中自动对页面进行全局编号?

如何在 LaTeX 中自动对页面进行全局编号?

我是 LaTeX 的新手,所以对这个主题绝对一无所知。如何在 LaTeX 中自动对每页进行编号。当前的页码编号是按章节进行的。它会在下一章重新启动计数器并重新开始编号。那么,我如何维护一个全局计数器,从第一页一直计数到最后一页?我的文档类是report

\documentclass[pdftex,12pt,a4paper]{report}

---------------------我正在更新线 -----------------------

\usepackage[top=3cm, bottom=3cm, left=3.5cm, right=3cm]{geometry}

% graphics images
\usepackage[pdftex]{graphicx}

% 1.5 line spacing
\usepackage{setspace}
\onehalfspacing

% maths symbols
\usepackage{amsmath}

% table package
\usepackage{multirow}

% source code listing
\usepackage{listings}
\usepackage{color}
\usepackage{xcolor}

\usepackage{caption}


% citation style
\usepackage{apacite}
\DeclareCaptionFont{white}{\color{white}}
\DeclareCaptionFormat{listing}{\colorbox{gray}{\parbox{\textwidth}{#1#2#3}}}

\begin{document}


% cover
\input{cover_report.tex}

% title page
\input{title_report.tex}

% abstract
\setcounter{page}{1}
\pagenumbering{roman}
\input{abstract.tex}

% acknowledgement
\input{acknowledgements.tex}

% table of content
\tableofcontents
\addcontentsline{toc}{chapter}{Contents}

% list of tables
\listoftables
\addcontentsline{toc}{chapter}{List of Tables}

% list of figures
\listoffigures
\addcontentsline{toc}{chapter}{List of Figures}

% intro chapter
\cleardoublepage
\pagenumbering{arabic}
\input{intro.tex}

% intro chapter
\cleardoublepage
\pagenumbering{arabic}
\input{background.tex}

% intro chapter
\cleardoublepage
\pagenumbering{arabic}
\input{design.tex}

% intro chapter
\cleardoublepage
\pagenumbering{arabic}
\input{implementation.tex}

% intro chapter
\cleardoublepage
\pagenumbering{arabic}
\input{analysis.tex}

% intro chapter
\cleardoublepage
\pagenumbering{arabic}
\input{limit_future.tex}

% intro chapter
\cleardoublepage
\pagenumbering{arabic}
\input{conclusion.tex}

% references
\bibliographystyle{apacite}
\bibliography{my_ref}

% appendix
\end{document}

答案1

这是一个最小工作示例(MWE)这表明了问题:

\documentclass{report}
\usepackage{lipsum}
\begin{document}

\pagenumbering{roman}
\lipsum

\clearpage
\pagenumbering{arabic}
\lipsum

\clearpage
\pagenumbering{arabic}           %this causes the page numbering reset
\lipsum

\end{document}

\pagenumbering解决方案是,当您想在罗马数字和阿拉伯数字之间切换时,仅加载一次。

相关内容