Difference between revisions of "Command/blank"

From Wiki
Jump to navigation Jump to search
(Created page with "Documentation for \blank")
 
Line 6: Line 6:
 
   <cd:arguments>
 
   <cd:arguments>
 
     <cd:keywords list="yes" optional="yes" ordinal="1">
 
     <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:keywordsdoc>The first set of options are behaviour modifiers. Starting with <cd:iref name="default"/> there are size options.</cd:keywordsdoc>
 
     <cd:constant type="preference">good break (shortcut for <code>penalty:-500</code>)</cd:constant>
 
     <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 type="samepage">no break (shortcut for <code>penalty:10000</code>)
Line 76: Line 76:
 
\setuppapersize[tall]
 
\setuppapersize[tall]
  
The table below has a row for each \type{\blank[#1]} keyword, and three columns:  
+
The table below has a row for each \type{\blank[#1]} keyword, and three columns:
 
\startitemize[packed]
 
\startitemize[packed]
 
     \item column 1 demonstrates \type{\blank[#1]} on its own;
 
     \item column 1 demonstrates \type{\blank[#1]} on its own;
Line 104: Line 104:
 
         Don’t want an antelope nibbling the hoops.
 
         Don’t want an antelope nibbling the hoops.
 
     \whiting
 
     \whiting
         medium + {\tt #1}
+
         medium + {\tt #1}
         % No crlf here, or it'll combine with \blank[none] to create a blank line anyway.  
+
         % 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.)
 
         % (I assume it's equivalent to \crlf\crlf, or something.)
 
         \startwhiteafter
 
         \startwhiteafter
Line 147: Line 147:
 
<cd:commandref name="defineblank"></cd:commandref>
 
<cd:commandref name="defineblank"></cd:commandref>
 
<cd:commandref name="setupblank"></cd:commandref>
 
<cd:commandref name="setupblank"></cd:commandref>
<cd:commandref name="setupwhitespace">to set up the whitespace between paragraphs</cd:commandref></cd:seealso>
+
<cd:commandref name="setupwhitespace">to set up the whitespace between paragraphs</cd:commandref>
 +
<cd:commandref name="emptylines"></cd:commandref></cd:seealso>
 
</cd:commandgroup>
 
</cd:commandgroup>

Revision as of 18:33, 13 September 2020


\blank

Summary

The command \blank is used for inserting vertical blank space.

Settings

\blank[...,...]
[...,...]preference samepage max force enable disable nowhite packed back overlay always weak strong default before inbetween after fixed flexible none small medium big line halfline quarterline formula white height depth standard number*small number*medium number*big number*line number*halfline number*quarterline number*formula number*white number*height number*depth category:number order:number penalty:number dimension name

OptionExplanation
The first set of options are behaviour modifiers. Starting with default there are size options.
preference good break (shortcut for penalty:-500)
samepage no break (shortcut for penalty:10000)
max only if larger
force force even if smaller
disable ignore following
nowhite kill whitespace
packed does not add whitespace but prohibits \parskip
back discard previous blank
weak shortcut for order:0
strong shortcut for order:100
default alias for white
none \zeropoint
small \smallskipamount / .25\bodyfontlineheight with grid
medium \medskipamount / .5\bodyfontlineheight with grid
big \bigskipamount / \bodyfontlineheight with grid
line \openlineheight / \bodyfontlineheight with grid
halfline .5\openlineheight / .5\bodyfontlineheight with grid
quarterline .25\openlineheight / .25\bodyfontlineheight with grid
formula \medskipamount / .5\bodyfontlineheight with grid
white \parskip / \bodyfontwhitespace with grid
height \strutht / \bodyfontstrutheight with grid
depth \strutdp / \bodyfontstrutdepth with grid
standard .75\openlineheight
order:number use the order number as precedence level when multiple blanks are combined
penalty:number use the number as vertical break penalty
dimension hardcoded dimension
name use a named (predefined) blank

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].

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.


Examples

Example 1


% 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

Notes

See also

Help from ConTeXt-Mailinglist/Forum

All issues with: