Page LayoutFacyhdr: Remove dot after section number

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
Gyatso
Posts: 2
Joined: Tue Mar 25, 2014 11:11 am

Facyhdr: Remove dot after section number

Post by Gyatso »

I'm almost done with the fine tuning of my document, but there remains one unsolved mystery to me. I can break it down to this MWE

Code: Select all

\documentclass[12pt]{report}

\usepackage{fancyhdr}

\pagestyle{fancy}
\fancyhf{}
\fancyhead[R]{\nouppercase {\rightmark}}
\fancyfoot[C]{\thepage}
\setlength{\headheight}{14.5pt}

\usepackage{blindtext}

\begin{document}
\pagestyle{fancy}

\chapter{Some Chapter}
\section{Some Section}
\blindtext
\blindtext
\blindtext
\blindtext
\blindtext
\end{document}
As you can see, in the header it gives "1.1. Some Section" where it should be "1.1 Some Section" (Note the missing dot ofter the second 1!)

Any idea on how to remove it? I don't understand how it ends up there anyway, as it does not appear in the text itself...

Thanks for your help!

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

esdd
Posts: 36
Joined: Sat Jan 25, 2014 9:13 pm

Facyhdr: Remove dot after section number

Post by esdd »

Redefine \sectionmark without ending dot

Code: Select all

\documentclass[12pt]{report}

\usepackage{fancyhdr}

\pagestyle{fancy}
\fancyhf{}
\fancyhead[R]{\rightmark}
\fancyfoot[C]{\thepage}
\setlength{\headheight}{14.5pt}
\renewcommand\sectionmark[1]{%
  \markright{\thesection\ #1}}

\usepackage{blindtext}

\begin{document}
\pagestyle{fancy}

\blinddocument
\blinddocument
\end{document}
Best regards
Elke
Gyatso
Posts: 2
Joined: Tue Mar 25, 2014 11:11 am

Re: Facyhdr: Remove dot after section number

Post by Gyatso »

That's perfect! Thank you! I had found something like that for \chaptermark but was never quite able to adapt it for the section.
Post Reply