From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/79064 Path: news.gmane.org!not-for-mail From: Wolfgang Schuster Newsgroups: gmane.comp.tex.context Subject: Re: Highlight current chapter in list Date: Thu, 8 Nov 2012 09:44:57 +0100 Message-ID: <5D6E4FB4-9C56-49FE-8592-ACBB3F278D77@gmail.com> References: <20121108002930.20b7f349@homerow> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\)) Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1352364313 11312 80.91.229.3 (8 Nov 2012 08:45:13 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 8 Nov 2012 08:45:13 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Thu Nov 08 09:45:21 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 1TWNjk-0003Y6-QF for gctc-ntg-context-518@m.gmane.org; Thu, 08 Nov 2012 09:45:21 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 9698610224; Thu, 8 Nov 2012 09:45:11 +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 bfHuwGvXloCi; Thu, 8 Nov 2012 09:45:03 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 4547710209; Thu, 8 Nov 2012 09:45:03 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 1479610209 for ; Thu, 8 Nov 2012 09:45:02 +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 GqXteLA7byYv for ; Thu, 8 Nov 2012 09:45:01 +0100 (CET) Original-Received: from filter2-ams.mf.surf.net (filter2-ams.mf.surf.net [192.87.102.70]) by balder.ntg.nl (Postfix) with ESMTP id 3188910206 for ; Thu, 8 Nov 2012 09:45:01 +0100 (CET) Original-Received: from mail-bk0-f41.google.com (mail-bk0-f41.google.com [209.85.214.41]) by filter2-ams.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id qA88j0v3006001 for ; Thu, 8 Nov 2012 09:45:00 +0100 Original-Received: by mail-bk0-f41.google.com with SMTP id jm1so1235578bkc.14 for ; Thu, 08 Nov 2012 00:45:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to:x-mailer; bh=a7r6GgHm6nFyMs4l89Ea5jzkeRl+zyKsMgTRmNPyMx0=; b=znVWwhLHKM6957LrM/SiwbskrYHMu4ZrEdD8Jp9k6oq2juoZfEUd+Nj0D6+3X00fXT LaBuwhpFTo69gdlQrgFXT4Wu+5FYnj6G/SFLYJmvlfgkLj+UWvc+f017Tw/v1NFokopi wUJdIBbZQ8v0C/92ZnPL+3o4gkEOD2l4fVMUED97gQ3PGjxixpItguT/5/OUpSGxZ14U Ga/uXAbj+lANqnWD9SukhtN1ZhhFgbl9QQiEEWFOCtaRQWv7GP+9Bpv5l8PKlsUeeqGv ePRnlShJhm1vS4bUlwvcuqUp8Kvh1KDnbCekNfDe1qQwqPGFvO42v5zm5DoNSCJoPZby ySxA== Original-Received: by 10.204.147.89 with SMTP id k25mr1724340bkv.127.1352364300193; Thu, 08 Nov 2012 00:45:00 -0800 (PST) Original-Received: from keima.localdomain (nrbg-4dbe54f4.pool.mediaWays.net. [77.190.84.244]) by mx.google.com with ESMTPS id ht18sm16032887bkc.14.2012.11.08.00.44.58 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 08 Nov 2012 00:44:59 -0800 (PST) In-Reply-To: <20121108002930.20b7f349@homerow> X-Mailer: Apple Mail (2.1499) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=209.85.214.41; 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: 0QIkUJ0DA - d4196fbb410b - 20121108 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) on 192.87.102.70 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:79064 Archived-At: Am 08.11.2012 um 00:29 schrieb Marco Patzer : > Hi! > = > How do I highlight the current chapter in the table of contents? The > TOC is displayed on each page. For illustration I misused the > interaction colour, which of course only works for the first page of > a chapter. > = > \setupheadertexts > [\setups{headlist}] > = > \startsetups [headlist] > \framed[align=3Dnormal, frame=3Doff] > {\placelist [chapter] [alternative=3Df, criterium=3Dall]} > \stopsetups > = > \setupinteraction > [state=3Dstart, > color=3Dlightgray, > contrastcolor=3Ddarkgreen] > = > \starttext > \startchapter [title=3Dalpha] \stopchapter > \startchapter [title=3Dbeta] \page\input knuth \stopchapter > \startchapter [title=3Dgamma] \stopchapter > \stoptext You can use the marking mechanism to get the title of the current chapter. The problem for the solution below is to get a expandable version of the list entry because \currentlistentrytitle itself isn=92t expandable and can= =92t be used in \doifelse. Instead of using \ctxcommand better ask Hans for a raw/expandable version of the tile/pagenumber commands. \setupheadertexts [\setups{headlist}] \startsetups [headlist] \framed[align=3Dnormal, frame=3Doff] {\placelist [chapter] [alternative=3Dhighlight, criterium=3Dall]} \stopsetups \definelistalternative [highlight] [renderingsetup=3Dlist:highlight] \startsetups [list:highlight] \par \startlinealignment[middle] \doifelse{\fetchmark[chapter][first]}{\currentlistentrytitle} %\doifelse{\fetchmark[chapter][first]}{\ctxcommand{listtitle("\currentli= st",\currentlistindex)}} {\color[red] {\currentlistentrytitle}} {\color[blue]{\currentlistentrytitle}} \stoplinealignment \par \stopsetups \setupinteraction [state=3Dstart, color=3Dlightgray, contrastcolor=3Ddarkgreen] \starttext \startchapter [title=3Dalpha] \stopchapter \startchapter [title=3Dbeta] \page\input knuth \stopchapter \startchapter [title=3Dgamma] \stopchapter \stoptext Wolfgang ___________________________________________________________________________= ________ 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 : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________= ________