I want to trigger a macro after automatic page break. I have tried the everypage package, but the \AddEverypageHook{} seems to only work on background layer. What I want is for the macro to execute in the main text.

  • Something like in tex.stackexchange.com/a/166155 ?
    – user194703
    Dec 16 '19 at 5:35
  • 2
    Load atbegshi and then \AtBeginShipout{This is written on every new page}.
    – CarLaTeX
    Dec 16 '19 at 5:52
  • 2
    note that all macros are expanded and all line breaking completed well before page breaks are considered so you can not insert text in the main text run, affecting the main paragraph text, at a page break. Dec 16 '19 at 8:05
  • @CarLaTeX It works a treat! Thanks! Dec 16 '19 at 16:44
  • Yes @Schrödinger'scat exactly like that. Dec 16 '19 at 16:44

Your Answer

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

Browse other questions tagged or ask your own question.