TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to use the afterpage package to automatically insert text at the top of each page (please see my other question Section reminders at the top of each page?) but I'm having trouble.

Sometimes I get unlucky and a list environment starts just before a page break. The first \item doesn't appear until just after the page break. When this happens, LaTeX gives me a "missing \item" error message because \afterpage is inserting text right after the start of a list environment.

Here is a minimal example that emulates the problem I'm seeing:

before list
\item an item
after list

If I remove that \clearpage, then everything works as expected.

Is there something I can pass to \afterpage that would temporarily reset TeX's state so that I can safely insert some vertical mode material (e.g., a minipage) at the top of the next page without interfering with environments that span pages?

share|improve this question
up vote 6 down vote accepted

gets rid of the error but it depends what you want the spacing to be....

This does allow vertical material for example


some more}}}
share|improve this answer
that worked beautifully, thank you! – Richard Hansen Apr 8 '12 at 23:54

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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