Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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}
share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.