4

I am new to LaTeX so definitely naïve in this topic. How do I number each pages automatically in LaTeX. The current page numbering is carried out on a chapter basis. It would restart the counter in next chapter and begin numbering again. So, how can I maintain a global counter that counts page from the first page all the way to the last? My document class is report.

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

---------------------I am update line -----------------------

\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
    Welcome to TeX.SE! The page numbering system you currently have is not standard for the report document class. Some macros in your preamble and/or some LateX package you're loading must be modifying the page numbering system. Please post an MWE (minimal working example) that generates the problem behavior you're looking to fix. – Mico Dec 10 '13 at 7:32
  • Great good to know that Mico.I've updated my question and attached the code. let me know if that suffice to diagnose the problem – Daniel Dec 10 '13 at 7:37
  • 4
    you need to set \pagenumbering{arabic} only the first time (for your intro.tex chapter) and remove the other occurrences – Nico Vecchio Dec 10 '13 at 7:48
  • Yeah that's right. I should remove them. Thanks ! – Daniel Dec 10 '13 at 7:55
6

This is a minimal working example (MWE) that shows the problem:

\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}

The solution is to load \pagenumbering only once, when you want to switch between roman and arabic numbering.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.