When designing some documents, I hope I can set a global layout and another layout for the first page of all chapters. I have defined two layouts as follows:


% global layout for the whole document

% layout for the first page of Chapters

\chapter{First Chapter}
I am in the first page.
I am in the second page.

Now the question is that how I can apply this firstpage layout to the first page of the chapter First Chapter and switch back to the global layout after the first page of this chapter?


You can use \setuphead and the before key to change the layout when a new chapter starts. The setting is reset to the default value when a page is shipped out.

\setuppapersize [A6]  %% only for screenshot



\starttexdefinition ChapterPageHook

  \startchapter [title=First Chapter]
  I am in the first page. \page
  I am in the second page.

  \startchapter [title=Second Chapter]
  I am in the first page. \page
  I am in the second page.


  • \adpatlayout is simpler than the \appendtoks jugglary. – Aditya Aug 4 '13 at 22:07
  • @Aditya \adaptlayout only adjusts the text height. It does not allow to select a different layout, if I'm not mistaken. I tried to simplify the OPs code. Varying the text height probably wasn't the best choice. – Marco Aug 4 '13 at 22:21
  • You are right. \adaptlayout only checks for height and lines keys. However, one must use \setuplayout[reset] with care. In particular if the main layout is activated using \definelayout[name][...] followed by \setuplayout[name], then \setuplayout[reset] will reset to default layout rather than name layout. – Aditya Aug 5 '13 at 0:30
  • With headerdistance=1cm in the firstpagelayout, the textheight is reduced in all following pages. Is there any way to circumvent this? – tstenner May 3 at 13:07
  • Even with this MWE, try replacing the text ("I am…") with \the\textheight – the frame is larger, but the area for text is shrunk for all pages – tstenner May 6 at 12:54

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.