I have a strange problem with fancyhdr and report (KOMA) together with child documents. Individually for each child document, the headers are like I want them to be, but when I compile them all through my master document, all headers are lost and I am left with the default style (empty header, page number in footer)

I have checked that all options are identical for all children and the master.

I am using Lyx 2.0.5 and the document class is 'report (KOMA)' for all children and the master.

EDIT: Just tried to compile it using the standard 'report' document class and now it worked. This must mean that the problem is related to the KOMA script.

This is my preamble


\renewcommand{\sectionmark}[1]{\markright{\thesection.\ #1}}

\renewcommand{\chaptermark}[1]{\markboth{\thechapter.\ #1}{}}
\fancyhead[RE]{\bfseries \leftmark}

\fancyhead[RO,LE]{\bfseries \thepage}

As mentioned, it works fine for the individual documents, but not for the master.

Does anyone know what could be the problem?

  • KOMA works well with scrpage2. I recommend to use it instead of fancyhdr. Jun 24, 2013 at 18:52

1 Answer 1


I found the cause of the problem.

The first child document was a document containing front matter. For that reason I had set \pagestyle{plain} to avoid headers and footers on the first pages with Table of Contents, preface, abstract etc.

I was not aware that this command is not for a single page only, but for the rest of the document or until a new command is given. On the first page after the front matter I then set \pagestyle{fancy} to include fancyhdr headers and footers and everything worked fine.

This was of course the reason why it worked with the child documents individually - there was no pagestyle change.

  • To change the behaviour of a single page you have to use \thispagestyle. See this answer of mine. Jun 24, 2013 at 18:55
  • Good point, forgot that. In my case, however, I needed to change the behaviour of several pages (all of the front matter), so it's probably easier with the two \pagestyle{}
    – Kaspar H
    Aug 4, 2013 at 14:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .