0

This question already has an answer here:

I am working on my thesis, using small parts of the exisiting template of my university. There, the head line is defined like in the MWE. Since I included a table of contents, list of figures and some smaller one page chapters numbered with roman letters before the actual dissertation begins, the following problem really disappoint me.

Somehow the head and especially the number(wheter roman or arabic) are not displayed on pages starting with a new chapter, including all of the examples I mentioned above. So basically there are some pages at the beginning without any head, altough their location is stated correctly in the table of contents.

I am pretty sure that it has to do with the definition of the pagestyle, but I could not solve it on my own.

I would like to have a head everywhere, except of the front page and empty pages in between chapters, as induced by \cleardoublepage .

Here is the MWE:

\documentclass[12pt,
listof=totoc, 
bibliography=totoc,
listof=chapterentry] 
{scrbook} 
\usepackage{a4wide}

\usepackage{fancyhdr}
\usepackage{blindtext}

\pagestyle{fancyplain}
\renewcommand{\chaptermark}[1]%
         {\markboth{\thechapter.\ #1}{}}
\renewcommand{\sectionmark}[1]%
         {\markright{\thesection\ #1}}
\lhead[\fancyplain{}{\bfseries\thepage}]%
    {\fancyplain{}{\bfseries\rightmark}}
\rhead[\fancyplain{}{\bfseries\leftmark}]%
    {\fancyplain{}{\bfseries\thepage}}
\cfoot{}


\begin{document}


\chapter{chapter without numbers}

\blindtext

\section{a section}

\Blindtext

\chapter{another chapter}

\Blindtext

\end{document}

marked as duplicate by Stefan Pinnow, Community Oct 26 '17 at 14:53

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • Please note, that using fancyhdr with a KOMA-Script class is not really recommended or only if you know, what you are doing. Usage of scrlayer-scrpage would be more recommended. Moreover, package a4wide is one of the packages, listed in l2tabu as do not use. – Schweinebacke Oct 26 '17 at 13:07
  • Also related: tex.stackexchange.com/questions/114956/… – Schweinebacke Oct 26 '17 at 13:11
0

With KOMA-Script you could change \chapterpagestyle and, e.g., double the first argument of \markboth into the second one at \chaptermark:

\documentclass[12pt,
listof=totoc, 
bibliography=totoc,
listof=chapterentry] 
{scrbook} 
\usepackage{a4wide}

\usepackage{fancyhdr}
\usepackage{blindtext}

\pagestyle{fancyplain}
\renewcommand{\chaptermark}[1]%
         {\markboth{\thechapter.\ #1}{}}
\renewcommand{\sectionmark}[1]%
         {\markright{\thesection\ #1}}
\lhead[\fancyplain{}{\bfseries\thepage}]%
    {\fancyplain{}{\bfseries\rightmark}}
\rhead[\fancyplain{}{\bfseries\leftmark}]%
    {\fancyplain{}{\bfseries\thepage}}
\cfoot{}


\begin{document}


\chapter{chapter without numbers}

\blindtext

\section{a section}

\Blindtext

\chapter{another chapter}

\Blindtext

\end{document}

However, I would recommend to use scrlayer-scrpage instead of fancyhdr, e.g.:

\documentclass[12pt,
listof=totoc, 
bibliography=totoc,
listof=chapterentry,
DIV=12,% instead of a4wide
headsepline,
] 
{scrbook} 
\usepackage{blindtext}

\usepackage[automark]{scrlayer-scrpage}
\clearpairofpagestyles
\setkomafont{pageheadfoot}{\bfseries}
\ihead{\ifstr{\headmark}{}{\leftmark}{\headmark}}
\ohead*{\pagemark}

\renewcommand*{\chapterpagestyle}{headings}

\begin{document}


\chapter{chapter without numbers}

\blindtext

\section{a section}

\Blindtext

\chapter{another chapter}

\Blindtext

\end{document}

no difference in page style of chapter pages

And I, myself, would prefer

\documentclass[12pt,
listof=totoc, 
bibliography=totoc,
listof=chapterentry,
DIV=12,% instead of a4wide
headsepline,plainheadsepline,
] 
{scrbook} 
\usepackage{blindtext}

\usepackage[automark]{scrlayer-scrpage}
\clearpairofpagestyles
\setkomafont{pageheadfoot}{\bfseries}
\ihead{\leftmark}
\ohead*{\pagemark}

\begin{document}

\chapter{chapter without numbers}

\blindtext

\section{a section}

\Blindtext

\chapter{another chapter}

\Blindtext

\end{document}

left an right page

  • This workred perfectly, thanks. a4wide was stated in the university template (LMU Munich for my fellow colleagues who may encounter the same issue), and I think the template could use a new revision since it is from 2002... However, I am not quite sure wheter to use your 2nd or 3rd example, since both look good to me. I will decide on that when I have finished. – devvok Oct 26 '17 at 14:57

Not the answer you're looking for? Browse other questions tagged or ask your own question.