Changes

Jump to navigation Jump to search
1,879 bytes added ,  10:57, 3 December 2021
Created page with "Documentation for \testpage"
<cd:commandgroup name="testpage" xmlns:cd="http://wiki.contextgarden.net/commanddoc/20200807">
<cd:shortdesc>The command <tt>\testpage</tt> checks for free space on a page
</cd:shortdesc>
<cd:variants>
<cd:command category="structure" file="page-brk.mkiv" interfacedate="2020-07-14T09:24" interfacefile="i-pagebreak.xml" level="document" name="testpage" variantnumber="1">
<cd:arguments>
<cd:keywords ordinal="1">
<cd:keywordsdoc></cd:keywordsdoc>
<cd:constant type="cd:number"></cd:constant>
</cd:keywords>
<cd:keywords optional="yes" ordinal="2">
<cd:keywordsdoc></cd:keywordsdoc>
<cd:constant type="cd:dimension"></cd:constant>
</cd:keywords>
</cd:arguments>
</cd:command>
</cd:variants>
<cd:description>To keep a run of text together, test the number of lines available on the current page using {{cmd|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 {{cmd|testpage}} command.
</cd:description>
<cd:examples><cd:example title=""><context source="yes">
\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
</context></cd:example></cd:examples>
<cd:notes></cd:notes>
<cd:seealso>
<cd:source file="page-brk.mkiv" originator="system"></cd:source>
<cd:wikipage originator="system" page="Category:Structure"></cd:wikipage>
<cd:commandref name="testcolumn"></cd:commandref>
<cd:commandref name="page"></cd:commandref></cd:seealso>
</cd:commandgroup>

Navigation menu