1

I use the following code to have a customized header in all pages, but I've lost the page numbering:

\documentclass[10pt,a4paper]{article}
\title{\textbf{DOCUMENT TITLE}}
\usepackage[spanish]{babel}
\usepackage{pdflscape}
\usepackage{color, colortbl}
\definecolor{Gray}{gray}{0.9}
\usepackage{enumitem}
\usepackage{anysize}
\marginsize{3cm}{3cm}{2.5cm}{2.5cm}

\usepackage{caption}
\captionsetup[table]{skip=10pt}

\usepackage{fancyhdr}
\usepackage{lipsum}

\pagestyle{fancy}
\headheight=0.5pt

\fancyhf{}

\lhead{\small{DOCUMENT}}
\thispagestyle{fancy}


\begin{document}

\maketitle
\newpage
\tableofcontents
\newpage
\section{TITLE}

\end{document}
2

To get the page number, you must use \thepage.

For example, put the following line:

\rhead{\small{\thepage}}

in the preamble of your document, to get that number at the right side of the header.

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.