From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/21748 Path: news.gmane.org!not-for-mail From: Duncan Hothersall Newsgroups: gmane.comp.tex.context Subject: Re: Getting ToC to match page numbering Date: Mon, 01 Aug 2005 17:36:26 +0100 Message-ID: <42EE4F8A.6000903@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 Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1122914204 28713 80.91.229.2 (1 Aug 2005 16:36:44 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 1 Aug 2005 16:36:44 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Mon Aug 01 18:36:41 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 1DzdH3-0001t8-Fi for gctc-ntg-context-518@m.gmane.org; Mon, 01 Aug 2005 18:36:21 +0200 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 1083F127CB; Mon, 1 Aug 2005 18:36:21 +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 19937-01; Mon, 1 Aug 2005 18:36:16 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 9F203127B2; Mon, 1 Aug 2005 18:36:16 +0200 (CEST) Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 903E4127B2 for ; Mon, 1 Aug 2005 18:36:14 +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 19641-06 for ; Mon, 1 Aug 2005 18:36:13 +0200 (CEST) Original-Received: from liszt-05.ednet.co.uk (liszt-05.ednet.co.uk [212.20.226.26]) by ronja.ntg.nl (Postfix) with ESMTP id 67D6B127B0 for ; Mon, 1 Aug 2005 18:36:13 +0200 (CEST) Original-Received: from [192.168.254.41] (unknown [212.20.255.162]) by liszt-05.ednet.co.uk (Postfix) with ESMTP id E00E112ED85 for ; Mon, 1 Aug 2005 17:36:12 +0100 (BST) User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716) X-Accept-Language: en-us, en Original-To: ConTeXt List 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:21748 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:21748 > \start > \setuppagenumbering[numberseparator=/] > \placecombinedlist[Xontents] > \stop Ah, I see, \placecombinedlist uses the value of numberseparator active at the time it is called! Thanks. > 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} I had experimented with that, and it certainly works (I chose the second option, but dropped the \enspace), BUT... the page numbers column in the table of contents is now mis-aligned. I've pasted my revised minimal test file below, and if you run that you can see that things have gone squiggly. The frontmatter and appendices are aligned further to the right than the chapters and backmatter. Weird. I looked at the source and as far as I can tell the default pagecommand is just \strut#1, so I don't understand how alignment has been changed by redefining it, but it certainly seems to have. > wikiable: Will do; would be great to fix (or at least understand) the alignment before I do though, for completeness. :-) Thanks, Duncan Minimal test, now mostly working thanks to Hans: ---- %% 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 }] \def\AppPrefix#1{A#1} \setuplist[Appchapter][pagenumber=yes,chapternumber=yes,label=yes,pagecommand=\AppPrefix] \def\BackPrefix#1{I/#1} \setuplist[Backchapter][pagenumber=yes,pagecommand=\BackPrefix] %% 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} \setuppagenumbering[numberseparator=/] \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 ----