[Tex/LaTex] Same footer line on every page

header-footer

Is there a way to place the same footer line on every page? Right now, I have a chapter called introduction and in my introduction.tex file I have specified a footer line that needs to be added. But the problem is, when the pdf file is being generated, the footer line I specified is only on the last page of the chapter. But I want it on every page in the chapter. Could someone please tell me how I can accomplish this?

Best Answer

To get a footer line on every page of the document, one could use the fancyhdr package, maybe along the lines of the following minimum working example (MWE):

\documentclass[twoside]{article}
\usepackage{lipsum} % for filler text
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhead{} % clear all header fields
\renewcommand{\headrulewidth}{0pt} % no line in header area
\fancyfoot{} % clear all footer fields
\fancyfoot[LE,RO]{\thepage}           % page number in "outer" position of footer line
\fancyfoot[RE,LO]{Message of the day} % other info in "inner" position of footer line
\begin{document}
\lipsum[1-20] % generate about 4 pages of filler text
\end{document}

It's the "Message of the day" string that you'll want to change, for sure.

If the text in the footer line needs to be displayed in bold face and/or italics, you could do so by inserting the commands \bfseries and/or \itshape prior to the "Message of the day" string.

Addendum Two more points:

  1. To get a separate footer line for each chapter, you should omit the command \fancyfoot[RE,LO]{Message of the day} from the preamble and, instead, issue the command \fancyfoot[RE,LO]{Message for Chapter xx} immediately after the respective \chapter command.
  2. In the LaTeX book document class, the first page of a chapter uses the pagestyle "plain" (page number centered in footer line, no other header and/or footer information) even if the other pages follow a different pagestyle (such as "fancy"). If you want to display your chapter-specific footer lines on the first page of a chapter as well, you should issue the command \thispagestyle{fancy} after the respective \chapter command.