Page LayoutProblem with Headers due to '\chapter*' Command

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
ydwolf
Posts: 4
Joined: Sat Nov 05, 2011 11:49 am

Problem with Headers due to '\chapter*' Command

Post by ydwolf »

Hi,

For my thesis, I want to work with fancy headers. I used following code:

Code: Select all

\renewcommand{\chaptermark}[1]{\markright{\MakeUppercase{#1}}}
\renewcommand{\sectionmark}[1]{\markright{\thesection~#1}}

\newcommand{\headerfmt}[1]{\textsl{\textsf{#1}}}
\newcommand{\headerfmtpage}[1]{\textsf{#1}}

\fancyhf{}
\fancyhead[LE,RO]{\headerfmtpage{\thepage}}
\fancyhead[LO]{\headerfmt{\rightmark}}
\fancyhead[RE]{\headerfmt{\leftmark}}
\renewcommand{\headrulewidth}{0.5pt}
\renewcommand{\footrulewidth}{0pt}

\fancypagestyle{plain}{ % eerste bladzijde van een hoofdstuk
  \fancyhf{}
  \fancyhead[LE,RO]{\headerfmtpage{\thepage}}
  \fancyhead[LO]{\headerfmt{\rightmark}}
  \fancyhead[RE]{\headerfmt{\leftmark}}
  \renewcommand{\headrulewidth}{0.5pt}
  \renewcommand{\footrulewidth}{0pt}
}
But the problem is, this doesn't work because I am using the \chapter* command, so latex doesn't capture my chapter* titles. Can somebody tell me what to do? Tnx!
Last edited by localghost on Sat Nov 05, 2011 11:59 am, edited 1 time in total.

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
Stefan Kottwitz
Site Admin
Posts: 10348
Joined: Mon Mar 10, 2008 9:44 pm

Re: Problem with Headers due to '\chapter*' Command

Post by Stefan Kottwitz »

Hi,

after \chapter* you can call \chaptermark manually.

Stefan
LaTeX.org admin
ydwolf
Posts: 4
Joined: Sat Nov 05, 2011 11:49 am

Problem with Headers due to '\chapter*' Command

Post by ydwolf »

Tnx for your reply.
But how should I do that exactly?
The following doesn't seem to work.

Code: Select all

\chapter*{1. Inleiding}
\renewcommand{\chaptermark}[1]{\markright{\MakeUppercase{#1}}}
This either:

Code: Select all

\chapter*{{\chaptermark}[1]{\markright{\MakeUppercase{#1}} 1. Inleiding}
Should I still put this command in my preamble?

Code: Select all

\renewcommand{\chaptermark}[1]{\markright{\MakeUppercase{#1}}}
Last edited by Stefan Kottwitz on Sat Nov 05, 2011 2:17 pm, edited 1 time in total.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10348
Joined: Mon Mar 10, 2008 9:44 pm

Problem with Headers due to '\chapter*' Command

Post by Stefan Kottwitz »

Call it, don't redefine it:

Code: Select all

\chapter*{1. Inleiding}
\chaptermark{1. Inleiding}
The redefinition belongs to the preamble, keep it there.

However, it's unusual to do manual numbering with \chapter*. \chapter* is for unnumbered headings, \chapter for numbered.

Stefan
LaTeX.org admin
Post Reply