LyXDisplay Header on first Page

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
Post Reply
lyxer
Posts: 47
Joined: Mon May 10, 2010 5:17 pm

Display Header on first Page

Post by lyxer »

Hi all,

I'm trying to display the header on the first page
but with no luck. The code below shows what I have in
the preamble. Is there anything else I need to include?

Also, the line \rfoot{\thepage} is supposed to display
the page number. How can I stop that?, i.e. I don't want
to display the page number on the first page. Omitting
" \thepage " won't do it?

Thnx

Sas

Code: Select all

\usepackage{fancyhdr}
\pagestyle{fancy}
\lhead{EEL 400}
\chead{2011}
\rhead{Circuits}
\lfoot{}
\cfoot{}
\rfoot{\thepage}
\renewcommand{\headrulewidth}{0.0pt}
\renewcommand{\footrulewidth}{0.0pt}
Last edited by lyxer on Sun Jul 17, 2011 2:13 pm, edited 1 time in total.

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

5gon12eder
Posts: 126
Joined: Sun Feb 13, 2011 8:36 pm

Display Header on first Page

Post by 5gon12eder »

Since the code is incomplete, I can't tell for sure. Most likely, however, you are using \maketitle on the first page which invokes \thispagestyle{plain}. (Hence, any settings for the pagestyle fancy will have no effect.) The documentation of the fancyhdr package shows how to work around this.

Best
I'm using pdfTeX, Version 3.1415926-1.40.10 (TeX Live 2009/Debian).
lyxer
Posts: 47
Joined: Mon May 10, 2010 5:17 pm

Re: Display Header on first Page

Post by lyxer »

I've looked through the fancyhdr documentation but couldn't
find what I'm looking for, or maybe it's there but I missed
it.

Anyways, I'm attaching a sample file and its output.
The heading appear on the second page but not the first page.
Attachments
Archive.zip
(38.44 KiB) Downloaded 736 times
5gon12eder
Posts: 126
Joined: Sun Feb 13, 2011 8:36 pm

Re: Display Header on first Page

Post by 5gon12eder »

section 7
I'm using pdfTeX, Version 3.1415926-1.40.10 (TeX Live 2009/Debian).
lyxer
Posts: 47
Joined: Mon May 10, 2010 5:17 pm

Re: Display Header on first Page

Post by lyxer »

Great! It's working.

I just needed to add : \pagestyle{fancy}.
Now when I also remove \thepage from \rfoot{\thepage}
the page number on the first page disappeared.

Thanks a lot.

Sas
Post Reply