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

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

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