2

I am looking to see how I can apply \fancyhdr to make the page number appear at the bottom. What I found inside the TEX forum doesn't seem to work because I am using the \newpage command to create new pages when starting new sections. I am new to TEX and don't know how to create a work around. How can I adjust what I have written below so that the page number will appear at the bottom of every page? Also inside the table of contents.

\documentclass[12pt,a4paper]{report}
\usepackage[a4paper,margin=6mm]{geometry}
\usepackage{amsmath}
\usepackage{lipsum}
\usepackage{fancyhdr}


    \fancypagestyle{axionstyle}{%
  \fancyhf{}
  \renewcommand{\headrulewidth}{5pt}
  \cfoot{\huge \textbf{\thepage}} % for example
}
\title{COMPUTATIONAL METHODS FOR THE RIEMANN ZETA FUNCTION}
\author{Axion004}


\begin{document}
\maketitle
\tableofcontents
\clearpage
\section*{Summary}
\addcontentsline{toc}{section}{Summary}
\pagenumbering{gobble}
\setcounter{page}{1}
.
.
.
\newpage
\section*{Introduction}
\addcontentsline{toc}{section}{Introduction}
.
.
.
\newpage
\section*{The Cauchy-Schlomilch transformation and Zeta(s)}
\addcontentsline{toc}{section}{The Cauchy-Schlomilch transformation and Zeta(s)}
.
.
.
\end{document}

Here is an example of how the Table of Contents looks like

enter image description here

And some pages without a page number

enter image description here

2
  • Thank you for posting a working example! At the same time, much of your code does not seem to be relevant to the question you're asking here. Please limit the example to only the code required for your issue to appear. You can have a look at this guide for how to prune your code for this purpose. Commented Oct 4, 2015 at 14:33
  • The margins are too weird, in my point of view
    – user31729
    Commented Oct 4, 2015 at 14:36

1 Answer 1

4

\pagenumbering{gobble} drops all page numbers on the pages. Rather use \pagestyle{empty} or \thispagestyle{empty} (does not work always due to special settings in \tableofcontents (most times plain style)).

For special page styles use \fancypagestyle{yourname}{...} with the appropiate settings.

\documentclass[12pt,a4paper]{report}
\usepackage[a4paper,left=1.5cm,right=1.5cm,headheight=10mm,bottom=25mm]{geometry}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{fancyhdr}
\usepackage{hyperref}



\usepackage{blindtext}

\fancypagestyle{axionstyle}{%
  \fancyhf{}
  \renewcommand{\headrulewidth}{0pt}
  \cfoot{\huge \textbf{\thepage}} % for example
}


\title{COMPUTATIONAL METHODS FOR THE RIEMANN ZETA FUNCTION}
\author{Axion004}



\begin{document}
\maketitle
\pagestyle{empty}
\pagenumbering{gobble} %????
\tableofcontents
\clearpage
\pagestyle{axionstyle}
\pagenumbering{arabic}%
\section*{Summary}
\addcontentsline{toc}{section}{Summary}
\clearpage
\blindtext[20]
\end{document}
1
  • Thank You! I fixed the footer so that the page number appears at the bottom.
    – Axion004
    Commented Oct 4, 2015 at 15:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .