Sign up ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'd like to modify the contents of my headers and footers - e.g., to display the current chapter and/or section title or to change the pagination alignment. How can I do that? I've noticed the packages fancyhdr and scrpage2 (part of the KOMA-Script-bundle) - are they interchangeable, or are there situations where I should prefer one package to the other?

share|improve this question

2 Answers 2

up vote 22 down vote accepted
  • fancyhdr is the classical package. The last change has been 6 years ago.

  • scrpage2 has been available for years but is also developing currently together with the modern KOMA-script classes. Naturally it is better integrated with those classes but it may be used with other classes as well.

fancyhdr provides a head rule and a foot rule, but scrpage2 offers head top line, head separation line, foot separation line and foot bottom line.

scrpage2 comes with a sophisticated interface to specify own styles, beginning with a simple \deftripstyle taking 9 parameters complemented by an expert interface: \defpagestyle, \newpagestyle, \renewpagestyle and \providepagestyle, see documentation.

To ease work with different styles scrpage2 reads and processes a file scrpage.cfg where several styles for many projects might be defined.

So, I would prefer scrpage2 if it's available. I'm sure it can replace fancyhdr. The latter package might be preferred if the requirements aren't too sophisticated and quick learning is expected.

Note: if you use fancyhdr and geometry, load geometry first.

share|improve this answer
1  
scrpage2 also seems to be preferable for newcomers in a number of situations: Distinct elements of the pagestyles scrheadings and scrplain (the style for chapter start pages) can be changed with one command (using its optional argument for scrplain), and differentiating between left and right pages is also easier. One feature of fancyhdr not included in scrpage2 is distinct headers and footers for pages containg only floats. – lockstep Aug 6 '10 at 23:31
1  
True. The float support comes mainly by \iffloatpage, a one-liner that might be used with scrpage2 as well: \providecommand{\iffloatpage}[2]{\if@fcolmade #1\else #2\fi}. – Stefan Kottwitz Aug 7 '10 at 0:00
    

Since November 2011, there's a third package dedicated to customizing headers and footers: titleps by Javier Bezos (the author of enumitem, titlesec, and titletoc). Package description:

The package provides page styles with a simple one-stage mechanism, including top marks; access to top-, first- and botmarks in a single header/footer; headers/footers for specific floats; multiple sets of marks (with e-TeX), and more.

Note that the features listed in titleps' description aren't available in fancyhdr and scrpage2.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.
http://tex.stackexchange.com/questions/1247/how-to-customize-headers-and-footers
tex.stackexchange.com
crawl=CC-MAIN-2015-48
82329
application/http; msgtype=response
sha1:Q5HTSWX2AWGZ7AOFTTQALEBLW2BXHX4N
<urn:uuid:1edf298b-c2da-412c-9c32-efc865602b61>
2015-11-27T19:05:30Z
104.16.118.182
sha1:DQDEFGMN57AF5HCJYNVG25RGPKQOXHLX
<urn:uuid:84b9ed5e-cb4f-4a8b-8a00-3dc8a0b92e96>
http://tex.stackexchange.com/questions/1247/how-to-customize-headers-and-footers
response
<urn:uuid:29945fbe-5316-439d-9c6b-7b2387c4b2c1>
robots: classic
hostname: ip-10-71-132-137.ec2.internal
software: Nutch 1.6 (CC)/CC WarcExport 1.0
isPartOf: CC-MAIN-2015-48
operator: CommonCrawl Admin
description: Wide crawl of the web for Nov 2015
publisher: CommonCrawl
format: WARC File Format 1.0
conformsTo: http://bibnum.bnf.fr/WARC/WARC_ISO_28500_version1_latestdraft.pdf