From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/116767 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Duncan Hothersall via ntg-context Newsgroups: gmane.comp.tex.context Subject: Re: numbering questions Date: Sat, 31 Dec 2022 18:20:20 +0000 Message-ID: References: <18f2f823-ac76-e606-9f66-7990f586a966@fiee.net> Reply-To: mailing list for ConTeXt users Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6535638643046009166==" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25543"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Duncan Hothersall To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Sat Dec 31 19:20:59 2022 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane-mx.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by ciao.gmane.io with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pBgTb-0006Rc-6o for gctc-ntg-context-518@m.gmane-mx.org; Sat, 31 Dec 2022 19:20:59 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 24FC838016C; Sat, 31 Dec 2022 19:20:41 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Zt8cQpreozDU; Sat, 31 Dec 2022 19:20:38 +0100 (CET) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id DD005380237; Sat, 31 Dec 2022 19:20:38 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 5810738016C for ; Sat, 31 Dec 2022 19:20:38 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Q_OpwComvAl4 for ; Sat, 31 Dec 2022 19:20:36 +0100 (CET) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=209.85.208.54; helo=mail-ed1-f54.google.com; envelope-from=dh@capdm.com; receiver= Original-Received: from mail-ed1-f54.google.com (mail-ed1-f54.google.com [209.85.208.54]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id 6F3833800C5 for ; Sat, 31 Dec 2022 19:20:36 +0100 (CET) Original-Received: by mail-ed1-f54.google.com with SMTP id b88so27503528edf.6 for ; Sat, 31 Dec 2022 10:20:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=capdm.com; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=Bua1liql2v9ed9hO77M8QGBt9qPqe10L6lSM1RlXb9s=; b=vkj7Dro55KTr/HtwsXhVyic6xmO8itfZmPiHYIpAigkPucLswMW5p+4bMHO3OubQLR kRcLDS/0myRIRJSSlmeNKZhwYpyyP4Wa2++PzrY38lFW56Nh98EcM+JbTu4eidlH5rGJ YZsMMjqQKOxiSNzTkSgg3RMgJLjKNP9qK2gLA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Bua1liql2v9ed9hO77M8QGBt9qPqe10L6lSM1RlXb9s=; b=bXgByvCflrAGcOf3pAem/acKlLR+o1uyHVvikQ/kl+yDSQvUWcBByApJ20KI9gZXvW R5HYuBFcRGyvTJCV8EbU1K1i14M9cmOYWS+ZM1iNYS6j8jH/ujvn2CLfWI/1YS27HvZo qiBFsM3lik2d+QlgrHUZ9lSHU3Sk8uS7HkT62reWg/OgL6pvjp8pn/iF3n0K59/QuwR8 26ItCnhz1skI53z3n9X4+XSe8DwrcgVVpoOmlWZU1JVvayG3Ak5O9LQic2EpfozcjLmz fawe/KB+GCrbNt42MwUeZtvCv9SOe0Y3zH5UpPM6+UFn3zsLbF3znh4OQkS0zas4PUij g7vw== X-Gm-Message-State: AFqh2krryBA7rSSHLHqAgiZhfGprPs1Xjqh0/wSJI6U9QQJEwoP4YmgK VAzpN9QX9TxDM2elfCq1GydDIPmnK20KefqrUf27MdFx/bfvLP4+ X-Google-Smtp-Source: AMrXdXvtwiO+dwDOxCerKDY5EK8dBoiSvl2urY+SP6FZEp0fN7RzLu/DgZCimwDFvmHm68zq79z28wiZnJOWavaF1Hs= X-Received: by 2002:a05:6402:4146:b0:46b:7038:b1f9 with SMTP id x6-20020a056402414600b0046b7038b1f9mr3995504eda.306.1672510835650; Sat, 31 Dec 2022 10:20:35 -0800 (PST) In-Reply-To: <18f2f823-ac76-e606-9f66-7990f586a966@fiee.net> X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.26 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.io gmane.comp.tex.context:116767 Archived-At: --===============6535638643046009166== Content-Type: multipart/alternative; boundary="0000000000003e061905f123c6a9" --0000000000003e061905f123c6a9 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I can't test right now but would something like \setuphead[Day][sectionsegments=3DDay:Month:Year] help? Duncan On Sat, 31 Dec 2022 at 17:24, Henning Hraban Ramm via ntg-context < ntg-context@ntg.nl> wrote: > A happy new year to everyone! > > I=E2=80=99m playing with some examples of section numbering. > > * Is there a setup to influence the order of number segments? I.e. can I > have =E2=80=9Csection.chapter.part=E2=80=9C instead of =E2=80=9Cpart.chap= ter.section=E2=80=9D? > > * How can I format the segments, e.g. to get two or three digits each > (leading zeros)? > > * I can force a section number with =E2=80=9Cownnumber=E2=80=9D, but the = next one is > back in the previous scheme. Itemize has =E2=80=9Cstart=E2=80=9D. How can= I start > section chapter numbering at 3 (or -1 or whatever; I know I can start at > 0 with =E2=80=9Czero=E2=80=9D) and let ConTeXt continue from there? > > > My example tries to (ab)use the section numbering for a date (e.g. for a > diary): > > ----- > \definestructureconversionset[default][n,n,month,n][n] > \definestructureseparatorset [default][-,-,-,-] > > \definehead[Year][chapter] > \definehead[Month][section] > \definehead[Day][subsection] > > \define[2]\TitleCmd{#1} % number only > > \setuphead[Year,Month,Day][number=3Dyes,page=3Dno,command=3D\TitleCmd] > \setuphead[Year][page=3Dyes] > %\setuphead[Month][] > \setuphead[Day][style=3D{\ss\bf}] > > \def\Dummycontent{ > \dorecurse{12}{ > \startMonth > New Month. > > \dorecurse{5}{ > \startDay > Another day. > > \stopDay > } > > \stopMonth > }} > > \starttext > > \startYear[ownnumber=3D2023,title=3DThis] > A new year begins. > > \Dummycontent > > \stopYear > > \startYear > Next year. > > \Dummycontent > > \stopYear > > \stoptext > ----- > > Hraban > > > _________________________________________________________________________= __________ > If your question is of interest to others as well, please add an entry to > the Wiki! > > maillist : ntg-context@ntg.nl / > https://www.ntg.nl/mailman/listinfo/ntg-context > webpage : https://www.pragma-ade.nl / http://context.aanhet.net > archive : https://bitbucket.org/phg/context-mirror/commits/ > wiki : https://contextgarden.net > > _________________________________________________________________________= __________ > --0000000000003e061905f123c6a9 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I can't test right now but would something like=C2=A0<= div>
\setuphead[Day][sectionsegments=3DDay:Month:Year]
<= div>
help?

Duncan


<= div dir=3D"ltr" class=3D"gmail_attr">On Sat, 31 Dec 2022 at 17:24, Henning = Hraban Ramm via ntg-context <ntg-context@ntg.nl> wrote:
A happy new year to everyone!

I=E2=80=99m playing with some examples of section numbering.

* Is there a setup to influence the order of number segments? I.e. can I have =E2=80=9Csection.chapter.part=E2=80=9C instead of =E2=80=9Cpart.chapte= r.section=E2=80=9D?

* How can I format the segments, e.g. to get two or three digits each
(leading zeros)?

* I can force a section number with =E2=80=9Cownnumber=E2=80=9D, but the ne= xt one is
back in the previous scheme. Itemize has =E2=80=9Cstart=E2=80=9D. How can I= start
section chapter numbering at 3 (or -1 or whatever; I know I can start at 0 with =E2=80=9Czero=E2=80=9D) and let ConTeXt continue from there?


My example tries to (ab)use the section numbering for a date (e.g. for a diary):

-----
\definestructureconversionset[default][n,n,month,n][n]
\definestructureseparatorset [default][-,-,-,-]

\definehead[Year][chapter]
\definehead[Month][section]
\definehead[Day][subsection]

\define[2]\TitleCmd{#1} % number only

\setuphead[Year,Month,Day][number=3Dyes,page=3Dno,command=3D\TitleCmd]
\setuphead[Year][page=3Dyes]
%\setuphead[Month][]
\setuphead[Day][style=3D{\ss\bf}]

\def\Dummycontent{
=C2=A0 =C2=A0 =C2=A0\dorecurse{12}{
=C2=A0 =C2=A0 =C2=A0\startMonth
=C2=A0 =C2=A0 =C2=A0New Month.

=C2=A0 =C2=A0 =C2=A0\dorecurse{5}{
=C2=A0 =C2=A0 =C2=A0\startDay
=C2=A0 =C2=A0 =C2=A0Another day.

=C2=A0 =C2=A0 =C2=A0\stopDay
=C2=A0 =C2=A0 =C2=A0}

=C2=A0 =C2=A0 =C2=A0\stopMonth
}}

\starttext

\startYear[ownnumber=3D2023,title=3DThis]
A new year begins.

\Dummycontent

\stopYear

\startYear
Next year.

\Dummycontent

\stopYear

\stoptext
-----

Hraban

___________________________________________________________________________= ________
If your question is of interest to others as well, please add an entry to t= he Wiki!

maillist : ntg-cont= ext@ntg.nl / https://www.ntg.nl/mailman/listinfo/= ntg-context
webpage=C2=A0 : https://www.pragma-ade.nl / http://context.aanhet.net
archive=C2=A0 :
https://bitbucket.org/phg/context-m= irror/commits/
wiki=C2=A0 =C2=A0 =C2=A0: https://contextgarden.net
___________________________________________________________________________= ________
--0000000000003e061905f123c6a9-- --===============6535638643046009166== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cHM6Ly93d3cubnRnLm5sL21haWxtYW4v bGlzdGluZm8vbnRnLWNvbnRleHQKd2VicGFnZSAgOiBodHRwczovL3d3dy5wcmFnbWEtYWRlLm5s IC8gaHR0cDovL2NvbnRleHQuYWFuaGV0Lm5ldAphcmNoaXZlICA6IGh0dHBzOi8vYml0YnVja2V0 Lm9yZy9waGcvY29udGV4dC1taXJyb3IvY29tbWl0cy8Kd2lraSAgICAgOiBodHRwczovL2NvbnRl eHRnYXJkZW4ubmV0Cl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCg== --===============6535638643046009166==--