I have a problem with the book,twoside documentclass and the headings in the respective second chapterpages.
In \frontmatter I use Abstract and Acknowledgements. In the \mainmatter I use Contents, Introduction, ...
Now I want to set the header for the frontmatter for example without the chapternumber \thechapter and the header in the mainmatter with the chapternumber.
Is there a way to do it like this?
I tried
\if@mainmatter
\renewcommand\chaptermark[1]{\markboth{\textsc{\thechapter\ #1}}{}}
\else
\renewcommand\chaptermark[1]{\markboth{\textsc{#1}}{}}
\fi
But it always displays the else branch.
Here is a MWE to show my problem.
\documentclass[12pt,a4paper,twoside]{book}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[ngerman,english]{babel}
\usepackage{blindtext}
\if@mainmatter
\renewcommand\chaptermark[1]{\markboth{\textsc{\thechapter\ #1}}{}}%
\else
\renewcommand\chaptermark[1]{\markboth{\textsc{#1}}{}}%
\fi
\begin{document}
\frontmatter
\chapter{Abstract}
\blindtext[4]
\chapter{Achknowledgements}
\blindtext[10]
\mainmatter
\tableofcontents
\chapter{Introduction}
\blindtext[15]
\end{document}
Thanks
\if@mainmatterinside the redefinition:\makeatletter \renewcommand\chaptermark[1]{\if@mainmatter ...\else ...\fi} \makeatother. Note that this does not affect the header entry of the table of contents. – esdd Nov 09 '16 at 13:09\makeatletter\makeatother:( now it works damn – dokukaefer Nov 09 '16 at 13:13\scshapetoo. – esdd Nov 09 '16 at 14:17