From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/79107 Path: news.gmane.org!not-for-mail From: Sietse Brouwer Newsgroups: gmane.comp.tex.context Subject: Re: Highlight current chapter in list Date: Fri, 9 Nov 2012 17:53:29 +0100 Message-ID: References: <20121108002930.20b7f349@homerow> <5D6E4FB4-9C56-49FE-8592-ACBB3F278D77@gmail.com> <20121108110621.1944bf2c@homerow> <509B921E.4090407@wxs.nl> <509B9469.9060207@wxs.nl> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1352480048 17975 80.91.229.3 (9 Nov 2012 16:54:08 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 9 Nov 2012 16:54:08 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Fri Nov 09 17:54:18 2012 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TWrqT-0000km-Da for gctc-ntg-context-518@m.gmane.org; Fri, 09 Nov 2012 17:54:17 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id A9E9B101E9; Fri, 9 Nov 2012 17:54:07 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id IGcUgFQ4Uqa5; Fri, 9 Nov 2012 17:54:06 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 11EED1021B; Fri, 9 Nov 2012 17:54:06 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id DA6981021B for ; Fri, 9 Nov 2012 17:54:04 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 9B3RSf-tOb1m for ; Fri, 9 Nov 2012 17:54:03 +0100 (CET) Original-Received: from filter4-ams.mf.surf.net (filter4-ams.mf.surf.net [192.87.102.72]) by balder.ntg.nl (Postfix) with ESMTP id B92F0101E9 for ; Fri, 9 Nov 2012 17:54:03 +0100 (CET) Original-Received: from mail-ie0-f169.google.com (mail-ie0-f169.google.com [209.85.223.169]) by filter4-ams.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id qA9H2WXU032653 for ; Fri, 9 Nov 2012 18:02:32 +0100 Original-Received: by mail-ie0-f169.google.com with SMTP id 10so7667793ied.14 for ; Fri, 09 Nov 2012 08:54:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=SZJeybpEsvkNPsCdLmziIM9AuDD2ISxa9+cBn39Q2y0=; b=Kv0ImYqp3ulCushIPzT9G+sUnW5c26TjIQ1xWFCydZkRNQ9L66K4FLVxYgH4Q3GKUX cMu1IM59uCwffwuoXqPlanRRD+a2jEW7AeRUKSvAfXCD3GNbXGTzWtXH+rIWGKBJgEfy 1fxQ5mPVBboh/YlOZKNPH3imilAisn//Hl7pR8/ZAtUxMUGiJR06Kr+TN72a0TMfzgqa d3XnSY/3+sOebQ+NKIxfbe9TBYcDYBO9ESO6Kh8e/vTYcjRhm8KcavOprr+gEepO/hRB aet6JFzltzwrkY/A4UxhvwX+lfMGZJt13Jzs1MRRVJ9znzCwsgbIiUs6Atl8bKO9vaTH XIPg== Original-Received: by 10.50.152.197 with SMTP id va5mr1924354igb.12.1352480040679; Fri, 09 Nov 2012 08:54:00 -0800 (PST) Original-Received: by 10.64.5.138 with HTTP; Fri, 9 Nov 2012 08:53:29 -0800 (PST) In-Reply-To: <509B9469.9060207@wxs.nl> X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=209.85.223.169; country=US; region=CA; city=Mountain View; postalcode=94043; latitude=37.4192; longitude=-122.0574; metrocode=807; areacode=650; http://maps.google.com/maps?q=37.4192,-122.0574&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 01Ilt2wFw - 0973fd7500b7 - 20121109 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) on 192.87.102.72 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.14 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:79107 Archived-At: Hans wrote: > the next beta has: \namedstructureheadlocation{name} > so that you can compare > \currentlistentrylocation > with > \namedstructureheadlocation{chapter} > (todo: also store locations elsewhere?) > Best document this before we forget about it. Is this a good description of the command's behavior? All structure heads, regardless of level, get a location number in the order in which they appear. Like so (see also MWE at bottom of this e-mail): \section{Alpha} % location number: 1; type: section; section number: 1 \section{Beta} % location number: 2; type: section; section number: 2 \subsection{Aap} % location number: 3; type: subsection; subsection number: 1 \subsection{Noot} % location number: 4; type: subsection; subsection number: 2 \section{Gamma} % location number: 5; type: section; section number: 3 \namedstructureheadlocation{X} then returns the location number of the current X, where X is the name of a structure level (e.g. 'chapter', 'section', etc.) If you ask for e.g. \namedstructureheadlocation{chapter}, and you are not in a chapter, then 0 is returned. Anything missing? @Marco: sweet job on http://wiki.contextgarden.net/Command/definelistalternative. I have taken the lazy liberty of redirecting Command/currentlistentrylocation Command/structureheadlocation Command/currentlistentrynumber etc to that page for the now, so that they at least appear in the list of commands. --Sietse \starttext \startsection [title=alpha] \stopsection \startsection [title=beta] \startsubsection[title=aap] \namedstructureheadlocation{section} \namedstructureheadlocation{subsection} \startsubsection[title=noot] \namedstructureheadlocation{section} \namedstructureheadlocation{subsection} \stopsubsection \stopsection \startsection [title=gamma] \namedstructureheadlocation{section} \stopsection \stoptext ___________________________________________________________________________________ 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 : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________