Difference between revisions of "Command/defineenumeration"
< Command
Jump to navigation
Jump to search
(simplify example) |
(Condense page to one-third of its length without loss of information or clarity.) |
||
Line 25: | Line 25: | ||
== Description == | == Description == | ||
− | With <code>\defineenumeration</code> you can | + | With <code>\defineenumeration</code> you can define the commands for a numbered text element, like remarks or questions. For example, if you want numbered remarks in your document you can define the environment as follows: |
− | |||
− | |||
− | |||
<texcode> | <texcode> | ||
\defineenumeration | \defineenumeration | ||
[remark] | [remark] | ||
[location=top, | [location=top, | ||
− | text=Remark, | + | text=Remark, % Display header as "Remark 1" |
− | inbetween=\blank, | + | headstyle=bold, % Bold remark headers |
− | after=\blank] | + | inbetween={\blank[nowhite]}, % No blank line between remark header and remark |
+ | after=\blank] % Blank line after the remark. | ||
</texcode> | </texcode> | ||
− | + | This creates the new commands <code>\remark</code>, <code>\resetremark</code>, <code>\nextremark</code>, and <code>\startremark</code> ... <code>\stopremark</code>, as well as the same commands for <code>subremark</code> and <code>subsubremark</code>. | |
− | + | == Example == | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
<context source="yes" text="Gives:"> | <context source="yes" text="Gives:"> | ||
− | \setupindenting[yes, | + | \setupindenting[yes,small,first] |
\defineenumeration | \defineenumeration | ||
[remark] | [remark] | ||
− | [location=top,text=Remark,inbetween=\blank,after=\blank,headstyle=bold,margin=1in] | + | [location=top,text=Remark,inbetween={\blank[nowhite]},after=\blank,headstyle=bold,margin=1in] |
\starttext | \starttext | ||
− | \remark | + | \remark |
− | + | An enumeration (\tex{remark}, in this case) takes the paragraph that follows | |
− | + | it as its argument. | |
− | |||
− | \remark | + | \remark |
− | + | This is the first paragraph after \tex{remark}. It is part of the remark. | |
− | + | This is the second paragraph after \tex{remark}. It is not part of the remark. | |
− | |||
− | \startremark | + | \startremark |
− | + | This is the first paragraph inside \tex{startremark}. It is part of the remark. | |
− | |||
− | + | This is the second paragraph inside \tex{startremark}. It is part of the remark. | |
− | |||
\stopremark | \stopremark | ||
+ | |||
+ | \subsubremark Presto! | ||
\stoptext | \stoptext |
Revision as of 13:35, 24 April 2012
\defineenumeration
Syntax
\defineenumeration[...,...,...][...][...,...=...,...] | |
[...,...,...] | name |
[...] | name |
[...,...=...,...] | see \setupenumerations |
Description
With \defineenumeration
you can define the commands for a numbered text element, like remarks or questions. For example, if you want numbered remarks in your document you can define the environment as follows:
\defineenumeration [remark] [location=top, text=Remark, % Display header as "Remark 1" headstyle=bold, % Bold remark headers inbetween={\blank[nowhite]}, % No blank line between remark header and remark after=\blank] % Blank line after the remark.
This creates the new commands \remark
, \resetremark
, \nextremark
, and \startremark
... \stopremark
, as well as the same commands for subremark
and subsubremark
.
Example
\setupindenting[yes,small,first] \defineenumeration [remark] [location=top,text=Remark,inbetween={\blank[nowhite]},after=\blank,headstyle=bold,margin=1in] \starttext \remark An enumeration (\tex{remark}, in this case) takes the paragraph that follows it as its argument. \remark This is the first paragraph after \tex{remark}. It is part of the remark. This is the second paragraph after \tex{remark}. It is not part of the remark. \startremark This is the first paragraph inside \tex{startremark}. It is part of the remark. This is the second paragraph inside \tex{startremark}. It is part of the remark. \stopremark \subsubremark Presto! \stoptext
Gives:
See also
Help from ConTeXt-Mailinglist/Forum
All issues with: