3

I have the number 1 written at the bottom of the first page of my latex document, but none of the other pages have page numbers. How can I have page numbers on every page ?

Here is what I did:

\documentclass[french]{article}
\title{Rapport de physique: Transformation du travail en chaleur}
\author{computerdummy}
\date{}
\usepackage[utf8]{inputenc}

\usepackage[french]{babel}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{float}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\rhead{computerdummy}
\lhead{Rapport de physique: Transformation \\ du travail en chaleur}


\begin{document}

\maketitle
\tableofcontents

\begin{abstract}
%
\end{abstract}

\section{But de l'expérience}

%
\section{Théorie}

    \paragraph{Le travail de la force}
%

    \paragraph{L'énergie calorifique}
%
    \paragraph{Comment nous nous en servirons}
%
\end{document}
5
  • 1
    Welcome to TeX.SE! You can use fancyhdr or with KOMA-Script scrlayer-scrpage, depending on your used code you did not show us! Please add a short, compilable code to your question showing how you get the first page number ...
    – Mensch
    Commented Nov 17, 2017 at 17:23
  • 3
    Is there some \pagestyle{empty} in your document? Your description leaves a lot of guessing
    – user31729
    Commented Nov 17, 2017 at 17:23
  • titleps, which comes with titlesec is another possibility.
    – Bernard
    Commented Nov 17, 2017 at 17:29
  • 3
    Welcome to TeX.SX! The default behaviour of most classes it to add page numbers to (almost all) pages. So please show us a minimal but working example (MWE) that can be used to reproduce your problem. Without such a MWE your problem is either to broad or quiet unclear. Commented Nov 17, 2017 at 17:47
  • If the question was a mistake, the best option is to delete it... ;-)
    – Rmano
    Commented Nov 17, 2017 at 19:28

1 Answer 1

7

The page where \maketitle does its work uses the plain page style. On the others, the fancy page style is used and you cleared all headers and footers, resetting the left and right header. You didn't set the footer.

\pagestyle{fancy}
\fancyhf{}
\fancyhead[R]{computerdummy}
\fancyhead[L]{Rapport de physique: Transformation \\ du travail en chaleur}
\fancyfoot[C]{\thepage} % <--- MISSING

You must log in to answer this question.

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