页码消失 - fancyhdr

页码消失 - fancyhdr

当我编译此代码时,所有页面的编号都会消失

    \documentclass[10pt,a4paper,final]{article}
    \usepackage[utf8]{inputenc}    
    \usepackage[T1]{fontenc}
    \usepackage[francais]{babel} 
    \usepackage[top=2cm, bottom=2cm, left=2cm, right=2cm]{geometry}
    \usepackage{graphicx}
    \usepackage{caption}
    \usepackage{amsmath,amsfonts,amssymb}
    \usepackage{enumitem}
    \usepackage{hyperref}
    \usepackage[french]{nomencl}
    \usepackage{fancyhdr}
    \pagestyle{fancy}
    \setlength{\headheight}{52pt} % If I dont write this line ,text overlap with the header
    \renewcommand{\headrulewidth}{1pt}
    \fancyhead[L]{\includegraphics[scale=0.5]{example-image}}
    \fancyhead[C]{\textbf{Rapport de stage}}
    \fancyhead[R]{\includegraphics[scale=0.5]{example-image}
    \renewcommand{\footrulewidth}{0pt}
    \fancyfoot[C]{\textbf{page \thepage}}

    \hypersetup{
    pdfborder={0 0 0},colorlinks=false
    }


    \FrenchFootnotes
    \setlength{\footnotesep}{0.5cm}
     \usepackage{lipsum}
    \begin{document}

     \lipsium


\end{document}

你能解释一下问题出在哪里吗?(即使我删除了脚注,我仍然有这个问题)

答案1

您的页面太长,因此页码移位。

在此处输入图片描述

\documentclass[10pt,a4paper,final]{article}
\usepackage[francais]{babel} 
\usepackage[top=52pt, bottom=2cm, left=2cm, right=2cm]{geometry}
\usepackage{graphicx}
\usepackage{hyperref}
\usepackage{fancyhdr}
\pagestyle{fancy}
\renewcommand{\headrulewidth}{1pt}
\fancyhead[L]{\includegraphics[height=1cm]{example-image-a}}
\fancyhead[C]{\textbf{Rapport de stage}}
\fancyhead[R]{\includegraphics[height=1cm]{example-image-b}}
\renewcommand{\footrulewidth}{0pt}
\fancyfoot[C]{\textbf{page \thepage}}

\hypersetup{
    pdfborder={0 0 0},colorlinks=false
}


\FrenchFootnotes
\setlength{\footnotesep}{0.5cm}

\usepackage{lipsum}

\begin{document}
        \lipsum
        \lipsum
        \lipsum
        \lipsum


\end{document}

相关内容