Text FormattingHeaders when non-numbered chapter

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
gwada74
Posts: 42
Joined: Fri Nov 26, 2010 5:28 pm

Headers when non-numbered chapter

Post by gwada74 »

Hi,

My editor is asking me to put on the odd pages headings the name of my two first chapters. But those are non-numbered chapter they are the Introduction and the Preface.

the chapter are :

Code: Select all

chapter*{Introduction}
chapter*{Preface}
I am using fancy headings and the code is :

Code: Select all

[\fancyhead{}
\fancyhead[LE]{\raggedright\itshape\nouppercase{Name of the Book}}
\fancyhead[RO]{\raggedleft\itshape\nouppercase{\leftmark}}
If I use * with chapter the even page do not have the chapter name in the headings.

Does somebody have an answer for me ?
Last edited by gwada74 on Wed Mar 16, 2011 4:28 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Headers when non-numbered chapter

Post by gmedina »

Hi,

you can use \markboth right after \chapter*:

Code: Select all

\documentclass[twoside,openany]{report}
\usepackage{fancyhdr}
\usepackage{lipsum}
\pagestyle{fancy}
\fancyhead{}
\fancyhead[LE]{\raggedright\itshape\nouppercase{Name of the Book}}
\fancyhead[RO]{\raggedleft\itshape\nouppercase{\leftmark}}

\begin{document}

\chapter*{Introduction}
\markboth{Introduction}{}
\lipsum[1-30]
\chapter{test chapter}
\lipsum[1-30]

\end{document}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
gwada74
Posts: 42
Joined: Fri Nov 26, 2010 5:28 pm

Re: Headers when non-numbered chapter

Post by gwada74 »

thank you ! it is working perfectly !
Post Reply