From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/21747 Path: news.gmane.org!not-for-mail From: Hans Hagen Newsgroups: gmane.comp.tex.context Subject: Re: Getting ToC to match page numbering Date: Mon, 01 Aug 2005 16:46:13 +0200 Message-ID: <42EE35B5.4010404@wxs.nl> References: <20050801100004.BCAD8127BF@ronja.ntg.nl> <42EE261F.1060908@capdm.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1122907815 8324 80.91.229.2 (1 Aug 2005 14:50:15 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 1 Aug 2005 14:50:15 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Mon Aug 01 16:50:13 2005 Return-path: Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by ciao.gmane.org with esmtp (Exim 4.43) id 1Dzbbf-0002pf-9N for gctc-ntg-context-518@m.gmane.org; Mon, 01 Aug 2005 16:49:31 +0200 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id CD3E6127C3; Mon, 1 Aug 2005 16:49:30 +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 19424-01; Mon, 1 Aug 2005 16:49:30 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 1EA60127BF; Mon, 1 Aug 2005 16:45:37 +0200 (CEST) Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id EDB8A127BF for ; Mon, 1 Aug 2005 16:45:35 +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 19209-03 for ; Mon, 1 Aug 2005 16:45:34 +0200 (CEST) Original-Received: from mailrelay01.solcon.nl (maillb.solcon.nl [212.45.32.200]) by ronja.ntg.nl (Postfix) with ESMTP id D992C127BD for ; Mon, 1 Aug 2005 16:45:34 +0200 (CEST) Original-Received: from server-1.pragma-net.nl (dsl-212-84-128-085.solcon.nl [212.84.128.85]) by mailrelay01.solcon.nl (8.12.11/SQL-8.12.11-5/8.12.11) with ESMTP id j71EjUEY001799 for ; Mon, 1 Aug 2005 16:45:30 +0200 Original-Received: by server-1.pragma-net.nl (Postfix, from userid 65534) id 4ED3B24C5A; Mon, 1 Aug 2005 15:59:49 +0200 (CEST) Original-Received: from [10.100.1.52] (unknown [10.100.1.52]) by server-1.pragma-net.nl (Postfix) with ESMTP id E157D1B332 for ; Mon, 1 Aug 2005 13:59:47 +0000 (UTC) User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) X-Accept-Language: en-us, en Original-To: mailing list for ConTeXt users In-Reply-To: <42EE261F.1060908@capdm.com> X-Virus-Scanned: ClamAV 0.86.1/1000/Sun Jul 31 21:28:06 2005 on mailrelay01 X-Virus-Status: Clean X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.5 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-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on smtp.ntg.nl X-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:21747 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:21747 Duncan Hothersall wrote: >I have three issues where page number formatting in the table of >contents is wrong compared to the pages themselves: > > i admit that this is a bit tricky; has to do with how numbers are used for selective purposed; maybe i'll rewrite that part some day (no need to be efficient nowadays) >1. The separator character in the actual pagenumbers is "/". In the ToC >it displays as a "-". > > \start \setuppagenumbering[numberseparator=/] \placecombinedlist[Xontents] \stop >2. I used "left=A" on the pagenumbering command in the appendices >because appendices are numbered A1, A2 etc. This gives the required >output for the actual pagenumbers, but there is no 'A' prefix in the ToC. > > indeed, since left/right is cosmetics an dit's easier to add that than to remov eit when you dont wan it, so: \setuplist[Appchapter][pagecommand=A] % or cleaner: pagecommand=\AppPrefix and \def\AppPrefix#1{A\enspace#1} >3. Similarly in the backmatter I have added a 'I/' prefix to the >pagenumber ("left={I/}"), which works on the pages but is not reflected >in the ToC. > > now you know how to do that wikiable: >%% Tested on live.contextgarden >\setupoutput[pdftex] >%% change appendix numbering from Character to numbers >\setupsection[section-2][appendixconversion=numbers] >%% define new chapter-like heads for different sections >\definehead[Frontchapter][chapter] >\definehead[Appchapter][chapter] >\definehead[Backchapter][chapter] >%% set up individual content lists and labels >\setuplist[Frontchapter][pagenumber=yes] >\setuplabeltext[en][chapter={Module }] >\setuplist[chapter][pagenumber=yes,chapternumber=yes,label=yes] >\setuplabeltext[en][Appchapter={Appendix }] >\setuplist[Appchapter][pagenumber=yes,chapternumber=yes,label=yes] >\setuplist[Backchapter][pagenumber=yes] >%% set up the combined list >\definecombinedlist[Xontents] > [part,Frontchapter,chapter,Appchapter,Backchapter,section] > [level=section,criterium=local] >\setupcombinedlist[Xontents][alternative=b,aligntitle=yes,distance=4em] >%% page numbering is output using the explicit \completepagenumber >%% command in the footer because the final output has rather >%% complicated footers which incorporate the page number. >\setupfootertexts[text] >[][{\inframed{\kern.3em\completepagenumber\kern.3em}}] >[][{\inframed{\kern.3em\completepagenumber\kern.3em}\hfill}] >\starttext >\startfrontmatter >%% page numbering is set up for each section >\setuppagenumbering[state=start,alternative={singlesided,doublesided}, >location=,chapternumber=no,partnumber=no,conversion=romannumerals] >\title{Contents} >\placecombinedlist[Xontents] >\Frontchapter{Test Intro} >\dorecurse{3}{\input tufte\par} >\stopfrontmatter >\startbodymatter >%% for the body and appendices we prefix the chapternumber and a '/' >\setuppagenumbering[state=start,alternative={singlesided,doublesided},location=, >way=bychapter,partnumber=no,chapternumber=yes,numberseparator={/}] >\chapter{Test Chapter} >\dorecurse{3}{\input tufte\par} >\chapter{Another Test Chapter} >\dorecurse{3}{\input tufte\par} >\stopbodymatter >\startappendices >\setuppagenumbering[state=start,alternative={singlesided,doublesided},location=, >way=bychapter,partnumber=no,left=A,chapternumber=yes,numberseparator={/}] >\Appchapter{Test Appendix} >\dorecurse{3}{\input tufte\par} >\stopappendices >\startbackmatter >%% for the backmatter we just prefix I/ (it's going to be the index) >\setuppagenumbering[state=start,alternative={singlesided,doublesided}, >location=,way=bychapter,left={I/}] >\setuppagenumber[number=1] >\Backchapter{Index} >\dorecurse{3}{\input tufte\par} >\stopbackmatter >\stoptext > > ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------