Open main menu

Command/testpage

< Command
Revision as of 10:57, 3 December 2021 by Taco (talk | contribs) (Created page with "Documentation for \testpage")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


\testpage

Summary

The command \testpage checks for free space on a page

Settings

\testpage[...][...]
[...]number
[...]dimension

Description

To keep a run of text together, test the number of lines available on the current page using \testpage[n], where n is the number of lines required. If there are not n lines available, a page break will be inserted at the location of the \testpage command.

Examples

Example 1

\setuppapersize[A8][A7,landscape]
\setuplayout[width=3cm]
\setuppaper[nx=2]
\setuparranging[XY]

\showframe

\setuphead[section][before={\testpage[3]}]

\starttext
    \section[title={Section}]
    \startitemize
    \dorecurse{5}{ \startitem List item. \stopitem }
    \stopitemize

    \dorecurse{2}{
      \section[title={Section}]
      \startitemize
      \dorecurse{3}{ \startitem List item. \stopitem }
      \stopitemize
    }

\stoptext

Notes

See also

Help from ConTeXt-Mailinglist/Forum