Difference between revisions of "Command/head"

From Wiki
Jump to navigation Jump to search
m (Text replace - "[[Category:Commands|" to "== ConTeXt-Forum == {{Forum|{{SUBPAGENAME}}}} [[Category:Commands|")
(9 intermediate revisions by 3 users not shown)
Line 8: Line 8:
 
   <tr>
 
   <tr>
 
     <td colspan="2" class="cmd">\head<span class="first" style="color:red;">[ref,ref,...]</span></td>
 
     <td colspan="2" class="cmd">\head<span class="first" style="color:red;">[ref,ref,...]</span></td>
 +
  </tr>
 +
  <tr>
 +
    <td colspan="2" class="cmd">\starthead<span class="first" style="color:red;">[ref,ref,...]</span><span class="second">{Title}</span> ... \stophead</td>
 
   </tr>
 
   </tr>
 
   <tr valign="top" class="first">
 
   <tr valign="top" class="first">
Line 14: Line 17:
 
</table>
 
</table>
  
 +
== Description ==
 +
 +
Used in itemizations. Prints the first paragraph of an item in the <code>headstyle</code> specified in {{cmd|startitemize}}, and prevents a pagebreak from occurring between the head and the next item. By default, the <code>headstyle</code> is simply the normal style. An empty line or a {{cmd|par}} after a <code>\head</code> is required, so that ConTeXt may distinguish between the header line and the rest of the head item.
  
== Description ==
+
Because the occasional bold item in a list still does not look very much like a head, the items under the head are often printed in a nested {{cmd|startitemize}}.
  
 +
=== Referring to the head ===
  
 +
The syntax \head[ref] probably do not work - it is necessary to use \starthead[ref] ... \stophead
 +
([https://mailman.ntg.nl/pipermail/ntg-context/2018/091593.html])
  
 
== Example ==
 
== Example ==
<!-- Please fill in an example if you can -->
+
 
 +
<context source=yes>
 +
\startitemize[packed][headstyle=bold]
 +
    \head Birds % empty line is required between first par and rest of head
 +
                % item, or one will get a very long header
 +
 
 +
        What is water? This is a difficult question to answer,
 +
        because water is impossible to define. One could ask
 +
        the same question about birds. What {\em are} birds?
 +
        We just don't know.
 +
        \startitemize[a]
 +
            \item Toucan
 +
            \item Quetzal
 +
            \item Cassowary
 +
        \stopitemize
 +
 
 +
    \head Mammals \par % The \par has the same function as the empty line
 +
        \startitemize[continue]
 +
            \item Anteater
 +
            \item Sloth
 +
            \item Capybara
 +
        \stopitemize
 +
\stopitemize
 +
</context>
 +
 
 +
=== Example of a reference ===
 +
 
 +
<context source=yes>
 +
  \startitemize[i][stopper=),headstyle=bold]
 +
    \item[TheItem] Item
 +
 
 +
    \starthead[TheHead]{Head}
 +
 
 +
      Some text
 +
 
 +
    \stophead
 +
  \stopitemize
 +
 
 +
  See point \in[TheItem] or \in[TheHead].
 +
</context>
  
 
== See also ==
 
== See also ==
<!-- something like [[cmd:goto|\goto]] -->
+
* {{cmd|startitemize}}
 +
* {{cmd|item}} to print ordinary items
 +
* {{cmd|sym}} to print an item with a custom symbol
 +
* {{cmd|mar}} to print an item with margin text
 +
* {{cmd|sub}} to print an item with a continuation mark
 +
* {{cmd|its}} to print an item with a row of marks (for response ranges)
 +
* {{cmd|ran}} to print a range for the {{cmd|its}} row
 +
* {{cmd|head}} to print a head within the list
 +
* {{cmd|but}} to print an item whose mark is an interactive button
  
== ConTeXt-Forum ==
+
== Help from ConTeXt-Mailinglist/Forum ==
 +
All issues with:
 
{{Forum|{{SUBPAGENAME}}}}
 
{{Forum|{{SUBPAGENAME}}}}
  
[[Category:Commands|head]]
+
[[Category:Command/Itemizations|head]]

Revision as of 11:46, 23 May 2018

\head

Syntax

\head[ref,ref,...]
\starthead[ref,ref,...]{Title} ... \stophead
[ref,ref,...]

Description

Used in itemizations. Prints the first paragraph of an item in the headstyle specified in \startitemize, and prevents a pagebreak from occurring between the head and the next item. By default, the headstyle is simply the normal style. An empty line or a \par after a \head is required, so that ConTeXt may distinguish between the header line and the rest of the head item.

Because the occasional bold item in a list still does not look very much like a head, the items under the head are often printed in a nested \startitemize.

Referring to the head

The syntax \head[ref] probably do not work - it is necessary to use \starthead[ref] ... \stophead ([1])

Example

\startitemize[packed][headstyle=bold]
    \head Birds % empty line is required between first par and rest of head 
                % item, or one will get a very long header

        What is water? This is a difficult question to answer, 
        because water is impossible to define. One could ask 
        the same question about birds. What {\em are} birds? 
        We just don't know.
        \startitemize[a]
            \item Toucan
            \item Quetzal
            \item Cassowary
        \stopitemize

    \head Mammals \par % The \par has the same function as the empty line
        \startitemize[continue]
            \item Anteater
            \item Sloth
            \item Capybara
        \stopitemize
\stopitemize

Example of a reference

  \startitemize[i][stopper=),headstyle=bold]
    \item[TheItem] Item

    \starthead[TheHead]{Head}

      Some text

    \stophead
  \stopitemize

  See point \in[TheItem] or \in[TheHead].

See also

  • \startitemize
  • \item to print ordinary items
  • \sym to print an item with a custom symbol
  • \mar to print an item with margin text
  • \sub to print an item with a continuation mark
  • \its to print an item with a row of marks (for response ranges)
  • \ran to print a range for the \its row
  • \head to print a head within the list
  • \but to print an item whose mark is an interactive button

Help from ConTeXt-Mailinglist/Forum

All issues with: