# Line under chapter name at top of the page

I am writing a thesis, under the chapter name at the top of the page I would like a line to appear, but I don't have the palest idea on how to do that, I hope you can help.

Edit: I definitely wasn't clear enough. I meant this part of the page, as shown below:

• Which document class are you using? – Gonzalo Medina Jun 11 '13 at 11:26
• @GonzaloMedina I am using book. – haunted85 Jun 11 '13 at 11:26
• Use the fancyhdr package. – Gonzalo Medina Jun 11 '13 at 11:41

You can use the fancyhdr package to customize the headers/footers of your document; a little example:

\documentclass{book}
\usepackage[a6paper]{geometry}% just for the example
\usepackage{fancyhdr}
\usepackage{lipsum}% just to generate text for the example

\pagestyle{fancy}
\fancyhf{}

\begin{document}

\chapter{Introduzione}
\lipsum[4]
\section{A Test Section}
\lipsum[1-3]

\end{document}


E stands for "even"; O, for "odd"; L, C, R stand for "left", "center", "right", respectively. So, for example, \fancyhead[EL]{<text>} will place <text> in the header to the left on even pages. By default, calling \pagestyle{fancy} draws a horizontal rule below the header.

I used \nouppercase since uppercased headers are not pleasing, but this is optional. The package documentation explains how you can further customize the marks used in the headers.