Changes

Jump to navigation Jump to search
m
no edit summary
<!-- please remove this and the following line if you have checked this page -->
{{Reference_Cleanup}}
{{Reference
|name=defineenumeration
<tr valign="top" class="third">
<td class="cmd">[...,...=...,...]</td>
<td>see [[Reference/enCommand/setupenumerations|\setupenumerations]] </td>
</tr>
</table>
== Description ==
With <code>\defineenumeration </code> you can number define the commands for a numbered text elements element, like remarks or questions. IfFor example, if you want to make numbered remarks in your document you usecan define the environment as follows:
 
== setup ==
<texcode>
\defineenumeration
[remark]
[location=top, % use alternative=top in MKIVtext=Remark, % Display header as "Remark 1"headstyle=bold, % Bold remark headersinbetween={\blank[nowhite]}, % No blank line between remark header and remarkafter=\blank] % Blank line after the remark.
</texcode>
You 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>. == Examples == <context source="yes" text="Gives:"> \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</context> The heading can also vary be placed on the same line as the text that follows by using the value 'left' for the layout location property (or alternative in MKIV). The width of Remark the header is controlled by the 'width' parameter, and the spacing to the text by the 'distance' parameter. The text on the left side of the number is defined by 'left' and Subremark in the example above text on the right bythe 'right' parameter. Below the chapter number is appended before the enumeration number. The text before the number can be overridden with the 'text' parameter. Before we override the default text 'remark' with no value. <context source="yes" text="Gives:">\starttext \chapter[chpt1]{Chapter 1} \defineenumeration[remark] [location=left,left={\in[chpt1]}.,right=:,width=0.3in,distance=0.02in,text=]  \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
<texcode>\setupenumeration[remark][headstyle=bold]\setupenumeration[subremark][headstyle=slanted]stoptext</texcodecontextHaving the chapter number automatically prefixed can also be achieved using the "prefix" key (instead of putting in the text with the "left" key):
Now <context source="yes" text="This code produces the new commands \remark, following document:">\subremark, \resetremark and \nextremark are available. setuphead[chapter][page=no] If the remark contains more than % to fit example on one paragraph you will have to use the commandpagepair \startremark ... \stopremark that becomes available after defining Remark with;defineenumeration[problem][way=bychapter, prefix=chapter, text=Problem]
<texcode>\defineenumeration[remark]</texcode>starttext
=== multiple paragraph ===So the example above would look like this:\chapter{Chapter One}
<texcode>\startremarkstartproblemIn the early medieval times Hasselt was a place of pilgrimageEasy problem. The{\em Heilige Stede} (Holy Place) was torn down during theReformation.After 300 years in 1930 the {\em Heilige Stede} was reopened.Nowadays the {\em Heilige Stede} is closed again but once a year anopen air service is held on the same spot.\stopremark</texcode>stopproblem
== input == <texcode>\remark In the early medieval times Hasselt was a place ofpilgrimage. The {\em Heilige Stede} (Holy Place) was torn down duringthe Reformation. In 1930, after 300 years the {\em Heilige Stede} wasstartproblemreopenedHard problem.\subremark Nowadays the {\em Heilige Stede} is closed again but oncea year an open air service is held on the same spot.</texcode>stopproblem
== output ==<pre><b>Remark 1</b>In the early medieval times Hasselt was a place of pilgrimage. The Heilige Stede (HolyPlace) was torn down during the Reformation. In 1930, after 300 years the Heilige Stedewas reopened.<b>Remark 1.1</b>Nowadays the Heilige Stede is closed again but once a year an open air service is held onthe same spot.</pre>\chapter{Chapter Two}
\startproblem
Easy problem in chapter 2.
\stopproblem
== Example ==\stoptext<!-- Please fill in an example if you can --/context>
== See also ==
<!* {{cmd|defineenumeration}} for creating new kinds of numbered objects.* {{cmd|setupenumerations}} for setting up looks and behaviour.* {{cmd|enumeration}} for single-paragraph numbered objects.* {{cmd|startenumeration}} for multiple- something like [[paragraph numbered objects.* {{cmd|defineseparatorset}} for formatting sets. == Help from ConTeXt-Mailinglist/Forum ==All issues with:goto{{Forum|\goto]] -->{{SUBPAGENAME}}}}
[[Category:ReferenceCommand/enNumbered objects|defineenumeration]]
419

edits

Navigation menu