When I put two or more TeX files together with the subfiles package, the header disappears on the last pages of the included files. Why is that?

The Root.tex file:




The used subfiles have the same content and are named test1.tex and test2.tex:


  • Take a look, whether standalone could be a better choice instead of subfiles.
    – Speravir
    Oct 18, 2013 at 0:49

1 Answer 1


After nobody answered here, I have asked Markus Kohm on komascript.de (in German: “Kopfzeile verschwindet mit scrpage2 mit subfiles Paket”).

As I understood to keep it local, insert an \clearpage at the end of each subfile will solve the problem.

He also mentioned an global solution which is the following code (insert in root preamble):

  • You should also mention the consequence of this ungrouping/globalization: Former local settings of subfiles will turn general.
    – Speravir
    Oct 18, 2013 at 0:59
  • And perhaps change to Community Wiki (edit answer, look at he end), because it’s Markus’ work?
    – Speravir
    Oct 18, 2013 at 1:02
  • Of course it's Markus' work. What is it about, the community wiki? Oct 18, 2013 at 7:11
  • It’s a special post category, meant for easier collaborating, but with the effect, to one does not earn reputation from such posts, see Privileges - edit community wiki.
    – Speravir
    Oct 18, 2013 at 21:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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