Difference between revisions of "Modify default header or footer"

From Notes_Wiki
(Created page with "<yambe:breadcrumb>LaTeX|LaTeX</yambe:breadcrumb> =Modify default header or footer= TO modify default header or footer of a LaTeX page use package fancyhdr as follows: <pre> \...")
 
m
Line 17: Line 17:
</pre>
</pre>


The settings specified this way would apply to all pages except first.  To apply custom header and fooer to first page use:
The settings specified this way would apply to all pages except first.  To apply custom header and footer to first page use:
<pre>
<pre>
\fancypagestyle{plain}
\fancypagestyle{plain}

Revision as of 10:22, 12 June 2014

<yambe:breadcrumb>LaTeX|LaTeX</yambe:breadcrumb>

Modify default header or footer

TO modify default header or footer of a LaTeX page use package fancyhdr as follows:

\usepackage{fancyhdr}
\pagestyle{fancy} - To use fancy header for pages
\fancyhf{} - Clear existing header and footer definitions
\lhead{} - Define left header
\chead{} - Define center header
\rhead{} - Define right header
\lfoot{} - Define left footer
\cfoot{} - Define center footer
\rfoot{} - Define right footer
\renewcommand{\headrulewidth}{1pt} 
\renewcommand{\footrulewidth}{1pt} 

The settings specified this way would apply to all pages except first. To apply custom header and footer to first page use:

\fancypagestyle{plain}
{
 \fancyhf{}
 \renewcommand{\footrulewidth}{1pt} 
 \chead{Rekall Software Pvt. Ltd.}
 \lfoot{CIN: U72100AP2014PTC094241}
 \rfoot{Page: \thepage}
 \fancypagestyle{plain}
}

to change plain style that is automatically applied to first page


Learned from http://www.sharelatex.com/learn/Headers_and_footers


Modifying layout of page

To modify layout of page to change the size of header, footer, etc. use:

\oddsidemargin -0.25 in
\headheight 0.5 in
\headsep 0.25 in
\topmargin 0.25 in
\textwidth 7 in
\textheight 8.5 in
\footskip 30pt

More details about these parameters can be found at http://en.wikibooks.org/wiki/LaTeX/Page_Layout


<yambe:breadcrumb>LaTeX|LaTeX</yambe:breadcrumb>