Difference between revisions of "Proclaim"
Jump to navigation
Jump to search
Line 27: | Line 27: | ||
\starttext | \starttext | ||
+ | \title{On proclamations} | ||
+ | \blank | ||
When there is not a declared section, the numbers have no prefix as in the following: | When there is not a declared section, the numbers have no prefix as in the following: | ||
\startproclaim[def:test]{Definition} | \startproclaim[def:test]{Definition} | ||
− | This is a | + | This is a definition. |
\stopproclaim | \stopproclaim | ||
Line 41: | Line 43: | ||
When there is a declared section, the numbers have as prefix the section number, as in the following: | When there is a declared section, the numbers have as prefix the section number, as in the following: | ||
− | \startproclaim{ | + | \startproclaim{Lemma} |
Here is another lemma. | Here is another lemma. | ||
\stopproclaim | \stopproclaim | ||
Line 67: | Line 69: | ||
</texcode> | </texcode> | ||
+ | |||
+ | and we get this: | ||
+ | |||
+ | <context> | ||
+ | |||
+ | |||
+ | %% defining an enumeration environment replacing Plain-TeX's \proclaim | ||
+ | % | ||
+ | \defineenumeration[proclaim] | ||
+ | [text=, | ||
+ | style=slanted, | ||
+ | title=yes, | ||
+ | titleleft=, | ||
+ | titleright=, | ||
+ | location=serried, | ||
+ | width=fit, | ||
+ | right={. }] | ||
+ | \setupnumber[proclaim][way=bysection,numbersection=yes] %% this can be changed according to one's wishes | ||
+ | % | ||
+ | %% end definition \proclaim | ||
+ | |||
+ | \starttext | ||
+ | \title{On proclamations} | ||
+ | \blank | ||
+ | When there is not a declared section, the numbers have no prefix as in the following: | ||
+ | |||
+ | \startproclaim[def:test]{Definition} | ||
+ | This is a definition. | ||
+ | \stopproclaim | ||
+ | |||
+ | \startproclaim{Lemma} | ||
+ | This is a lemma. | ||
+ | \stopproclaim | ||
+ | |||
+ | \section{Here is a section} | ||
+ | |||
+ | When there is a declared section, the numbers have as prefix the section number, as in the following: | ||
+ | |||
+ | \startproclaim{Lemma} | ||
+ | Here is another lemma. | ||
+ | \stopproclaim | ||
+ | |||
+ | \startproclaim[thm:result]{Theorem} | ||
+ | This is our main theorem. | ||
+ | \stopproclaim | ||
+ | |||
+ | \section{Here is another section} | ||
+ | |||
+ | When there is a declared section the numbers have as prefix the section number, as in the following: | ||
+ | |||
+ | \startproclaim[lem:resultB]{Lemma} | ||
+ | Here is an elementary lemma. | ||
+ | \stopproclaim | ||
+ | |||
+ | \startproclaim{Corollary} | ||
+ | This is a corollary. | ||
+ | \stopproclaim | ||
+ | |||
+ | Note that we can refer to our results in the following way: according to the definition \in[def:test] we see that theorem \in[thm:result] is | ||
+ | an easy consequence of lemma \in[lem:resultB]. | ||
+ | |||
+ | \stoptext | ||
+ | |||
+ | </context> |
Revision as of 17:37, 1 December 2009
In Plain-TeX there is the command \proclaim which is very handy when writing mathematics and stating Theorems, Lemmas, Definitions and so on. Unfortunately it doesn't allow one to number automatically these statements in order to refer to them through cross referencing, and somehow it has disappeared from ConTeXt.
If one wishes to number in a sequential way all these « proclaims », here is a solution:
%% defining an enumeration environment replacing Plain-TeX's \proclaim % \defineenumeration[proclaim] [text=, style=slanted, title=yes, titleleft=, titleright=, location=serried, width=fit, right={. }] \setupnumber[proclaim][way=bysection,numbersection=yes] %% this can be changed according to one's wishes % %% end definition \proclaim
After having defined this, one can use it in the following way:
\starttext \title{On proclamations} \blank When there is not a declared section, the numbers have no prefix as in the following: \startproclaim[def:test]{Definition} This is a definition. \stopproclaim \startproclaim{Lemma} This is a lemma. \stopproclaim \section{Here is a section} When there is a declared section, the numbers have as prefix the section number, as in the following: \startproclaim{Lemma} Here is another lemma. \stopproclaim \startproclaim[thm:result]{Theorem} This is our main theorem. \stopproclaim \section{Here is another section} When there is a declared section the numbers have as prefix the section number, as in the following: \startproclaim[lem:resultB]{Lemma} Here is an elementary lemma. \stopproclaim \startproclaim{Corollary} This is a corollary. \stopproclaim Note that we can refer to our results in the following way: according to the definition \in[def:test] we see that theorem \in[thm:result] is an easy consequence of lemma \in[lem:resultB]. \stoptext
and we get this: