LaTeX forum ⇒ Page LayoutFacyhdr: Remove dot after section number Topic is solved

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

Facyhdr: Remove dot after section number

Postby Gyatso » Tue Mar 25, 2014 11:24 am

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

  1. \documentclass[12pt]{report}
  2.  
  3. \usepackage{fancyhdr}
  4.  
  5. \pagestyle{fancy}
  6. \fancyhf{}
  7. \fancyhead[R]{\nouppercase {\rightmark}}
  8. \fancyfoot[C]{\thepage}
  9. \setlength{\headheight}{14.5pt}
  10.  
  11. \usepackage{blindtext}
  12.  
  13. \begin{document}
  14. \pagestyle{fancy}
  15.  
  16. \chapter{Some Chapter}
  17. \section{Some Section}
  18. \blindtext
  19. \blindtext
  20. \blindtext
  21. \blindtext
  22. \blindtext
  23. \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!

Tags:

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

Postby esdd » Tue Mar 25, 2014 12:15 pm

Redefine \sectionmark without ending dot

  1. \documentclass[12pt]{report}
  2.  
  3. \usepackage{fancyhdr}
  4.  
  5. \pagestyle{fancy}
  6. \fancyhf{}
  7. \fancyhead[R]{\rightmark}
  8. \fancyfoot[C]{\thepage}
  9. \setlength{\headheight}{14.5pt}
  10. \renewcommand\sectionmark[1]{%
  11. \markright{\thesection\ #1}}
  12.  
  13. \usepackage{blindtext}
  14.  
  15. \begin{document}
  16. \pagestyle{fancy}
  17.  
  18. \blinddocument
  19. \blinddocument
  20. \end{document}


Best regards
Elke

Gyatso
Posts: 2
Joined: Tue Mar 25, 2014 11:11 am

Postby Gyatso » Tue Mar 25, 2014 12:18 pm

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


Return to “Page Layout”

Who is online

Users browsing this forum: No registered users and 4 guests