Generalheader question

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
Abu Noor El-Din
Posts: 11
Joined: Wed Nov 21, 2007 1:43 am

header question

Post by Abu Noor El-Din »

Hi all,

I am new to latex. I am using the fancyhdr to customize my header and footer and it is working ok.
How can I put a line in my header as we see in text books?

Thanks in advance.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

header question

Post by gmedina »

In the preamble, use

Code: Select all

\renewcommand\headrulewidth{1pt}
to place a rule below the header and

Code: Select all

\renewcommand\footrulewidth{0.5pt}
to place a rule above the footer. Change the values according to your needs. I include a simple example:

Code: Select all

\documentclass{report}
\usepackage{fancyhdr}
\pagestyle{fancy}
\lhead{LEFT} 
\chead{CENTER}
\rhead{RIGHT}
\lfoot{left} 
\cfoot{\thepage}
\rfoot{right}
\renewcommand\headrulewidth{1pt}
\renewcommand\footrulewidth{0.5pt}
\usepackage{blindtext}

\begin{document}
\Blindtext
\end{document}
The blindtext package was loaded only to automatically generate some text.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
Abu Noor El-Din
Posts: 11
Joined: Wed Nov 21, 2007 1:43 am

Re: header question

Post by Abu Noor El-Din »

again and as always thank you gmedina.

Your example works well also I found another solution using fancyhdr package.
Post Reply