From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/40876 Path: news.gmane.org!not-for-mail From: Sanjoy Mahajan Newsgroups: gmane.comp.tex.context Subject: Re: defineitemgroup interferes with item reference Date: Sat, 03 May 2008 09:24:59 -0400 Message-ID: References: <481B189D.1040009@wxs.nl> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1209821397 20859 80.91.229.12 (3 May 2008 13:29:57 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 3 May 2008 13:29:57 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Sat May 03 15:30:31 2008 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by lo.gmane.org with esmtp (Exim 4.50) id 1JsHor-000689-Sv for gctc-ntg-context-518@m.gmane.org; Sat, 03 May 2008 15:30:29 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 26C6F1FC45; Sat, 3 May 2008 15:29:45 +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 23063-02-13; Sat, 3 May 2008 15:28:58 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 888431FC44; Sat, 3 May 2008 15:28:58 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 45AB11FC44 for ; Sat, 3 May 2008 15:28:57 +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 27052-01-6 for ; Sat, 3 May 2008 15:28:24 +0200 (CEST) Original-Received: from biscayne-one-station.mit.edu (BISCAYNE-ONE-STATION.MIT.EDU [18.7.7.80]) by ronja.ntg.nl (Postfix) with ESMTP id 518D51FC21 for ; Sat, 3 May 2008 15:28:24 +0200 (CEST) Original-Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103]) by biscayne-one-station.mit.edu (8.13.6/8.9.2) with ESMTP id m43DSMcQ008803; Sat, 3 May 2008 09:28:22 -0400 (EDT) Original-Received: from approx.mit.edu (user-0c2i1ir.cable.earthlink.net [24.41.6.91]) (authenticated bits=0) (User authenticated as sanjoy@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id m43DSJAU005706 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); Sat, 3 May 2008 09:28:22 -0400 (EDT) Original-Received: from sanjoy by approx.mit.edu with local (Exim 4.69) (envelope-from ) id 1JsHjX-00024e-Kl; Sat, 03 May 2008 09:24:59 -0400 In-Reply-To: Your message of "Fri, 02 May 2008 15:35:25 +0200." <481B189D.1040009@wxs.nl> (sfid-20080502_094034_092540_9547A2BB) X-Mailer: MH-E 8.0.3; nmh 1.2; GNU Emacs 22.2.1 X-Scanned-By: MIMEDefang 2.42 X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.9 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-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:40876 Archived-At: Hans Hagen wrote: > itemgroups cannot be miced Though there's no problem without those references in [brackets], so the mixing works most of the time anyway. > this catches it Thanks! With two small changes, your definition makes the mixing work even when using references. The two changes: (1) the macro needed a closing brace, and (2) there's no \currentitemlevel in any context source file so I guessed that \itemlevel was the intention. So: \def\dostartitemgroup[#1][#2][#3]% {\bgroup \ifnum\itemlevel=\zerocount \def\currentitemgroup{#1}% no nested mixing of itemgroups \fi \ifthirdargument \dodostartitemgroup[#2][#3]% \else \doifassignmentelse{#2} {\dodostartitemgroup[][#2]} {\dodostartitemgroup[#2][]}% } Is this macro worth putting into the official distribution or is it a special hack to keep with my documents that need it? -Sanjoy `Until lions have their historians, tales of the hunt shall always glorify the hunters.' --African Proverb ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________