Difference between revisions of "Command/setupindenting"

From Wiki
Jump to navigation Jump to search
(Elaborate description, elaborate examples)
m (→‎odd and even: Clarify text)
Line 111: Line 111:
  
 
=== <code>odd</code> and <code>even</code> ===
 
=== <code>odd</code> and <code>even</code> ===
<code>odd</code> and <code>even</code> affect explicit line endings when {{cmd|obeylines}} is in effect. {{cmd|crlf}} does not work, and {{cmd|startlines}} has its own <code>odd</code> and <code>even</code> keywords.
+
<code>odd</code> and <code>even</code> affect raw newlines when {{cmd|obeylines}} is in effect. {{cmd|crlf}} is not considered a raw newline, and {{cmd|startlines}} is not affected because {{cmd|setuplines}} has its own <code>odd</code> and <code>even</code> keywords.
 
<context source=yes>
 
<context source=yes>
 
\setuppapersize[A6]
 
\setuppapersize[A6]

Revision as of 14:43, 6 July 2012

\setupindenting

Syntax

\setupindenting[...,...,...]
[...,...,...] no yes: turn indentation on/off'
[...,...,...] none small medium big dimension: size of indents
[...,...,...] first next: turn indentation of first paragraph on/off
[...,...,...] odd even: indent odd/even lines in \obeylines scopes
[...,...,...] normal: what does this do?

Description

Specify indentation settings. By default, indentation is both turned off and set to zero, so it must be turned on with \setupindenting[yes, small].

To get indentation after section numbers, use

\setupheads[indentnext=yes]

If you place a figure with \placefigure[auto], the auto keyword prevents the next paragraph from indenting. You can manually mark the paragraph to be indented with the \indentation command, or you can use another specifier instead of auto (top or bottom, for instance).

See also

Help from ConTeXt-Mailinglist/Forum

All issues with:

Examples

\definepapersize[tall][height=40cm, width=10cm]
\setuppapersize[tall]

\setuphead[subsubsubject][before={\blank[none]}, after={\blank[none]}]

\def\test#1%
{
  \setupindenting[yes, #1]
  \subsubsubject{\type{#1}}
  One, two\par
  Buckle my shoe\par
  \hairline
}

\startcolumns[n=2, rule=on]
  \test{none}
  \test{medium}
  \test{big}
\column
  \test{none}
  \test{small}
  \test{-1em}
\stopcolumns

first and next

first turns on indentation of the first paragraph; next turns it off. first is on by default.

\setuppapersize[A5]

% The quotation is from "Three Tickets to Adventure", by Gerald Durrell.
\def\testpar{
    Neither Bob nor I had ever met quite such a gentle, stupid, and amiable 
    bird, and we christened it Cuthbert forthwith, as that was the only name 
    we could think of that perfectly fitted its sloppy character.
    \par}

% `first` is on by default
\setupindenting[yes, small]
\testpar
\testpar
\hairline

% to disable indentation of the first paragraph, use `next`
\setupindenting[next]
\testpar
\testpar
\hairline

% to re-enable indentation of the first paragraph on again, use `first`
\setupindenting[first]
\testpar
\testpar

odd and even

odd and even affect raw newlines when \obeylines is in effect. \crlf is not considered a raw newline, and \startlines is not affected because \setuplines has its own odd and even keywords.

\setuppapersize[A6]

\startcolumns[n=2, rule=on]
    \setupindenting[yes, small, even]
    {\obeylines
        one
        two
        three
        four
    }
\column
    \setupindenting[odd]
    {\obeylines
        one
        two
        three
        four
    }
\stopcolumns