Changes

Jump to navigation Jump to search
1,896 bytes added ,  17:25, 8 June 2020
m
no edit summary
In Plain-TeX there is the command \proclaim which is very handy when writing mathematics and stating Theoremstheorems, Lemmaslemmas, Definitions 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 » ‘proclaimations’, regardless of type and in the order in which they appear, here is a solution:which works very well in ConTeXt Mark II. (For a solution with Mark IV see below.)
<texcodecontext source=yes>\setuppapersize[A5]
%% defining an enumeration environment replacing Plain-TeX's \proclaim
%
\defineenumeration[proclaim]
[text=,
width=fit,
right={. }]
\setupnumber[proclaim][way=bysection,numbersection=yes]
%
%% end definition \proclaim
</texcode>%% this can be changed according to one's wishes\setupnumber[proclaim][way=bysection, numbersection=yes]
After having defined this one can use it in the following way:%% end definition \proclaim
<texcode>\starttext\title{On proclamations}\blank
\starttextWhen there no section is not a declared section (yet), the numbers have no prefix , as in the followingfollows:
\startproclaim[def:test]{Definition}
This is a définitiondefinition.
\stopproclaim
\section{Here is a section}
When there is a declared section , the numbers have the section number as a prefix the section number, as in the followinglike so:
\startproclaim{LemmeLemma}
Here is another lemma.
\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:resultatresultB]{Lemma}
Here is an elementary lemma.
\stopproclaim
\stopproclaim
Note that we can refer to our results in the following way: according to the definition \in{Definition}[def:test] we see that theorem \in{Theorem}[thm:result] is an easy consequence of lemma \in{Lemma}[lem:resultatresultB]. \stoptext </context>  In Mark IV there is another solution which consists in defining first a certain ‘enumeration’ (in the example below for Remarks) and then use the counter created for this enumeration in other enumerations such as lemmas, theorems, etc. <context mode=mkiv source=yes>% mode=mkiv \setuppapersize[A5] \defineenumeration[remark] [text=Remark, location=serried, width=fit, right={.~}]\setupenumerations[remark] [prefix=yes, % or prefixsegments=chapter:section prefixsegments=section] \setupnumber[remark][way=bysection] \defineenumeration[theorem] [text=Theorem, location=serried, width=fit, counter=remark, % only use counter of remark style=slanted, right={.~}]\setupenumerations[theorem] [prefix=yes, prefixsegments=section] \starttext \title{First and only title of the article} This file has been typeset on \currentdate{} at \currenttime, with \doifmodeelse{mkiv} {mkiv, LuaTeX version \the\luatexversion, LuaTeX revision \luatexrevision, (LuaTeX date stamp \luatexdatestamp), using the command: \par \type{context basic-test.tex}\par} {mkii, using the command: \par \type{texexec basic-test.tex}\par} ConTeXt version \contextversion.Here we don't have any section. \startremarkThis is a silly remark.\stopremark \starttheoremThis is a deep theorem.\stoptheorem \startremarkThis is a silly remark.\stopremark \starttheoremThis is a deep theorem.\stoptheorem \section{This is a section} Here we do have a section. \startremarkThis is a silly remark.\stopremark \starttheoremThis is a deep theorem.\stoptheorem \startremark[rem:silly]This is a silly remark.\stopremark \starttheorem[thm:deep]This is a deep theorem.\stoptheorem As mentioned in \in{Remark}[rem:silly], the result of \in{Theorem}[thm:deep] is trivial.
\stoptext
</context>
</texcode>[[Category:Math]][[Category:Basics]]

Navigation menu