Page Layout ⇒ Header/Footer Problem
Header/Footer Problem
\usepackage{fancyhdr}
\setlength{\headheight}{15pt}
\pagestyle{fancy}
\fancyhf{}
\fancyfoot{}
\renewcommand{\chaptermark}[1]{\markboth{#1}{}}
\fancyhead[RO]{\series \nouppercase \leftmark}
\fancyhead[LE]{\series {\MakeUppercase\chaptername \ \thechapter} \rightmark}
\fancyfoot[LE,RO]{\thepage}
Any help you can provide would be greatly appreciated!
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
Header/Footer Problem
Code: Select all
\documentclass[11pt,a4paper,english]{book}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage[pagestyles]{titlesec}
\usepackage{blindtext}
\usepackage{lmodern}
\usepackage{microtype}
\newpagestyle{main}{%
\sethead[\MakeUppercase{\chaptername}\quad\thechapter][][]{}{}{\chaptertitle}
\setfoot[\thepage][][]{}{}{\thepage}
\headrule
}
\assignpagestyle{\chapter}{main}
\pagestyle{main}
\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