General ⇒ How to do a simple header & footer
How to do a simple header & footer
I'm looking for a simple explanation of how to do a centered header & footer on every page of a document (probably using fancyhdr?). I have the fancyhdr documentation but I can't quite get it to work.
All I need is a string such as "RESTRICTED" as a centered header & footer on every page. Can anyone offer any advice?
I prefer to use Lyx but presumably I can just insert the necessary code into the preamble of the LyX document.
Many thanks
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
How to do a simple header & footer
a simple example using fancyhdr:
Code: Select all
\documentclass{article}
\usepackage{fancyhdr}
\usepackage{lipsum}% just to generate some text
\fancyhf{}
\fancyhead[C]{RESTRICTED}
\fancyfoot[C]{RESTRICTED}
\renewcommand\headrulewidth{0pt}
\pagestyle{fancy}
\begin{document}
\lipsum[1-20]
\end{document}