From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/22131 Path: news.gmane.org!not-for-mail From: Taco Hoekwater Newsgroups: gmane.comp.tex.context Subject: Re: Suitable mechanism for Theorems and Definitions Date: Thu, 25 Aug 2005 12:07:56 +0200 Message-ID: <430D987C.7030806@elvenkind.com> References: <20050819094833.GA7913@erik.fi.muni.cz> <20050821122716.GA10883@erik.fi.muni.cz> <4308A106.70305@elvenkind.com> <20050821162208.GA16657@erik.fi.muni.cz> <430CD228.9050105@hccnet.nl> <20050824204007.GA2195@erik.fi.muni.cz> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1124964585 23256 80.91.229.2 (25 Aug 2005 10:09:45 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 25 Aug 2005 10:09:45 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Thu Aug 25 12:09:39 2005 Return-path: Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by ciao.gmane.org with esmtp (Exim 4.43) id 1E8EeU-0006wA-Og for gctc-ntg-context-518@m.gmane.org; Thu, 25 Aug 2005 12:08:06 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 61C29127BF; Thu, 25 Aug 2005 12:08:06 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 03542-03; Thu, 25 Aug 2005 12:08:02 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 4B1421280B; Thu, 25 Aug 2005 12:08:02 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 395811280B for ; Thu, 25 Aug 2005 12:08:01 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 03428-05 for ; Thu, 25 Aug 2005 12:08:00 +0200 (CEST) Original-Received: from glenfiddich.elvenkind.com (elvenknd.xs4all.nl [213.84.171.68]) by ronja.ntg.nl (Postfix) with ESMTP id 26944127BF for ; Thu, 25 Aug 2005 12:07:59 +0200 (CEST) Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by glenfiddich.elvenkind.com (Postfix) with ESMTP id B2F2418375 for ; Thu, 25 Aug 2005 12:07:59 +0200 (CEST) Original-Received: from glenfiddich.elvenkind.com ([127.0.0.1]) by localhost (glenfiddich.elvenkind.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 17950-05 for ; Thu, 25 Aug 2005 12:07:56 +0200 (CEST) Original-Received: from [10.10.0.6] (glenlivet.elvenkind.com [10.10.0.6]) by glenfiddich.elvenkind.com (Postfix) with ESMTP id BFC4C18372 for ; Thu, 25 Aug 2005 12:07:56 +0200 (CEST) User-Agent: Mozilla Thunderbird 1.0 (X11/20041206) X-Accept-Language: en-us, en Original-To: mailing list for ConTeXt users In-Reply-To: <20050824204007.GA2195@erik.fi.muni.cz> X-Virus-Scanned: by amavisd-new at elvenkind.net X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.5 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on smtp.ntg.nl X-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:22131 Archived-At: 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 %============== 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. >