Difference between revisions of "Command/head"
< Command
Jump to navigation
Jump to search
m |
(Updated LMTX syntax) |
||
(6 intermediate revisions by 3 users not shown) | |||
Line 7: | Line 7: | ||
<table cellspacing="4" cellpadding="2" class="cmd"> | <table cellspacing="4" cellpadding="2" class="cmd"> | ||
<tr> | <tr> | ||
− | <td colspan="2" class="cmd">\head<span class="first" style="color:red;">[ref,ref,...]</span></td> | + | <td colspan="2" class="cmd">\head ... \par</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 16: | Line 19: | ||
== Description == | == 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. | + | 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. 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. |
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}}. | 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}}. | ||
Line 22: | Line 25: | ||
=== Referring to the head === | === Referring to the head === | ||
− | The syntax \head[ref] | + | The syntax \head[ref] does not work - it is necessary to use \starthead[ref] ... \stophead |
− | |||
== Example == | == Example == | ||
Line 29: | Line 31: | ||
<context source=yes> | <context source=yes> | ||
\startitemize[packed][headstyle=bold] | \startitemize[packed][headstyle=bold] | ||
− | \head Birds | + | \head Birds \par |
− | |||
− | |||
What is water? This is a difficult question to answer, | What is water? This is a difficult question to answer, | ||
because water is impossible to define. One could ask | because water is impossible to define. One could ask | ||
Line 42: | Line 42: | ||
\stopitemize | \stopitemize | ||
− | \head Mammals \par | + | \head Mammals \par |
\startitemize[continue] | \startitemize[continue] | ||
\item Anteater | \item Anteater | ||
Line 48: | Line 48: | ||
\item Capybara | \item Capybara | ||
\stopitemize | \stopitemize | ||
+ | \stopitemize | ||
+ | </context> | ||
+ | |||
+ | In LMTX, the preferred syntax is: | ||
+ | |||
+ | <context source=yes> | ||
+ | \startitemize[packed, headintext][headcolor=red] | ||
+ | \starthead{Birds} | ||
+ | What is water? This is a difficult question to answer. | ||
+ | \stophead | ||
\stopitemize | \stopitemize | ||
</context> | </context> | ||
Line 54: | Line 64: | ||
<context source=yes> | <context source=yes> | ||
− | \startitemize[i][stopper=)] | + | \startitemize[i][stopper=),headstyle=bold] |
\item[TheItem] Item | \item[TheItem] Item | ||
− | \starthead[TheHead] Head | + | \starthead[TheHead]{Head} |
Some text | Some text | ||
+ | |||
+ | \stophead | ||
\stopitemize | \stopitemize | ||
Line 68: | Line 80: | ||
* {{cmd|startitemize}} | * {{cmd|startitemize}} | ||
* {{cmd|item}} to print ordinary items | * {{cmd|item}} to print ordinary items | ||
− | * | + | * [[Enumerations]] |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
== Help from ConTeXt-Mailinglist/Forum == | == Help from ConTeXt-Mailinglist/Forum == |
Latest revision as of 08:05, 23 December 2021
\head
Syntax
\head ... \par | |
\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. 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] does not work - it is necessary to use \starthead[ref] ... \stophead
Example
\startitemize[packed][headstyle=bold] \head Birds \par 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 \startitemize[continue] \item Anteater \item Sloth \item Capybara \stopitemize \stopitemize
In LMTX, the preferred syntax is:
\startitemize[packed, headintext][headcolor=red] \starthead{Birds} What is water? This is a difficult question to answer. \stophead \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
- Enumerations
Help from ConTeXt-Mailinglist/Forum
All issues with: