LyXCustom Header Setup

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
Post Reply
energy382
Posts: 6
Joined: Tue Feb 26, 2013 1:07 pm

Custom Header Setup

Post by energy382 »

Hey all,

I'm writing on my diploma thesis and have some problems with the fancyhdr package. What I would like to have:
  • page number (right head) on chapter pages
  • page number (right head) and section number + section title on all other pages
  • no footer
I use scrbook (KOMA-Script) as document class. Here's my preambel:

Code: Select all

\usepackage{fancyhdr}
\pagestyle{fancy}
\renewcommand{\sectionmark}[1]{\markright{\thesection.\#1}}
\lhead{\rightmark}
\cfoot{}
\fancypagestyle{plain}
\fancyhf{}
\rhead{\thepage}
\renewcommand{\headrulewidth}{0.4pt}
The output file is attached. I've read several tutorials and manuals, but I don't get rid of these problems.

Many thanks for your help.


Regards
Christoph
Attachments
LyX-header-setup.pdf
(41.81 KiB) Downloaded 1155 times
Last edited by localghost on Tue Feb 26, 2013 1:35 pm, edited 2 times 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

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Custom Header Setup

Post by localghost »

The package scrpage2 is part of the KOMA-Script bundle and cooperates much better with its classes. It is described in detail in the KOMA-Script user guide. Hence you should try this instead.


Best regards and welcome to the board
Thorsten
energy382
Posts: 6
Joined: Tue Feb 26, 2013 1:07 pm

Custom Header Setup

Post by energy382 »

Thanks for the hint.

Is it possible, that the package scrpage2 isn't installed? If I insert

Code: Select all

\usepackage{scrpage2}
\pagestyle{scrheadings}
as described in the KOMA-Script user guide, nothing happens.

I use LyX and MiKTeX 2.9. If I start the package manager (admin) and filter for "scrpage2", there's no such package. But If I could choose scrbook (KOMA) as document class, scrpage2 should be automatically installed.

I'm confused. :?:
energy382
Posts: 6
Joined: Tue Feb 26, 2013 1:07 pm

Custom Header Setup

Post by energy382 »

Problem solved. I've forgotton to clear standard definitions with \clearscrheadfoot.

So, with this code everything is fine.

Code: Select all

\usepackage{scrpage2}
\pagestyle{scrheadings}
\clearscrheadfoot
\ohead{\pagemark}
\ihead{\headmark}
\cfoot{}
Thanks again for the hint with the scrpage2 package.
Post Reply