Difference between revisions of "Command/testcolumn"

From ConTeXt wiki
 
Line 4: Line 4:
 
}}
 
}}
  
== [[Help:Reference|Syntax]] (autogenerated)] ==
+
== [[Help:Reference|Syntax]] (autogenerated) ==
 
<syntax>testcolumn</syntax>
 
<syntax>testcolumn</syntax>
 +
== [[Help:Reference|Syntax]] ==
  
 
== Description ==
 
== Description ==

Latest revision as of 14:31, 13 October 2019

\testcolumn

Syntax (autogenerated)

\testcolumn[...][...]
[...]number
[...]dimension


Syntax

Description

Under columnsets (in mkii), but not under mixedcolumns (mkiv), \testcolumn[n] causes a column break if there are not at least n lines of space remaining in the current column.

This helps avoid orphans (clubs) at the bottom of columns, by ensuring sufficient room for a given number of lines prior to starting a new heading or paragraph.

Example

In the following example, before={\testcolumn[3]} prevents a section title orphan.

% mode=mkiv
\setuphead[section][
  number=no,
  before={\testcolumn[3]},
]

\defineitemgroup[ListContent]
\setupitemgroup[ListContent][each][packed][
  width=\zeropoint,
  before={\empty},
  after={\vskip0.5em},
  symbol=,
]

\starttext
  \blackrule[width=\textwidth,height=1pt]

  \startmixedcolumns[balance=yes,grid=strut]
    \section[title={Section}]
    \startListContent
    \dorecurse{6}{ \startitem List item. \stopitem }
    \stopListContent

    \dorecurse{2}{
      \section[title={Section}]
      \startListContent
      \dorecurse{3}{ \startitem List item. \stopitem }
      \stopListContent
    }
  \stopmixedcolumns

  \blackrule[width=\textwidth,height=1pt]
\stoptext

This produces:

See also

Help from ConTeXt-Mailinglist/Forum

All issues with: