How do I make custom page numbering in LaTeX?

47,052

Solution 1

Some paragraph. Some paragraph. Some paragraph. Some paragraph. Some paragraph.

\newpage
\setcounter{page}{1}
\renewcommand{\thepage}{A-\arabic{page}}

Some paragraph. Some paragraph. Some paragraph. Some paragraph. Some paragraph.

Would this be anywhere near what you want to do? This is how you can manipulate the page counter, and the \thepage command that determines what will be printed as page number. \roman{page} would give roman numbers, \alph{page} a, b, c ...

The other sensible solution is to use the fancyhdr package, as suggested before.

Solution 2

First I would create one file that includes all chapters and appendixes etc. something called main.tex or thesis.tex

there you can do all the includes and document settings, and also your header and footer settings:

% Free Header and Footer
\usepackage{fancyhdr}
\lfoot[\fancyplain{}{}]{\fancyplain{}{}}
\rfoot[\fancyplain{}{}]{\fancyplain{}{}}
\cfoot[\fancyplain{}{\footnotesize\thepage}]{\fancyplain{}{\footnotesize\thepage}}
\lhead[\fancyplain{}{\footnotesize\nouppercase\leftmark}]{\fancyplain{}{}}
\chead{}
\rhead[\fancyplain{}{}]{\fancyplain{}{\footnotesize\nouppercase\sc\leftmark}} 

here it would make the page number in the center of your page foot. and the chapter title on the left of your header and also on the right if your work is doubel paged.

then you can start to include your other chapters.. mine looks like that (still in thesis.tex):

% --- Start of Document ----------------------------------------
\begin{document}

\pagenumbering{roman}       %roemische ziffern

\pagestyle{fancy}           % Initialize Header and Footer

\include{title}         % Title Page
\include{affidavit}     % affidavit
\include{abstracts}     % Englisch and German abstracts
\include{acknowl}       % Acknowledgements
\include{glossary}      % Glossary
\include{abbreviation}  % Abkuerzungen
%\include{keywords}     % Keywords
\include{toc}       % Table of Contents

%--- Include your chapters here ----------
\setcounter{page}{1}    % set page to 1 again to start arabic count
\pagenumbering{arabic}
%\include{chapter0}
\include{chapter1}      % Introduction
\include{chapter2}      % Background
\include{chapter3}      % Konzeption
\include{chapter4}      % Technische Umsetzung
\include{chapter5}

\include{chapter6}

%
%% ....

\appendix
\include{appendix}          % Appendix A

\end{document}

Hope that helps! headers and footers are some time difficult, and sometime if you change \documentclass it could appear different too. ;)

Solution 3

If you're able to use the Memoir class (which I recommend), you can use page styles. See Chapter 7.2 Page Styles. For example, create two styles:

\pagestyle{plain} % Regular page numbering

... STUFF ...

\clearpage % make a new page numbering down here
\copypagestyle{AppendixPS}{plain}
\renewcommand{\thepage}{Chapter \chapter Section \section page \page}
\pagestyle{AppendixPS}

I haven't tested this – or used LaTeX to do this in a while – but I hope it provides some food for thought or at least puts you onto the right track.

Share:
47,052

Related videos on Youtube

2xj
Author by

2xj

Updated on July 09, 2022

Comments

  • 2xj
    2xj almost 2 years

    I have a report with appendixes.

    What I want is to use a different style on the page numbering when the appendixes start.

    I use Arabic numbering until I reach the appendixes. Then I would want to do something like this:

    I want the custom page numbering to be:

    Chapter: A
    Section: {Chapter}{1}       (A-1)
    
    \newpage
    \pagenumbering{custompagenumbering}
    

    Is this possible?

    • glts
      glts about 14 years
      To get a more precise answer, you should elaborate on the exact format and behaviour of "custom page numbering" you are looking for.
    • Flexo
      Flexo over 8 years
      I'm voting to close this question as off-topic because it is about LaTeX
  • Geoff
    Geoff about 14 years
    +1 Good answer. An example with fancyhdr would make this a really great answer.