From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/45147 Path: news.gmane.org!not-for-mail From: Marcin Borkowski Newsgroups: gmane.comp.tex.context Subject: Re: Reference to a subitem Date: Tue, 28 Oct 2008 01:30:48 +0100 Message-ID: <20081028003048.GE13542@atos.labs.wmid.amu.edu.pl> References: <83e5fb980810221555k3e24caben36af44d360cf9207@mail.gmail.com> <115224fb0810230022x413a048dl90db8d24ca6bb00b@mail.gmail.com> <83e5fb980810241758x785fb138q95d18c9d92560cfc@mail.gmail.com> <20081025070757.GS21389@atos.labs.wmid.amu.edu.pl> <115224fb0810270256m7cc7d3b1vd139c6b7afb7168f@mail.gmail.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-2" Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1225153964 3952 80.91.229.12 (28 Oct 2008 00:32:44 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 28 Oct 2008 00:32:44 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Tue Oct 28 01:33:44 2008 connect(): Connection refused 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 1KucWm-0000SG-DW for gctc-ntg-context-518@m.gmane.org; Tue, 28 Oct 2008 01:33:44 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 7524B1FBBE; Tue, 28 Oct 2008 01:32:36 +0100 (CET) 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 26573-04-6; Tue, 28 Oct 2008 01:31:26 +0100 (CET) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 15E911FB8C; Tue, 28 Oct 2008 01:31:26 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 0D8D81FB7E for ; Tue, 28 Oct 2008 01:31:25 +0100 (CET) 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 26573-04-5 for ; Tue, 28 Oct 2008 01:30:49 +0100 (CET) Original-Received: from atos.wmid.amu.edu.pl (atos.wmid.amu.edu.pl [150.254.78.2]) by ronja.ntg.nl (Postfix) with ESMTP id 6C5F31FB82 for ; Tue, 28 Oct 2008 01:30:49 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by atos.wmid.amu.edu.pl (Postfix) with ESMTP id 33C5410523AE for ; Tue, 28 Oct 2008 01:30:49 +0100 (CET) X-Virus-Scanned: by amavisd-new (PLD-Linux) at wmid.amu.edu.pl Original-Received: from atos.wmid.amu.edu.pl ([127.0.0.1]) by localhost (atos.wmid.amu.edu.pl [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id I6gmJhWq5vjp for ; Tue, 28 Oct 2008 01:30:49 +0100 (CET) Original-Received: by atos.wmid.amu.edu.pl (Postfix, from userid 3884) id 02934105210B; Tue, 28 Oct 2008 01:30:48 +0100 (CET) Content-Disposition: inline In-Reply-To: <115224fb0810270256m7cc7d3b1vd139c6b7afb7168f@mail.gmail.com> User-Agent: Mutt/1.4.2.3i 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:45147 Archived-At: Dnia Mon, Oct 27, 2008 at 10:56:32AM +0100, Wolfgang Schuster napisał(= a): > 2008/10/25 Marcin Borkowski : > > Dnia Sat, Oct 25, 2008 at 02:58:24AM +0200, Diego Depaoli napisał(= a): > >> 2008/10/23 Wolfgang Schuster : > >> > > >> > \def\ItemNumber#1% > >> > {\expandafter\doItemNumber#1..\relax} > >> > > >> > \def\doItemNumber#1.#2.#3\relax > >> > {\doifelsenothing{#2} > >> > {#1} > >> > {#2}} > >> > > >> > \definereferenceformat[initem][left=3D\ItemNumber] > >> Since I don't speak that language, someone could explain why this code > >> doesn't work when I put a stopper in subitemization? > >> The standard dot isn't a stopper itself? > > > > This code seems to work (approximately) like this: it expands the "full" > > reference, which is: > > > > and selects "everything from the first dot up to the second one (w/o the > > dots themselves). So I consider it to be a bit dirty hack (sorry, > > Wolfgang;)), in a sense that it is not very flexible. > = > It's just hack at user level, a dirty hack would redefine core macros but > this is what I try to avoid. OK, sorry - probably we have different semantics of "dirty" (or, more probably, we're talking about different "levels" of dirtiness). Here I meant roughly that this hack is not very flexible. > > If your stopper is, say ")" (and the second one, say, "]", so you have > > references in a strange form like "1)2]"), you might want to say > > something like > > \def\doItemNumber #1)#2]#3\relax > > (the space after \doItemNumber is gobbled by TeX, so it might be present > > here or not, it is a matter of taste only). > > If you have different stoppers, another approach might be reasonable. I > > can see two possibilities: > > 1. Get to know _where_ ConTeXt really keeps the relevant info about > > labels; if the info about the values (w/o stoppers) is preserved, we are > > saved, if not, we've got a problem; > > 2. so in the latter case we have to (?) use this kind of hacky solution, > > which might be something like this (assuming that \stopper and \stopperr > > are the first- and second level stoppers respectively): > > > > \edef\sometemporarymacroname{% > > \def\noexpand\doItemNumber ##1\stopper ##2\stopperr ##3\relax > > {\noexpand\doifelsenothing{##2} > > {##1} > > {##2}}% > > }% > > \sometemporarymacroname > > > > (I'm not sure whether the last percentage sign is needed, but a good > > rule of thumb is to put them everywhere after , > > so that the newlines don't get translated into spaces.) > = > You don't need the comment sign at the end of the macro in outer level > but you need it for local definitons in other macros if your're in > horizontal mode. Shame on me, being a mathematician and being sooo imprecise:):) > > I'm not sure whether this works, though, *please* check it and tell me > > (maybe I'm doing some stupid error, please the TeX gurus correct me if > > yes). I hope this is ok, though, because then it my first post to this > > list containing actually an _answer_ and not a _question_:))). > = > Thanks to explain my solution. You're welcome:). > Wolfgang Greets -- = Marcin Borkowski (http://mbork.pl) Je=B6=E6. Pi=E6. Spa=E6. Wsta=E6. Kupi=E6. Sprzeda=E6. Mie=E6. Mo=BFesz wi=EAcej chcie=E6 - czego=B6 wi=EAcej! (40i30na70) ___________________________________________________________________________= ________ If your question is of interest to others as well, please add an entry to t= he Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-cont= ext webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________= ________