Page Layoutfancyhdr | Spaces in running Title

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
Ailicec
Posts: 18
Joined: Wed Jan 18, 2012 12:16 pm

fancyhdr | Spaces in running Title

Post by Ailicec »

Hello,

I am using fancyhdr and am trying to input a space between the different marks.

So I have

Code: Select all

\fancyhead[L]{\textit \chaptername \textit\thechapter: \textit \leftmark}
Which is giving me: Chapter1: Introduction

And I need Chapter 1: Introduction (i.e. a space between Chapter and the chapter number).

Thank you

Recommended reading 2024:

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

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

User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

fancyhdr | Spaces in running Title

Post by localghost »

You have to add a backslash (or a pair of curly braces) behind the \chaptername command.

Code: Select all

\fancyhead[L]{\itshape \chaptername\ \thechapter: \leftmark}

Best regards and welcome to the board
Thorsten
Ailicec
Posts: 18
Joined: Wed Jan 18, 2012 12:16 pm

fancyhdr | Spaces in running Title

Post by Ailicec »

localghost wrote:You have to add a backslash (or a pair of curly braces) behind the \chaptername command.

Code: Select all

\fancyhead[L]{\itshape \chaptername\ \thechapter: \leftmark}

Best regards and welcome to the board
Thorsten
Thank you. I knew it must be a simple thing but I could not find it
User avatar
Stefan Kottwitz
Site Admin
Posts: 10348
Joined: Mon Mar 10, 2008 9:44 pm

Re: fancyhdr | Spaces in running Title

Post by Stefan Kottwitz »

A space directly after a control sequence (command, macro) marks the end and doesn't work as white space. Besides \ , it would also work if you would write \chaptername{}, inserting an "atom" {}.

Stefan
LaTeX.org admin
Post Reply