I often write exams of the form:

  {\bfseries \large EXAMINATION}
\cfoot{\ifincomplete{\textit{Question continues on next page.}}{}}

\ \vfill
\cfoot{\textit{This page is intentionally left blank.}}\newpage
\ \vfill 
\ \vfill 
\ \vfill

And then each of the questions are in separate files, and are of the form:

\titledquestion{First topic}
This is a question on the first topic.
\part Answer this
\part Answer that
\part Answer something else

I have just noticed that the footer on the last page of the final question incorrectly says "Question continues on next page." Having played around with things it appears that the problem is the use of \include. When I switch the \include of the last question to \input the footer looks correct. While I'm happy I can write exams this way, it's a little unsatisfactory/hacky that I can't use a standard LaTeX command like \include. Are there any other ways around this problem?

  • 1
    \include should only be used at the top level not inside an environment, you want \input here. then use \clearpage before and after each \input – David Carlisle May 11 '17 at 6:48
  • @DavidCarlisle Sounds like that's my problem (though presumably the document environment is an exception...) – beldaz May 11 '17 at 6:52
  • the document environment isn't really an environment at all (it's a syntactic trick) that is things inside every environment except document are in a tex group. – David Carlisle May 11 '17 at 6:54

\include is designed for top level constructs such as \chapters (specifically things where you need to save the document state so that units can be skipped with \includeonly). So you should use \input here. Changing the page header mid-document is most reliable at a forced page break \include uses \clearpage before and after the \included text so perhaps that is what you want here.


If you put the command \nomorequestions immediately following the last question, all should be well.

  • Thanks. This does appear to work if I put \nomorequestions at the end of the file of the final question, but not if I put it in the top-level document. That's an improvement, but limits my ability to re-order the questions. – beldaz May 11 '17 at 6:01

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.