Difference between revisions of "Command/setupheads"

From Wiki
Jump to navigation Jump to search
m (Text replace - "\[\[cmd:(.*)\|(.*)\]\]" to "{{cmd|$1}}")
(Add insidesection with example)
Line 49: Line 49:
 
     <td>[[Command/value:dimension|dimension]] </td>
 
     <td>[[Command/value:dimension|dimension]] </td>
 
   </tr>
 
   </tr>
 +
  <tr valign="top" class="first">
 +
    <td class="cmd">[[Command/keyword:insidesection|insidesection]]</td>
 +
    <td>[[Command/value:COMMAND|COMMAND]] </td>
 +
  </tr>
 +
 
</table>
 
</table>
  
Line 57: Line 62:
  
 
aligntitle=float causes the title to appear next to floats. By default, a title will be moved down to appear below a float, it will not be "wrapped" around a float like normal text. Setting this option causes it to wrap like normal text.
 
aligntitle=float causes the title to appear next to floats. By default, a title will be moved down to appear below a float, it will not be "wrapped" around a float like normal text. Setting this option causes it to wrap like normal text.
 +
 +
The <code>insidesection</code> command is injected right after the <code>after</code> command of <code>\setuphead</code>. It can be used for example to insert a table of contents local to a chapter. <code>insidesection</code> only works with the <code>\startchapter, \startsection, …</code> variants, not with <code>\chapter, \section, …</code>.
  
 
== Example ==
 
== Example ==
<!-- Please fill in an example if you can -->
+
Table of contents local to a chapter:
 +
 
 +
<texcode>
 +
\setuphead
 +
  [chapter]
 +
  [after={\blank[1cm]},
 +
  insidesection=\placecontent]
 +
 
 +
\starttext
 +
 
 +
\startchapter [title=Foo]
 +
  \startsection [title=Zapf]
 +
    \input zapf
 +
  \stopsection
 +
  \startsection [title=Knuth]
 +
    \input knuth
 +
  \stopsection
 +
\stopchapter
 +
 
 +
\stoptext
 +
</texcode>
  
 
== See also ==
 
== See also ==

Revision as of 14:55, 18 July 2012

\setupheads

Syntax

\setupheads[...,...=...,...]
sectionnumber yes number no
alternative normal margin middle text paragraph
separator text
stopper text
align flushleft flushright normal broad
aligntitle yes float no
tolerance verystrict strict tolerant verytolerant stretch
indentnext yes no
command twoarguments
margin dimension
insidesection COMMAND

Description

Note that this command has been reported non-working for some people (but it seems to work fine for me).

This command sets up the default options for all headings (e.g., the stuff generated by \section, \subsection, etc.). The \setuphead command can be used to override these settings on a per-level basis (e.g., only for \section) and has some extra options as well.

aligntitle=float causes the title to appear next to floats. By default, a title will be moved down to appear below a float, it will not be "wrapped" around a float like normal text. Setting this option causes it to wrap like normal text.

The insidesection command is injected right after the after command of \setuphead. It can be used for example to insert a table of contents local to a chapter. insidesection only works with the \startchapter, \startsection, … variants, not with \chapter, \section, ….

Example

Table of contents local to a chapter:

\setuphead
  [chapter]
  [after={\blank[1cm]},
   insidesection=\placecontent]

\starttext

\startchapter [title=Foo]
  \startsection [title=Zapf]
    \input zapf
  \stopsection
  \startsection [title=Knuth]
    \input knuth
  \stopsection
\stopchapter

\stoptext

See also

Help from ConTeXt-Mailinglist/Forum

All issues with: