From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/86159 Path: news.gmane.org!not-for-mail From: Wolfgang Schuster Newsgroups: gmane.comp.tex.context Subject: Re: Rearrange Table of Contents section page numbers Date: Sat, 1 Feb 2014 09:59:55 +0100 Message-ID: <8B514E1C-A5F1-44AF-B1B1-17460CB2BE97@gmail.com> References: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (Mac OS X Mail 7.1 \(1827\)) Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1391245204 7801 80.91.229.3 (1 Feb 2014 09:00:04 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 1 Feb 2014 09:00:04 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Sat Feb 01 10:00:13 2014 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([5.39.185.229]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1W9WQv-0004CX-5j for gctc-ntg-context-518@m.gmane.org; Sat, 01 Feb 2014 10:00:13 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 21AFD101EA; Sat, 1 Feb 2014 10:00:12 +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 aOI8i997NJbT; Sat, 1 Feb 2014 10:00:10 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id D7EF3101E3; Sat, 1 Feb 2014 10:00:09 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 8C440101E3 for ; Sat, 1 Feb 2014 10:00:08 +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 WmMZ9PRHmfQF for ; Sat, 1 Feb 2014 10:00:06 +0100 (CET) Original-Received: from filter1-til.mf.surf.net (filter1-til.mf.surf.net [194.171.167.217]) by balder.ntg.nl (Postfix) with ESMTP id D5907101E1 for ; Sat, 1 Feb 2014 10:00:01 +0100 (CET) Original-Received: from mail-ea0-x22d.google.com (mail-ea0-x22d.google.com [IPv6:2a00:1450:4013:c01::22d]) by filter1-til.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id s11900qM004826 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Sat, 1 Feb 2014 10:00:01 +0100 Original-Received: by mail-ea0-f173.google.com with SMTP id d10so2784387eaj.4 for ; Sat, 01 Feb 2014 01:00: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; bh=C0gEyjs9VHuCux6X9k3geg+C3NXYYRdEIu77AVvMnVw=; b=g4i/wNoTuPK9Zp3t2Q0eiNuqqkPLKZLnCnKF0quYdPd7MNHqJdewE6D6V8GsKYHGgX g0qHBGpia4yn9wqpns8MvJ3oNohIoMN+HD88UWWeZNLo3S3/IEJ4rcx7CC3JjXls2rSF bI2REwP8wy0GvW0DsRST8c5FAp3vWGZKtNySpqf0TtjP/omCExfaWozFGTtegDIb3wzy hpAzA22pbkaheRfsi1CvJtLzyfAc4AgIVYzJtbUansdTf7wD3lAVzpGJcsWs9Df+0bAl UuWBkrZzgeGp33U8iRocpx0QWNXFUlimiQdSNCxYQhHdFAia+YWy+HUtxEcuAY03Ml+p m/9A== X-Received: by 10.14.194.131 with SMTP id m3mr30611728een.2.1391245200773; Sat, 01 Feb 2014 01:00:00 -0800 (PST) Original-Received: from keima.localdomain (x2f24f5c.dyn.telefonica.de. [2.242.79.92]) by mx.google.com with ESMTPSA id 4sm47212676eed.14.2014.02.01.00.59.56 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 01 Feb 2014 00:59:59 -0800 (PST) In-Reply-To: X-Mailer: Apple Mail (2.1827) X-Bayes-Prob: 0.0001 (Score 0, tokens from: ntg-context@ntg.nl, base:default, @@RPTN) X-CanIt-Geo: ip=2a00:1450:4013:c01::22d; country=IE X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0RLkV01ea - 81af60662d0c - 20140201 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) 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:86159 Archived-At: Am 31.01.2014 um 23:20 schrieb Thangalin : > Hi, > > I am trying to recreate the following ToC entries: > > http://i.stack.imgur.com/ig6LX.png > > The code on the wiki uses: > > \doifelse\currentlistentrylocation{\structureheadlocation{chapter}} > {{\bfb\currentlistentrytitle}} > { \currentlistentrytitle}\NC\NR > > However, there are syntax errors and the conditional expression > assumes that the ToC is being placed on every page. This assumption > allows it to resolve the namedstructureheadlocation value. For a ToC > at the start of a document, there is no "current chapter" and so the > head location for the chapter entry returns 0. > > Here is what I have so far: > > \startsetups [list:TOC] > \starttabulate > \currentlistentrypagenumber{} \hskip 1em \NC \currentlistentrytitle{} \NR > \stoptabulate > \stopsetups > > \definelistalternative > [TOC] > [renderingsetup=list:TOC] > > % Format the ToC style. > \setupcombinedlist[content][ > alternative=TOC, > ] > > \starttext > \completecontent > \startchapter [title=alpha] \stopchapter > \startsection[title=alphasec] \stopsection > \startchapter [title=beta] \stopchapter > \startsection[title=alphasec] \stopsection > \startchapter [title=gamma] \stopchapter > \startsection[title=alphasec] \stopsection > \stoptext > > How do you determine whether or not the chapter title should be displayed? \define[3]\SectionListEntry {\par \leftaligned\bgroup \hbox to 2em{\color[red]{#3}}% \hskip 1em \vtop{\hsize\dimexpr\textwidth-3em\relax#2} \egroup \par} \setuplist[chapter][headnumber=no,pagenumber=no,style=\bfc] \setuplist[section][alternative=command,command=\SectionListEntry] \starttext \completecontent \dorecurse{100} {\chapter{Chapter #1} \dorecurse{2}{\section{Section #1.##1}}} \stoptext Wolfgang ___________________________________________________________________________________ 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 ___________________________________________________________________________________