How can I create a default header, footer and customize the font of my LaTeX document?

I wanted something like this:

Default book title                     Chapter name


www.defaulturl.com                     PAGE NUMBER

2 Answers 2


As mentioned in Stefan's answer to How to customize headers and footers?, fancyhdr is the classical package to customize headers/footers. However, recently I've been using the titlesec package to define page styles, and I've found it really useful and as powerful as fancyhdr, so here's a little example achieving the desired result with titlesec:

\usepackage{lipsum}% just to generate some filler text

\newcommand*\defaulttitle{Some Title}




\chapter{Test chapter}


Gonzalo mentioned fancyhdr (the classic solution) and titlesec. Modern classes such as Koma-Script classes (scrbook and friends) and memoir also have built-in ways of achieving this.

In the case of Koma-Script classes for example, you can achieve a lot by using the scrpage2 package. (Update 2014:) Since version 3.12 you should use the successor package scrlayer-scrpage instead.

  • 3
    Actually, scrpage2 can be used with the standard classes as well.
    – lockstep
    Jun 6, 2011 at 21:40
  • @lockstep: good to know. I've only seen it used in Koma, and fancyhdr used in most cases.
    – raphink
    Jun 6, 2011 at 21:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .