Hi David,

Not sure if you are still interested, but here is my "optional title"
hack, revamped for a modern context distro. It creates a second
extra optional argument for the enumeration, nothing too fancy.
The example also shows a way in which you can access the number.

This does not solve the list generation, sorry.

Cheers, Taco

%===========

\unprotect
\def\dododefinecomplexenumeration#1#2#3%
  {\setvalue{\e!start#1#2}%
     [EMAIL PROTECTED] dostart#1#2\endcsname}%
   \setvalue{dostart#1#2}[##1][##2]%
     {\begingroup\setvalue{#2title}{##2}\getvalue{\e!start#1i#2}[##1]}%
   \setvalue{\e!stop#1#2}{\getvalue{\e!stop#1i#2}\endgroup}}

\def\dodefinecomplexenumeration[#1][#2]%
  {\defineenumeration[i#1]
      [\c!text=#1,\c!stopper=\getvalue{do#1title},#2]%
   \setvalue{do#1title}%
      {\doifnotemptyvalue{#1title}{~(\getvalue{#1title})}}%
   \dododefinecomplexenumeration{}{#1}{#2}%
   \dododefinecomplexenumeration{\v!sub}{#1}{#2}%
   \dododefinecomplexenumeration{\v!sub\v!sub}{#1}{#2}%
   \dododefinecomplexenumeration{\v!sub\v!sub\v!sub}{#1}{#2}}

\def\definecomplexenumeration{\dodoubleempty\dodefinecomplexenumeration}

\protect

\definecomplexenumeration[lemma]

\starttext

\startlemma[lemma1][with a title]
This is lemma \rawnumber[\currentdescriptionnumber]
\stoplemma

\startsublemma[sublemma1][with another title]
This is sublemma \rawnumber[sub\currentdescriptionnumber]
\stopsublemma

\stoptext

%==============


David Antos wrote:
On Wed, Aug 24, 2005 at 10:01:44PM +0200, Rob Ermers wrote:

In David's mail I found one of the problem I had been thinking of too, and I tried his code. Unfortionately, it does not work.


...

A case consists of the following elements:

Case 1    Eating fruit is healthy
Text text text - case description --


Hi,

I've sent Rob my style file in full, the excerpt in the mail was not
indended to run, only as a demonstration of the idea. (If anyone wants to
share my styles and hacks, I'll eventually publish it on the Wiki. It is
now quite unstable but I have quite brute-force macros to typeset
algorithms. Ugly but suits me fine :-)

I'm pretty sure that Rob's "case descriptions" are completely the same as
my named theorems, at least in terms of macro mechanisms needed.

BTW, does anyone know the correct way to obtain current description
generated number? Just asking again... ;-)

D.A.

_______________________________________________
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context

Reply via email to