Changes

Jump to navigation Jump to search
7,881 bytes added ,  18:30, 13 September 2020
Created page with "Documentation for \blank"
<cd:commandgroup name="blank" xmlns:cd="http://wiki.contextgarden.net/commanddoc/20200807">
<cd:shortdesc>The command <tt>\blank</tt> is used for inserting vertical blank space.
</cd:shortdesc>
<cd:variants>
<cd:command category="whitespace" file="spac-ver.mkiv" interfacedate="2019-11-19T09:54" interfacefile="i-vspace.xml" level="document" name="blank" variantnumber="1">
<cd:arguments>
<cd:keywords list="yes" optional="yes" ordinal="1">
<cd:keywordsdoc>The first set of options are behaviour modifiers. Starting with <cd:iref name="none"/> there are size options.</cd:keywordsdoc>
<cd:constant type="preference">good break (shortcut for <code>penalty:-500</code>)</cd:constant>
<cd:constant type="samepage">no break (shortcut for <code>penalty:10000</code>)
</cd:constant>
<cd:constant type="max">only if larger</cd:constant>
<cd:constant type="force">force even if smaller</cd:constant>
<cd:constant type="enable"></cd:constant>
<cd:constant type="disable">ignore following</cd:constant>
<cd:constant type="nowhite">kill whitespace</cd:constant>
<cd:constant type="packed">does not add whitespace but prohibits <code>\parskip</code></cd:constant>
<cd:constant type="back">discard previous blank</cd:constant>
<cd:constant type="overlay"></cd:constant>
<cd:constant type="always"></cd:constant>
<cd:constant type="weak">shortcut for <code>order:0</code></cd:constant>
<cd:constant type="strong">shortcut for <code>order:100</code></cd:constant>
<cd:constant type="default">alias for <code>white</code></cd:constant>
<cd:constant type="before"></cd:constant>
<cd:constant type="inbetween"></cd:constant>
<cd:constant type="after"></cd:constant>
<cd:constant type="fixed"></cd:constant>
<cd:constant type="flexible"></cd:constant>
<cd:constant type="none"><code>\zeropoint</code></cd:constant>
<cd:constant type="small"><code>\smallskipamount</code> / <code>.25\bodyfontlineheight</code> with grid</cd:constant>
<cd:constant type="medium"><code>\medskipamount</code> / <code>.5\bodyfontlineheight</code> with grid</cd:constant>
<cd:constant type="big"><code>\bigskipamount</code> / <code>\bodyfontlineheight</code> with grid</cd:constant>
<cd:constant type="line"><code>\openlineheight</code> / <code>\bodyfontlineheight</code> with grid
</cd:constant>
<cd:constant type="halfline"><code>.5\openlineheight</code> / <code>.5\bodyfontlineheight</code> with grid
</cd:constant>
<cd:constant type="quarterline"><code>.25\openlineheight</code> / <code>.25\bodyfontlineheight</code> with grid
</cd:constant>
<cd:constant type="formula"><code>\medskipamount</code> / <code>.5\bodyfontlineheight</code> with grid</cd:constant>
<cd:constant type="white"><code>\parskip</code> / <code>\bodyfontwhitespace</code> with grid</cd:constant>
<cd:constant type="height"><code>\strutht</code> / <code>\bodyfontstrutheight</code> with grid</cd:constant>
<cd:constant type="depth"><code>\strutdp</code> / <code>\bodyfontstrutdepth</code> with grid</cd:constant>
<cd:constant type="standard"><code>.75\openlineheight</code></cd:constant>
<cd:constant method="factor" prefix="cd:number" type="small"></cd:constant>
<cd:constant method="factor" prefix="cd:number" type="medium"></cd:constant>
<cd:constant method="factor" prefix="cd:number" type="big"></cd:constant>
<cd:constant method="factor" prefix="cd:number" type="line"></cd:constant>
<cd:constant method="factor" prefix="cd:number" type="halfline"></cd:constant>
<cd:constant method="factor" prefix="cd:number" type="quarterline"></cd:constant>
<cd:constant method="factor" prefix="cd:number" type="formula"></cd:constant>
<cd:constant method="factor" prefix="cd:number" type="white"></cd:constant>
<cd:constant method="factor" prefix="cd:number" type="height"></cd:constant>
<cd:constant method="factor" prefix="cd:number" type="depth"></cd:constant>
<cd:constant method="range" prefix="category" type="cd:number"></cd:constant>
<cd:constant method="range" prefix="order" type="cd:number">use the order number as precedence level when multiple blanks are combined</cd:constant>
<cd:constant method="range" prefix="penalty" type="cd:number">use the number as vertical break penalty</cd:constant>
<cd:constant type="cd:dimension">hardcoded dimension</cd:constant>
<cd:constant type="cd:name">use a named (predefined) blank</cd:constant>
</cd:keywords>
</cd:arguments>
</cd:command>
</cd:variants>
<cd: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 {{cmd|blank|[...]|link=no}}, and the key [back] undoes a {{cmd|blank|[...]|link=no}} directly preceding it.

Keywords accept multipliers: to insert whitespace as large as four lines, for example, type {{cmd|blank|[4*big]|link=no}}.

In the [[#Settings]] table the documentation for the size options gives an overview of what skip is actually inserted for the amount specified. To maintain grid consistency the amounts differ if gridsnapping is enabled. You may notice that all of these values are given in relative units. This is due to the fact that vertical spacing is and should be dependent on the current font size.

</cd:description>
<cd:examples><cd:example title=""><context source="yes">

% To fit all the examples on one page, we need a taller page
\definepapersize[tall][width=15cm, height=42cm]
\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 \type{\blank[#1]} does 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{line}
\example{halfline}
\example{formula}
\example{fixed}
\example{flexible}
\example{none}
\example{samepage}

\stoptext
</context></cd:example></cd:examples>
<cd:notes></cd:notes>
<cd:seealso>
<cd:source file="spac-ver.mkiv" originator="system"></cd:source>
<cd:wikipage originator="system" page="Category:Whitespace"></cd:wikipage>
<cd:commandref name="defineblank"></cd:commandref>
<cd:commandref name="setupblank"></cd:commandref>
<cd:commandref name="setupwhitespace">to set up the whitespace between paragraphs</cd:commandref></cd:seealso>
</cd:commandgroup>

Navigation menu