Difference between revisions of "Command/setupindenting"

From Wiki
Jump to navigation Jump to search
 
(6 intermediate revisions by 3 users not shown)
Line 3: Line 3:
 
|attributes=
 
|attributes=
 
}}
 
}}
 +
 +
== [[Help:Reference|Syntax]] (autogenerated) ==
 +
<syntax>setupindenting</syntax>
  
 
== [[Help:Reference|Syntax]] ==
 
== [[Help:Reference|Syntax]] ==
Line 11: Line 14:
 
   <tr valign="top" class="first">
 
   <tr valign="top" class="first">
 
     <td class="cmd">[...,...,...]</td>
 
     <td class="cmd">[...,...,...]</td>
     <td><strong>none</strong> small medium big next first normal odd even dimension </td>
+
     <td>'''no''' yes: ''turn indentation on/off'</td>
 +
  </tr>
 +
  <tr valign="top" class="first">
 +
    <td class="cmd">[...,...,...]</td>
 +
    <td>'''none''' small medium big ''dimension'': ''size of indents''</td>
 +
  </tr>
 +
  <tr valign="top" class="first">
 +
    <td class="cmd">[...,...,...]</td>
 +
    <td>'''first''' next: ''turn indentation of first paragraph on/off''</td>
 +
  </tr>
 +
  <tr valign="top" class="first">
 +
    <td class="cmd">[...,...,...]</td>
 +
    <td>odd even: ''indent odd/even lines in {{cmd|obeylines}} scopes''</td>
 +
  </tr>
 +
  <tr valign="top" class="first">
 +
    <td class="cmd">[...,...,...]</td>
 +
    <td>normal: ''what does this do?''</td>
 
   </tr>
 
   </tr>
 
</table>
 
</table>
 
  
 
== Description ==  
 
== Description ==  
indenting starts only with "yes", e.g.
+
Specify indentation settings. By default, indentation is both turned off ''and'' set to zero, so it must be turned on with <code>\setupindenting[yes, small]</code>.
<pre>
 
  \setupindenting[yes, medium, first]
 
</pre>
 
 
 
If you want indenting after section numbers use this
 
  
<pre>
+
To get indentation after section numbers, use
 +
<texcode>
 
\setupheads[indentnext=yes]
 
\setupheads[indentnext=yes]
</pre>
+
</texcode>
 
 
If you want to indent the paragraph after a <code>\placefigure</code>, you should not use the key <code>auto</code>, use another specifier instead (<code>top</code> or <code>bottom</code>, for instance). The <code>auto</code> keyword prevents the paragraph from indenting. However you can use <code>auto</code> and additionally mark the paragraph to be indented with the <code>\indentation</code> command.
 
  
== Example ==
+
If you place a figure with {{cmd|placefigure}}<code>[auto]</code>, the <code>auto</code> keyword prevents the next paragraph from indenting. You can manually mark the paragraph to be indented with the {{cmd|indentation}} command, or you can use another specifier instead  of <code>auto</code> (<code>top</code> or <code>bottom</code>, for instance).
<!-- Please fill in an example if you can -->
 
  
 
== See also ==
 
== See also ==
<!-- something like [[cmd:goto|\goto]] -->
+
* [[Indentation]]
 +
* {{cmd|indentation}}
 +
* {{cmd|noindenting}}
 +
* {{cmd|indenting}}
  
== Help from ConTeXt-Forum ==
+
== Help from ConTeXt-Mailinglist/Forum ==
 
All issues with:
 
All issues with:
 
{{Forum|{{SUBPAGENAME}}}}
 
{{Forum|{{SUBPAGENAME}}}}
  
[[Category:Paragraphs|setupindenting]]
+
[[Category:Command/Paragraphs|setupindenting]]
 +
 
 +
== Examples ==
 +
<context source=yes>
 +
\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
 +
</context>
 +
 
 +
=== <code>first</code> and <code>next</code> ===
 +
<code>first</code> turns on indentation of the first paragraph; <code>next</code> turns it off. <code>first</code> is on by default.
 +
 
 +
<context source=yes>
 +
\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
 +
</context>
 +
 
 +
=== <code>odd</code> and <code>even</code> ===
 +
<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>
 +
\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
 +
</context>

Latest revision as of 12:11, 19 November 2019

\setupindenting

Syntax (autogenerated)

\setupindenting[...,...]
[...,...][+-]small [+-]medium [+-]big none no not first next yes always never odd even normal reset toggle dimension name


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