Command/blank

From ConTeXt wiki

\blank

Syntax

\blank[...,...,...]
[...,...,...] small medium big nowhite back white disable force reset line halfline formula fixed flexible none samepage dimension

Description

Insert vertical blank space. A keyword can be added to specify that the whitespace should have a certain height, such as [small], [medium], or [big].

The keyword [disable] disables the next \blank[...], and the key [back] undoes a \blank[...] directly preceding it.

Keywords accept multipliers: to insert whitespace as large as four lines, for example, type \blank[4*big].

The following table gives an overview of what skip is actually inserted for the amount specified. To maintain grid consistency the amount differ if gridsnapping is enabled. You may notice that all of these values are not given in absolute units. This is due to the fact that vertical spacing is and should be dependent on the current font size (except \zeropoint which is always 0pt).

Amount Without gridsnapping With gridsnapping
none \zeropoint \zeropoint
big \bigskipamount \bodyfontlineheight
medium \medskipamount .5\bodyfontlineheight
small \smallskipamount .25\bodyfontlineheight
line \openlineheight \bodyfontlineheight
halfline .5\openlineheight .5\bodyfontlineheight
quarterline .25\openlineheight .25\bodyfontlineheight
formula \medskipamount .5\bodyfontlineheight
white \parskip \bodyfontwhitespace
height \strutht \bodyfontstrutheight
depth \strutdp \bodyfontstrutdepth
standard .75\openlineheight .75\openlineheight

In addition to the amount there are flags which modify the behaviour of how space is placed. The following table given an overview.

Method Meaning
preference good break (\penalty-500)
samepage no break (\penalty10000)
max only of larger
force force even if smaller
disable ignore following
nowhite kill whitespace
back discard previous

All values are defined in spac-ver.mkiv.

See also

Help from ConTeXt-Mailinglist/Forum

All issues with:

Example

\enableregime[utf]

% To fit all the examples on one page, we need a taller page
\definepapersize[tall][width=15cm, height=35cm]
\setuppapersize[tall]

The table below has a row for each \type{\blank[#1]} keyword, and three columns: 
\startitemize[packed]
    \item column 1 demonstrates \type{\blank[#1]} on its own;
    \item column 2 shows what \type{\blank[#1]} does when it comes after a \type{\blank[medium]};
    \item column 3 shows what does \type{\blank[#1]} when it comes before a \type{\blank[medium]}.
\stopitemize

\defineparagraphs[whiting]
    [n=3,
    before={\blank[none]},     % Minimal padding, please.
    after={\blank[nowhite]}]   %

\definestartstop[whiteafter][
    before={\blank[none]} ,    % No padding, please
    after={\blank[medium]}     % The blank of interest
    ]
\definestartstop[whitebefore]
    [before={\blank[medium]},  % The blank of interest
    after={\blank[none]}       % No padding, please
    ]

\def\example#1{%
    \startwhiting
        \type{#1} \crlf
        Antelope, caribou, ocelot.
        \blank[#1]
        Don’t want an antelope nibbling the hoops.
    \whiting
        medium + {\tt #1}  
        % No crlf here, or it'll combine with \blank[none] to create a blank line anyway. 
        % (I assume it's equivalent to \crlf\crlf, or something.)
        \startwhiteafter
            Antelope, caribou, ocelot.
        \stopwhiteafter
        \blank[#1]
        Don’t want an antelope nibbling the hoops.
    \whiting
        {\tt #1} + medium \crlf
        Antelope, caribou, ocelot.
        \blank[#1]
        \startwhitebefore
            Don’t want an antelope nibbling the hoops.
        \stopwhitebefore
    \stopwhiting
    \hairline
}

\starttext

\example{small}
\example{medium}
\example{big}
\example{nowhite}
\example{back}
\example{white}
\example{disable}
\example{reset}     % doesn’t seem to work with mkiv
\example{line}
\example{halfline}
\example{formula}
%\example{fixed}    % mkiv only?
%\example{flexible} % mkiv only?
\example{none}
%\example{samepage} % mkiv only?

\stoptext