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 want to be able to customize my header/footer so far that I can change the rules that separate it from the document. Look for example at http://ww1.microchip.com/downloads/en/appnotes/00734b.pdf (second page and further), I want to be able to make header/footer rules like that.

Currently I'm using the fancyhdr package, but that's not necessary.
I already tried to add \hrule in the footer, and that's working, but I'd think there is a neater solution?

The code I used for that:

\renewcommand{\footrulewidth}{0pt}
\renewcommand{\headrulewidth}{0pt}
\fancyhead[L]{
\getfile\vskip2pt
\hrule width \hsize height 1pt\vskip1pt\hrule width \hsize height 2pt %
}
\fancyhead[C]{\getsubtitle\vskip3pt}
\fancyhead[R]{\gettitle\vskip3pt}
\fancyfoot[L]{
\hrule width \hsize height 2pt\vskip1pt\hrule width \hsize height 1pt %
\vskip2pt Some text.
}
\fancyfoot[C]{\vskip5pt Some text.}
\fancyfoot[R]{\vskip5pt Some text.}
share|improve this question
add comment

2 Answers

up vote 5 down vote accepted

To replace the rules of fancyhdr, you can redefine \headrule and \footrule including just the solution at your question Two rules directly under each other

MWE

\documentclass{article}

\usepackage{lastpage} % number of last page 
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}

\renewcommand\footrule{\begin{minipage}{1\textwidth}
\hrule width \hsize height 2pt \kern 1mm \hrule width \hsize   
\end{minipage}\par}%

\renewcommand\headrule{
\begin{minipage}{1\textwidth}
\hrule width \hsize \kern 1mm \hrule width \hsize height 2pt 
\end{minipage}}%

\lhead{Test}
\rhead{Section \thesection}
\lfoot{\today}
\rfoot{Page \thepage\ of \pageref{LastPage}}

\begin{document}
\section{Test}
headers and footers.
\end{document}
share|improve this answer
add comment

I'm not going to go into great detail as per your requirements, as this topic is covered (in some variant) in many other posts, however, basically, this is the way that you do it. You need to modify the format of the fancypagestyle, then when that style is called, the changes will be reflected in the document

\usepackage{fancyhdr}
\fancypagestyle{plain}{
    \fancyhf{} %Clear Everything.
    \fancyfoot[C]{\thepage} %Page Number
    \renewcommand{\headrulewidth}{1pt} %0pt for no rule, 2pt thicker etc...
    \renewcommand{\footrulewidth}{1pt}
    \fancyfoot[L]{BOTTOM LEFT}
    \fancyfoot[R]{BOTTOM RIGHT}
    \fancyhead[LE]{TOP LEFT, EVEN PAGES}
    \fancyhead[RO]{TOP RIGHT, ODD PAGES}
}

\pagestyle{plain}
\begin{document}
%Document Content.


\end{document}

For the double lines, you can do something like this.

\fancypagestyle{plain}{
       \fancyhf{} %Clear Everything.
       \fancyfoot[C]{\thepage} %Page Number
       \renewcommand{\headrule}{\hrule height 2pt \vspace{1mm}\hrule height 1pt}
       \renewcommand{\footrulewidth}{1pt}
       \fancyfoot[L]{BOTTOM LEFT}
       \fancyfoot[R]{BOTTOM RIGHT}
       \fancyhead[LE]{TOP LEFT, EVEN PAGES}
       \fancyhead[RO]{TOP RIGHT, ODD PAGES}
}
share|improve this answer
    
That would be only one rule of 1pt on the header and one on the footer. However I want two rules or more. How to do that? –  Camil Staps Jan 6 '13 at 8:37
    
\renewcommand\headrule{\hrule height 2pt \vspace{1mm}\hrule height 1pt} –  Nicholas Hamilton Jan 6 '13 at 8:53
    
Okay, upvoted your answer but I gave the 'solved' to a new answer which is shorter. –  Camil Staps Jan 6 '13 at 9:11
    
Cool........... –  Nicholas Hamilton Jan 6 '13 at 9:18
add comment

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.