Fabrice Couvreur schrieb am 27.08.2021 um 10:04: > Hi Wolfgang, > This may not be nicest but seems to work > Fabrice > > %%%%%%%%%%%%%%%%%%%%%% > > \definelayout > [1] >   [header=10mm] > > \setuplayout >   [header=0pt, >  height=middle] > > \setuppagenumbering > [alternative=doublesided,location=] > > \setupbackgrounds > [header] >   [text] >   [frame=off,bottomframe=on, >  framecolor=lightgray,rulethickness=1pt] > > \startsetups[header] > \doifelse{\totalnumberofpages}{1} >     {\setuplayout[1]} > {\setuplayout[reset]} > \stopsetups > > > \starttext > \input knuth > %\dorecurse{10}{\input knuth\par} > \stoptext I have no idea what you try to achieve but the check for the number of pages in your document is never used. The layout on the first page is different from the following pages but this is just how \definelayout work when you use a number as first argument. What you have to understand is that a setups-environment is just a macro definition where you provide the names as argument to the start command. This means     \startsetups [header]     ...     \stopsetups works the same way as     \def\internalname_header       {...} but you have to use     \setups [header] rather than     \internalname_header to get the content of the environment. Wolfgang