Page Layout ⇒ Modify header rule length and maintain consistency
Modify header rule length and maintain consistency
I'm typesetting a book and there's a page layout question that I'm unable to find out how to implement. I've been modifying certain commands and environments of the book class in order to set a header rule length different from the default size (which is a length equal to \textwidth and a thickness (actually named by LaTeX as "width")). I have tried almost every aspect of fancyhdr.sty (headoffset, headrule, etc.) but I cannot get what this fake images illustrate
Left-odd page: Right-even page: Note that I use a symmetrical (sidemargin from odd to even differs) twoside layout.
I'd appreciate some help.
Thanks ppl.
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
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Modify header rule length and maintain consistency
Code: Select all
\documentclass[11pt,a4paper,english]{book}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{fancyhdr}
\usepackage{blindtext}
\usepackage{arev}
\usepackage{microtype}
\fancyhf{}
\fancyhead[LE,RO]{\bfseries\thepage}
\fancyhead[LE]{\small Author Name}
\fancyhead[RO]{\small Compilation Title}
\fancyfoot[LE,RO]{\thepage}
\renewcommand{\headrulewidth}{0.5pt}
\renewcommand{\footrulewidth}{0pt}
\fancyheadoffset[RE,LO]{-0.5\textwidth}
\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
Re: Modify header rule length and maintain consistency
Thanks localghost.