Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am working on fancyhdr in report generation. Currently I am using fancyhdr which produces one line and I can add left, center and right footers below to this line. But I need an mdframed as footer and need to add right, left and middle text inside it.

Below is sample mdframed which need to be added as footer.

enter image description here

Please help me out.

share|improve this question

2 Answers 2

up vote 5 down vote accepted

You can use something like the following:

\documentclass{article}
\usepackage[framemethod=tikz]{mdframed}
\usepackage{fancyhdr}
\usepackage{lipsum}

\pagestyle{fancy}
\fancyhead{}
\fancyfoot{}
\fancyfoot[C]{%
\begin{mdframed}[linecolor=blue!60,roundcorner=3pt]
\parbox[t]{0.333\textwidth}{\raggedright Text on the left}%
\parbox[t]{0.333\textwidth}{\centering Text on the center}%
\parbox[t]{0.333\textwidth}{\raggedleft Text on the right}
\end{mdframed}%
}

\begin{document}
\lipsum[1-12]
\end{document}

The idea is to place an mdframed environment centered in the footer; inside this environment, three \parboxes of equal length are used to place the footer contents. An image of the footer on the first page:

enter image description here

share|improve this answer

The tcolorbox package is another option to to produce rounded corner boxes, even in the footer:

enter image description here

\documentclass{article}
\usepackage{fancyhdr}% http://ctan.org/pkg/fancyhdr
\usepackage{lipsum}% http://ctan.org/pkg/lipsum
\usepackage{tcolorbox}% http://ctan.org/pkg/tcolorbox
\pagestyle{fancy}
  \fancyhf{}% Clear headers/footers
  \fancyfoot[C]{%
    \begin{tcolorbox}[width=\linewidth]
      \makebox[0pt][l]{Text on the left}\hfill%
      \makebox[0pt][c]{Text on the center}\hfill%
      \makebox[0pt][r]{Text on the right}%
    \end{tcolorbox}%
}
\begin{document}
\lipsum[1-12]
\end{document}
share|improve this answer
    
Thanks, both solutions are good and quite useful for my work. –  manish Jul 24 '12 at 9:43

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.