ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen Outside <pragma@wxs.nl>
Subject: Re: Suitable mechanism for Theorems and Definitions
Date: Tue, 30 Aug 2005 05:26:43 +0800	[thread overview]
Message-ID: <43137D93.8030401@wxs.nl> (raw)
In-Reply-To: <430D987C.7030806@elvenkind.com>

Taco Hoekwater wrote:

>
> 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}%
>      {\@EA\dodoubleempty\csname 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

ok, i can cook up something along these lines 

Hans 

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                             | www.pragma-pod.nl
-----------------------------------------------------------------

      parent reply	other threads:[~2005-08-29 21:26 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-19  9:48 David Antos
2005-08-21 12:27 ` David Antos
2005-08-21 15:43   ` Taco Hoekwater
2005-08-21 16:22     ` David Antos
2005-08-24 20:01       ` Rob Ermers
2005-08-24 20:40         ` David Antos
2005-08-25 10:07           ` Taco Hoekwater
2005-08-25 20:38             ` David Antos
2005-08-29 21:26             ` Hans Hagen Outside [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=43137D93.8030401@wxs.nl \
    --to=pragma@wxs.nl \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).