Promote Your Blog
Google

Friday, May 11, 2012

How to Make Fancy Page Headers and Footers in Latex

To make your reports/books have fancy pages, follow these simple steps:

1. Before \begin{document}, declare this package to be used:
\usepackage{fancyhdr}

2. All pages do not have fancy style (like Acknowledgment & Table of Contents pages}. So, before those pages, write
\thispagestyle{empty}

3. For pages, where fancy headers & footers are required, declare this intent by writing:
\pagestyle{empty}

4. Clear default settings for header & footer by
\fancyhead{}
\fancyfoot{}

5. Here is a LaTex code sample for fancy header & footer
\lhead {"My Doc Name"}
\chead{"--Draft--"}
\rhead{\thepage}

\lfoot{"My Project"}
\cfoot{"--Ver No.--"}
\rfoot{"\thepage"}

l,c,r indicates left, centre, right of head or foot as the case be

6. You can also use,
\fancyfoot[RO,LE]{\thepage}
\fancyhead[CO,CE]{"--Draft--"}

R-->Right
L-->Left
C-->Center

E-->Even Page No.
O-->Odd Page No.

More to come about fancy pages in next post....