From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/30335 Path: news.gmane.org!not-for-mail From: "Mojca Miklavec" Newsgroups: gmane.comp.tex.context Subject: Re: using \doifnumberelse in a ToC numbercommand= Date: Wed, 16 Aug 2006 21:46:08 +0200 Message-ID: <6faad9f00608161246l2cd68086w90dbc84721692795@mail.gmail.com> References: <1155754139.3406.14.camel@vision.buscaluz.org> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1155757593 12690 80.91.229.2 (16 Aug 2006 19:46:33 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 16 Aug 2006 19:46:33 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Wed Aug 16 21:46:31 2006 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org 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 1GDRLJ-0007Zu-VP for gctc-ntg-context-518@m.gmane.org; Wed, 16 Aug 2006 21:46:22 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 8C70C1FE7D; Wed, 16 Aug 2006 21:46: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 13739-04; Wed, 16 Aug 2006 21:46:13 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 2DECC1FE6F; Wed, 16 Aug 2006 21:46:13 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 564CB1FE6F for ; Wed, 16 Aug 2006 21:46:11 +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 13790-02 for ; Wed, 16 Aug 2006 21:46:09 +0200 (CEST) Original-Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.191]) by ronja.ntg.nl (Postfix) with SMTP id 996201FB99 for ; Wed, 16 Aug 2006 21:46:09 +0200 (CEST) Original-Received: by nf-out-0910.google.com with SMTP id k26so838954nfc for ; Wed, 16 Aug 2006 12:46:09 -0700 (PDT) Original-Received: by 10.48.48.15 with SMTP id v15mr1180168nfv; Wed, 16 Aug 2006 12:46:08 -0700 (PDT) Original-Received: by 10.78.175.15 with HTTP; Wed, 16 Aug 2006 12:46:08 -0700 (PDT) Original-To: "mailing list for ConTeXt users" In-Reply-To: <1155754139.3406.14.camel@vision.buscaluz.org> Content-Disposition: inline X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.7 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-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:30335 Archived-At: On 8/16/06, Stuart Jansen wrote: > I asked this question a couple of days ago, but didn't get any takers. I > don't want to be a pest, but it's frustrating to be so close yet unable > to solve this final problem. Let's see if rephrasing the question helps. > > I'm trying to use \doifnumberelse in a \setuplist numbercommand= but it > isn't working. > > The simplified example below shows the very specific table of contents > layout I'm trying to accomplish. You will note that both the chapter > number and the appendix letter are labeled with "Appendix" when in fact > I want the chapter to be labeled "Chapter". > > Does anyone know either (a) how to get \doifnumberelse to work in this > situation or (b) if there's a better way I should have done this > instead. My guess is that \doifnunmberelse won't work since it's not only the number hidden there, but also formatting, conversion, ... etc. But I have no idea how to do it in some other way. You may take a look at the following, but it has the side-effect that it will not only be used in TOC, but also in text which is most probably not what you want: \def\mychapterlistnumber#1{\vbox{#1\crlf}} \def\mysectionlistnumber#1{\emspace\emspace} \def\mysectionlisttext#1{% \doifelse{#1}{Lab Tasks}{\hskip-1em\bf#1\hfilll}{#1}} \setuplist[chapter][width=1em,numberstyle=bold,% numbercommand=\mychapterlistnumber,textstyle=bold] \setuplist[section][width=2em,numbercommand=\mysectionlistnumber,% textcommand=\mysectionlisttext] \unprotect \setupsection [\s!section-2] [\v!appendix\c!conversion=appendixconversion, \c!conversion=chapterconversion,] \protect \def\appendixconversion#1{Appendix #1} \defineconversion[appendixconversion][\appendixconversion] \def\chapterconversion#1{Chapter #1} \defineconversion[chapterconversion][\chapterconversion] \starttext \bgroup{}Table of Contents\egroup\par \startcolumns[n=2,distance=.3in,balance=no] \bgroup \placelist[chapter,section][criterium=all,alternative=b] \egroup \stopcolumns \page \chapter{Foo} \section{Bar} \input knuth \startappendices \chapter{Corge} \section{Grault} \input zapf \stopappendices \stoptext Mojca