[dev-context] Enhancements to core-des for theorems

Aditya Mahajan adityam at umich.edu
Sat Jun 2 23:43:16 CEST 2007


On Sat, 2 Jun 2007, Hans Hagen wrote:

> Aditya Mahajan wrote:
>> Hi Hans,
>> 
>> I am attaching my enhancements for core-des. This takes care of most of the 
>> needs for theorems with ConTeXt. I hope that I have not broken anything. I 
>> have tested this with a 40 page documents, while Oliver, Olaf, and Dalyoung 
>> have tested this with bigger documents. The test files show different 
>> features.
>> 
>> It takes care of a few bugs in enumerations, (and introduces new ones... 
>> there is a suprious space somewhere which I can not find)
>> Basically, more enhanced support for titles, and end of proof markers, and 
>> makes sure that conversion=whatever works correctly.
>      \descriptionparameter\c!right%
>     }}  <======= here is your space
>    \doifnot{#1}{-}{\rawreference\s!num{#1}{}}%
>
>
>          \strut\doshowdnnumber%
>          \showdntitle{#2} <======= here is another space
>      %AM: Remaining part of \domakednnumbed
>
>
>      \descriptionparameter\c!left
>      \showdntitle{#2} <======= here is another space
>      \descriptionparameter\c!stopper
>
>
> most of the %'s you added are not needed, e.g. never after a \macroname

Thanks, I am still learning this space % stuff.

>> 
>> For end of proof markers, say
>> 
> \def\placeendmarker
> {\@EA\ifcase \csname dnendmarker\currentdescription\endcsname
>    \global\@EA\chardef\csname 
> dnendmarker\currentdescription\endcsname\plusone
>    \doifsomething{\descriptionparameter\c!endmarker}
> %         {\pushright{\descriptionparameter\c!endmarker}}\fi}
>       {\wordright{\descriptionparameter\c!endmarker}}\fi}
>
> this is what wordright was made for; maybe it can be improved but thsi qed 
> stuff looks too complex to me (may also interfere with other things)

I had a look at \wordright. The trouble is that \wordright makes no 
attempt to prevent a page break if it is on a line of its own. It it 
can be enhanced to take that into account, that is fine with me. The 
placed of endofproof symbol is complicated. amsthm, does something 
similar to qed.sty, while ntheorem goes into a two pass mechansim to 
get the placement right.


>> \definetheorem[theorem][endmarker=\math{\square}] or whatever symbol you 
>> want.
>> 
>> Then a end of proof marker with will be placed at the \stoptheorem. 
>> Sometimes, for example after an itemize, the end of thoerem marker may 
>> appear on a line of its own. Then say \placenedmarker just before 
>> \stopitemize
>> 
>> To couple two enumerations
>> 
>> \defineenumeration[theorem]
>> \defineenumeration[proposition][theorem]
>> 
>> To couple just the numbers
>> 
>> \defineenumeration[theorem]
>> \defineenumeration[proposition][usenumer=theorem]
>> 
>> I cannot use number=theorem because number=yes|no is to enable disable 
>> numbering. Maybe a better choice will be numbering=yes|no, and 
>> number=counter. But that will break backward compatibility :(
> \defineenumeration[proposition][theorem]
>
> will inherit and then you can set up proposition independently

Yes, but that is doing a lot of work simply to inherit the number.

>> The main thing that needs to be done is to get end of proof markers to work 
>> with formulas, but that is a bit difficult, so I have left it for the 
>> future.
> i need to give this some thought ...
>
> endmark     -> endsymbol (we use symbol for other things; mark is too much 
> related to marks)

Ok.

> usenumber  -> have to think of it, cloning happens more (\c!coupling is used 
> low level)
>
> There is some code i made for David Antos:
>
>          \doif{\descriptionparameter\c!title}\v!yes % new, for david antos
>            {\doattributes{\??dd\currentdescription}\c!titlestyle\c!titlecolor
>               {\hskip\descriptionparameter\c!titledistance\begstrut#2\endstrut}}%
>
> did you check if his usage still works? (at least we need to tell David what 
> to use now)

I think that the old code will still work. There may a change in the 
default behaviour of stopper. If I remember correctly, earlier we had,

<enumeration><left><number><right><stopper><title>

and now I have

<enumeration><left><number><right><title><stopper> which seems to be 
more common.

Aditya


More information about the dev-context mailing list