Difference between revisions of "Proclaim"

From Wiki
Jump to navigation Jump to search
Line 1: Line 1:
 
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.
 
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:
+
If one wishes to number in a sequential way all these « proclaims », here is a solution:
  
 
<texcode>
 
<texcode>
Line 16: Line 16:
 
width=fit,
 
width=fit,
 
right={. }]
 
right={. }]
\setupnumber[proclaim][way=bysection,numbersection=yes]
+
\setupnumber[proclaim][way=bysection,numbersection=yes] %% this can be changed according to one's wishes
 
%
 
%
 
%% end definition \proclaim
 
%% end definition \proclaim
Line 22: Line 22:
 
</texcode>
 
</texcode>
  
After having defined this one can use it in the following way:
+
After having defined this, one can use it in the following way:
  
 
<texcode>
 
<texcode>
  
 
\starttext
 
\starttext
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}
Line 39: Line 39:
 
\section{Here is a section}
 
\section{Here is a section}
  
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{Lemme}
 
\startproclaim{Lemme}

Revision as of 18:45, 30 November 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
When there is not a declared section, the numbers have no prefix as in the following:

\startproclaim[def:test]{Definition}
This is a définition.
\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{Lemme}
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