Page Layout ⇒ Double Rule in Header
Double Rule in Header
=========================================
two-line style, solid line, the above one is thicker than the bottom one, with 1pt vertical space in between.
Is this possible to achieve? How to change the \headrule for this purpose?
I've looked up in Internet but I can't find a solution. Please help me. Any comment is appreciated. Thank you.
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Double Rule in Header
Code: Select all
\documentclass[11pt,english]{article}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage{fancyhdr}
\usepackage{blindtext}
\makeatletter
\def\headrule{{%
\if@fancyplain\let\headrulewidth\plainheadrulewidth\fi
\hrule\@height\headrulewidth\@width\headwidth\vskip2pt%
\hrule\@height\headrulewidth\@width\headwidth\vskip-\headrulewidth\vskip-4pt
}}
\makeatother
\pagestyle{fancy}
\begin{document}
\blinddocument
\end{document}
Best regards and welcome to the board
Thorsten
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Double Rule in Header
Thank you again, Thorsten.

Code: Select all
\documentclass[11pt,english]{report}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage{fancyhdr}
\usepackage{blindtext}
\makeatletter
\def\headrule{{%
\if@fancyplain\let\headrulewidth\plainheadrulewidth\fi
\hrule\@height\footrulewidth\@width\headwidth\vskip1pt%
\hrule\@height\headrulewidth\@width\headwidth\vskip-\headrulewidth\vskip-4pt
}}
%
\def\footrule{{%
\if@fancyplain\let\footrulewidth\plainfootrulewidth\fi
\vskip-\footruleskip\vskip-\footrulewidth
\hrule\@height\headrulewidth\@width\headwidth\vskip1pt%
\hrule\@height\footrulewidth\@width\headwidth\vskip\footruleskip
}}
\makeatother
\pagestyle{fancy}
%
\renewcommand{\headrulewidth}{1.5pt}
\renewcommand{\footrulewidth}{0.5pt}
%
\begin{document}
\blinddocument
\end{document}
Double Rule in Header
Solved my big problem that lasted for days, Mine required two head rules, the top being very thin compared to the thick one at the bottom, so this is what i used to get them into my latex fancy head. I simply added this code to my preamble.
Code: Select all
\def\headrule{{%
\if@fancyplain\let\headrulewidth \plainheadrulewidth \fi
\hrule\@height\headrulewidth height 0.5pt\@width\headwidth\vskip2pt %
\hrule\@height\headrulewidth height 3pt \@width \headwidth\vskip-\headrulewidth\vskip-4pt %height2pt
}}
height 3pt
.