I was thinking about your problem and finally I really understood what you want.
Please be aware of the differences between foreword, preface, and introduction.
I've been asking google and found this: Creating unnumbered chapters/sections (plus adding them to the ToC and/or header).
Please take a look at it, read it, understand it, test it, be satisfied and then post a minimal working example containing the solution.
Page Layout ⇒ Remove Chapter Prefix from Foreword and Afterword Headers
- Johannes_B
- Site Moderator
- Posts: 4182
- Joined: Thu Nov 01, 2012 4:08 pm
Remove Chapter Prefix from Foreword and Afterword Headers
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
NEW: TikZ book now 40% off at Amazon.com for a short time.

Remove Chapter Prefix from Foreword and Afterword Headers
Oops... for me they're all the sameJohannes_B wrote:I was thinking about your problem and finally I really understood what you want.
Please be aware of the differences between foreword, preface, and introduction.

Making the foreword/afterword unnumbered is of no use to me, because I do want them to be added to the table of contents. Instead,Johannes_B wrote:I've been asking google and found this: Creating unnumbered chapters/sections (plus adding them to the ToC and/or header).
Please take a look at it, read it, understand it, test it, be satisfied and then post a minimal working example containing the solution.
\markboth
is what I need. So:Code: Select all
\documentclass[12pt,a4paper]{book}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhead{}
\fancyhead[LE]{\leftmark}
\fancyhead[RO]{\rightmark}
\usepackage{fontspec}
\defaultfontfeatures{Mapping=tex-text}
\setmainfont{Linux Libertine G}
\usepackage{polyglossia}
\setmainlanguage{english}
\usepackage{xunicode}
\usepackage{xltxtra}
\usepackage{bookmark}
\begin{document}
\frontmatter
\tableofcontents
\chapter{Foreword}
\markboth{FOREWORD}{} % Right pages left without header because there are no sections
\mainmatter
\chapter{Bees}
\chapter{Wasps}
\chapter{Flies}
\chapter{Mosquitoes}
\chapter{Butterflies}
\chapter{Hornets}
\chapter{Midges}
\backmatter
\chapter{Afterword}
\markboth{AFTERWORD}{} % Right pages left without header because there are no sections
\end{document}
\markright
manually for every section?Thank you anyway for your essential advice.
- Johannes_B
- Site Moderator
- Posts: 4182
- Joined: Thu Nov 01, 2012 4:08 pm
Remove Chapter Prefix from Foreword and Afterword Headers
.AleCes wrote:Should I use\markright
manually for every section?
No, I don't think so. Just give it a try.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Remove Chapter Prefix from Foreword and Afterword Headers
You're right, no need to do so. Thank you very much.Johannes_B wrote:.AleCes wrote:Should I use\markright
manually for every section?
No, I don't think so. Just give it a try.