From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/87039 Path: news.gmane.org!not-for-mail From: Maggyero Newsgroups: gmane.comp.tex.context Subject: Getting the current chapter number in the TOC Date: Thu, 17 Apr 2014 17:27:16 +0200 Message-ID: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0485116594==" X-Trace: ger.gmane.org 1397748458 20203 80.91.229.3 (17 Apr 2014 15:27:38 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 17 Apr 2014 15:27:38 +0000 (UTC) To: ntg-context@ntg.nl Original-X-From: ntg-context-bounces@ntg.nl Thu Apr 17 17:27:34 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 1WaoDu-0002Kf-3e for gctc-ntg-context-518@m.gmane.org; Thu, 17 Apr 2014 17:27:34 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 82FEA10258 for ; Thu, 17 Apr 2014 17:27:33 +0200 (CEST) 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 32hhxvHvyeOQ for ; Thu, 17 Apr 2014 17:27:33 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 0DCBE1025D for ; Thu, 17 Apr 2014 17:27:29 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 7AA99101E7 for ; Thu, 17 Apr 2014 17:27:24 +0200 (CEST) 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 NQy1Rbw83sRK for ; Thu, 17 Apr 2014 17:27:23 +0200 (CEST) Original-Received: from filter3-til.mf.surf.net (filter3-til.mf.surf.net [194.171.167.219]) by balder.ntg.nl (Postfix) with ESMTP id EAB7B101E3 for ; Thu, 17 Apr 2014 17:27:17 +0200 (CEST) Original-Received: from mail-we0-x22a.google.com (mail-we0-x22a.google.com [IPv6:2a00:1450:400c:c03::22a]) by filter3-til.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id s3HFRGcr018983 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Thu, 17 Apr 2014 17:27:17 +0200 Original-Received: by mail-we0-f170.google.com with SMTP id w61so588973wes.29 for ; Thu, 17 Apr 2014 08:27:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=9nUvhLEKuF6XiR+rTJj1KSyEwP0a48D61U1jI/j44UM=; b=nLxEgppPNcsNQ5R0bdWfZNfnnGh/CBKBZCyS2oxy+5aYjiZiLK5RG9C8FzsFxIIk/5 Ihum5XttCwJsDDP/OGYj8Z4TOcnqCAHhHjKptGk85WCN2dABU76566kfb6GsvWlJK+Hk jT59hBJ2sazKQGbjcWcGV82i+em9lnCDIdoM1O+ERnMPKPfH+wjpmopCF4+gYMoskmsA AceCy/Cnfo3H8o6pVRlpBHbOTGzHGDkGqdRyuawmd1k0LQ3051pkFFbtlB93Nz82zyZM JBymG5Zh7ZSptgAaa2SFmHKbUhp0zfctigkCPaYcLCSY/mW5QcN/OBgj95R7k20lcUAF ISJQ== X-Received: by 10.194.176.226 with SMTP id cl2mr2657275wjc.55.1397748436833; Thu, 17 Apr 2014 08:27:16 -0700 (PDT) Original-Received: by 10.216.159.132 with HTTP; Thu, 17 Apr 2014 08:27:16 -0700 (PDT) X-Bayes-Prob: 0.0001 (Score 0, tokens from: ntg-context@ntg.nl, base:default, @@RPTN) X-CanIt-Geo: ip=2a00:1450:400c:c03::22a; country=IE X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 06LP3rhkV - 90c057ea7215 - 20140417 (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:87039 Archived-At: --===============0485116594== Content-Type: multipart/alternative; boundary=089e0112c3ea101d6304f73eab50 --089e0112c3ea101d6304f73eab50 Content-Type: text/plain; charset=UTF-8 Hello, How can I get the following table of contents? Contents Chapter first MyTitle Chapter II MyTitle Chapter III MyTitle I have tried: \MyNumber{\doifelse{\currentsectioncountervalue}{1}{first}{#1}} setuplist[chapter][numbercommand=\MyNumber] but it does not work. Actually because \currentsectioncountervalue always returns 0 in the table of contents. So I need another command which gives me the current number for testing if it is equal to one (first chapter). Thank you in advance. --089e0112c3ea101d6304f73eab50 Content-Type: text/html; charset=UTF-8
Hello,


How can I get the following table of contents?


Contents

Chapter first MyTitle
Chapter II MyTitle
Chapter III MyTitle


I have tried:

\MyNumber{\doifelse{\currentsectioncountervalue}{1}{first}{#1}}
setuplist[chapter][numbercommand=\MyNumber]

but it does not work. Actually because \currentsectioncountervalue always returns 0 in the table of contents. So I need another command which gives me the current number for testing if it is equal to one (first chapter).


Thank you in advance.
--089e0112c3ea101d6304f73eab50-- --===============0485116594== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ___________________________________________________________________________________ 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 ___________________________________________________________________________________ --===============0485116594==--