From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/92517 Path: news.gmane.org!not-for-mail From: Wolfgang Schuster Newsgroups: gmane.comp.tex.context Subject: Re: \setupheadnumber and zero Date: Tue, 08 Sep 2015 21:10:51 +0200 Message-ID: <55EF32BB.3070500@gmail.com> References: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0505416790==" X-Trace: ger.gmane.org 1441739518 24803 80.91.229.3 (8 Sep 2015 19:11:58 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 8 Sep 2015 19:11:58 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Tue Sep 08 21:11:47 2015 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 1ZZOIq-0000OZ-VF for gctc-ntg-context-518@m.gmane.org; Tue, 08 Sep 2015 21:11:37 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 766151022A for ; Tue, 8 Sep 2015 21:11:36 +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 wFUYCM6fzFHy for ; Tue, 8 Sep 2015 21:11:32 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id E8BA81023C for ; Tue, 8 Sep 2015 21:11:05 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 615CC101F6 for ; Tue, 8 Sep 2015 21:11:01 +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 sAt28mDFgIA9 for ; Tue, 8 Sep 2015 21:11:00 +0200 (CEST) Original-Received: from filter4-ams.mf.surf.net (filter4-ams.mf.surf.net [192.87.102.72]) by balder.ntg.nl (Postfix) with ESMTP id A321D101E8 for ; Tue, 8 Sep 2015 21:11:00 +0200 (CEST) Original-Received: from mail-wi0-x22e.google.com (mail-wi0-x22e.google.com [IPv6:2a00:1450:400c:c05::22e]) by filter4-ams.mf.surf.net (8.14.4/8.14.4/Debian-4) with ESMTP id t88JAxjH000550 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=NOT) for ; Tue, 8 Sep 2015 21:10:59 +0200 Original-Received: by wicge5 with SMTP id ge5so128562336wic.0 for ; Tue, 08 Sep 2015 12:10:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type; bh=MHD2ypD4J1KtQA4HNF7q5xOSy/gv/+2/jCfsVulLIqQ=; b=Up940Z2hvaQHCJedPPAbh2BRik2gUc8xk1Vs+W472R7vgJamzAx18uVxKWXdcQhFoB pAp6mfrmPyPULUg5AAhCleznlj2Lpf0LIpRfufQ1VsXVrGIDcRh2KBrxXcacWRYuTIKH flROdT4Iqi+YICg6PYLak7okQ7PaENprfYopx92pE/Hw8Y8bmH8Ayg02dRFsrT6OhzVR 9Na/HjXZwuf7KLn1vk/TahGsUYr0OvhVSr5bJyU4Av+tsdw8ESsEKO+Az6BFI8Zwnx0w wXpZZf8EQl/YoGtrNtwS3PZwCF8+0pFtz8GDfuRP779/SENOpcvdCp99uRTMLFInO7/+ JZ2Q== X-Received: by 10.180.39.172 with SMTP id q12mr47425579wik.17.1441739459310; Tue, 08 Sep 2015 12:10:59 -0700 (PDT) Original-Received: from keima.localdomain (x2f28b18.dyn.telefonica.de. [2.242.139.24]) by smtp.googlemail.com with ESMTPSA id lh3sm6281071wjc.44.2015.09.08.12.10.57 for (version=TLSv1/SSLv3 cipher=OTHER); Tue, 08 Sep 2015 12:10:58 -0700 (PDT) User-Agent: Postbox 4.0.4 (Macintosh/20150825) In-Reply-To: X-Bayes-Prob: 0.0001 (Score 0, tokens from: ntg-context@ntg.nl, base:default, @@RPTN) X-CanIt-Geo: ip=2a00:1450:400c:c05::22e; country=BE; region=Brussels Capital; city=Brussels; latitude=50.8466; longitude=4.3528; http://maps.google.com/maps?q=50.8466,4.3528&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 01PeHaXfB - e4149f73b1cf - 20150908 (trained as not-spam) Received-SPF: pass (filter4-ams.mf.surf.net: domain of schuster.wolfgang@gmail.com designates 2a00:1450:400c:c05::22e as permitted sender) receiver=filter4-ams.mf.surf.net; client-ip=2a00:1450:400c:c05::22e; envelope-from=; helo=mail-wi0-x22e.google.com; identity=mailfrom X-Scanned-By: CanIt (www . roaringpenguin . com) X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.16 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" Xref: news.gmane.org gmane.comp.tex.context:92517 Archived-At: This is a multi-part message in MIME format. --===============0505416790== Content-Type: multipart/alternative; boundary="------------010003000704080409050209" This is a multi-part message in MIME format. --------------010003000704080409050209 Content-Type: text/plain; charset=ISO-8859-2; format=flowed Content-Transfer-Encoding: quoted-printable > Proch=E1zka Luk=E1=B9 Ing. - Pontex s. r. o. > 29. August 2015 16:11 > Hello, > > can a section head be generated with the number 0 (or less)? > > Sometimes I need to prepend a section while keeping existing section=20 > head numbers... > > Example: > > ---- > \starttext > \setupheadnumber[chapter][-1] > \chapter{Ch0} % Getting "Ch0" instead of "0. Ch0"? > \chapter{Ch1} > \stoptext > ---- > > Here, "0. Ch0" is not generated, the zero is not displayed; why? You can't set a negative number for the start of the counter but you can=20 change the appereance. \defineexpandable[1]\PreviousNumber {\number\numexpr#1-1\relax} \defineconversion[PreviousNumber][\PreviousNumber] \defineconversionset[zerostart][n,PreviousNumber][n] \setuphead[chapter,section][sectionconversionset=3Dzerostart] \starttext \chapter{First chapter} \chapter{Second chapter} \stoptext Wolfgang --------------010003000704080409050209 Content-Type: text/html; charset=ISO-8859-2 Content-Transfer-Encoding: quoted-printable
29= .=20 August 2015 16:11
Hello,

can a section head be generated with the number 0 (or less)?

Sometimes I need to prepend a section while keeping existing section head numbers...

Example:

----
\starttext
=A0 \setupheadnumber[chapter][-1]
=A0 \chapter{Ch0} % Getting "Ch0" instead of "0. Ch0"?
=A0 \chapter{Ch1}
\stoptext
----

Here, "0. Ch0" is not generated, the zero is not displayed; why?
You can’t set a negative number for the start of the counter but yo= u can change the appereance.

\defineexpandable[1]\PreviousNumber
=A0 {\number\numexpr#1-1\relax}

\defineconversion[PreviousNumber][\PreviousNumber]

\defineconversionset[zerostart][n,PreviousNumber][n]

\setuphead[chapter,section][sectionconversionset=3Dzerostart]

\starttext
\chapter{First chapter}
\chapter{Second chapter}
\stoptext

Wolfgang
--------------010003000704080409050209-- --===============0505416790== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly90ZXguYWFuaGV0Lm5ldAphcmNoaXZlICA6IGh0dHA6Ly9mb3VuZHJ5LnN1cGVsZWMu ZnIvcHJvamVjdHMvY29udGV4dHJldi8Kd2lraSAgICAgOiBodHRwOi8vY29udGV4dGdhcmRlbi5u ZXQKX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX18= --===============0505416790==--