ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Increment the section counter
@ 2017-09-12 15:06 Fabrice Couvreur
  2017-09-12 16:55 ` Rik Kabel
  2017-09-12 17:59 ` Wolfgang Schuster
  0 siblings, 2 replies; 5+ messages in thread
From: Fabrice Couvreur @ 2017-09-12 15:06 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 92 bytes --]

Hello,
The number of the sections is 1 2 3 ...
How to make it 3 5 6 ... ?
Thank you
Fabrice

[-- Attachment #1.2: Type: text/html, Size: 323 bytes --]

[-- Attachment #2: Type: text/plain, Size: 492 bytes --]

___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Increment the section counter
  2017-09-12 15:06 Increment the section counter Fabrice Couvreur
@ 2017-09-12 16:55 ` Rik Kabel
  2017-09-12 17:59 ` Wolfgang Schuster
  1 sibling, 0 replies; 5+ messages in thread
From: Rik Kabel @ 2017-09-12 16:55 UTC (permalink / raw)
  To: ntg-context


[-- Attachment #1.1: Type: text/plain, Size: 1180 bytes --]

On 2017-09-12 11:06, Fabrice Couvreur wrote:
> Hello,
> The number of the sections is 1 2 3 ...
> How to make it 3 5 6 ... ?
> Thank you
> Fabrice
>
>
> ___________________________________________________________________________________
> 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://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki     : http://contextgarden.net
> ___________________________________________________________________________________

There are at least two ways.

You can create two hidden sections before your first section, 
effectively adding two to the section number, or you can explicitly set 
the section number, which allows increments and decrements.

See Pablo’s reply to a similar query at 
https://www.mail-archive.com/ntg-context@ntg.nl/msg78173.html, and see 
the relevant wiki pages at setupheadnumber 
<http://wiki.contextgarden.net/Command/setupheadnumber> and definehead 
<http://wiki.contextgarden.net/Command/definehead>.

-- 
Rik


[-- Attachment #1.2: Type: text/html, Size: 2668 bytes --]

[-- Attachment #2: Type: text/plain, Size: 492 bytes --]

___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Increment the section counter
  2017-09-12 15:06 Increment the section counter Fabrice Couvreur
  2017-09-12 16:55 ` Rik Kabel
@ 2017-09-12 17:59 ` Wolfgang Schuster
  2017-09-12 21:37   ` Fabrice Couvreur
  2017-09-14 13:35   ` Procházka Lukáš Ing.
  1 sibling, 2 replies; 5+ messages in thread
From: Wolfgang Schuster @ 2017-09-12 17:59 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1057 bytes --]

You can enable manual numbering


\setuphead[section][ownnumber=yes]

\starttext

\section{3}{Section 1}

\section{5}{Section 1}

\section{6}{Section 1}

\stoptext


or use a custom conversion


\defineconversion[drunk][3,5,6]

\setuphead[section][conversion=drunk]

\starttext

\dorecurse{3}{\expanded{\section{Section \recurselevel}}}

\stoptext


Wolfgang

> Fabrice Couvreur <mailto:fabrice1.couvreur@gmail.com>
> 12. September 2017 um 17:06
> Hello,
> The number of the sections is 1 2 3 ...
> How to make it 3 5 6 ... ?
> Thank you
> Fabrice
> ___________________________________________________________________________________
> 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://context.aanhet.net
> archive : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
> ___________________________________________________________________________________


[-- Attachment #1.2: Type: text/html, Size: 2890 bytes --]

[-- Attachment #2: Type: text/plain, Size: 492 bytes --]

___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Increment the section counter
  2017-09-12 17:59 ` Wolfgang Schuster
@ 2017-09-12 21:37   ` Fabrice Couvreur
  2017-09-14 13:35   ` Procházka Lukáš Ing.
  1 sibling, 0 replies; 5+ messages in thread
From: Fabrice Couvreur @ 2017-09-12 21:37 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1772 bytes --]

Hi,
Thank you Wolgang for your solution
Thanks also to Rik
Fabrice

2017-09-12 19:59 GMT+02:00 Wolfgang Schuster <schuster.wolfgang@gmail.com>:

> You can enable manual numbering
>
>
> \setuphead[section][ownnumber=yes]
>
> \starttext
>
> \section{3}{Section 1}
>
> \section{5}{Section 1}
>
> \section{6}{Section 1}
>
> \stoptext
>
>
> or use a custom conversion
>
>
> \defineconversion[drunk][3,5,6]
>
> \setuphead[section][conversion=drunk]
>
> \starttext
>
> \dorecurse{3}{\expanded{\section{Section \recurselevel}}}
>
> \stoptext
>
>
> Wolfgang
>
> Fabrice Couvreur <fabrice1.couvreur@gmail.com>
> 12. September 2017 um 17:06
> Hello,
> The number of the sections is 1 2 3 ...
> How to make it 3 5 6 ... ?
> Thank you
> Fabrice
> ____________________________________________________________
> _______________________
> 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://context.aanhet.net
> archive : https://bitbucket.org/phg/context-mirror/commits/
> wiki : http://contextgarden.net
> ____________________________________________________________
> _______________________
>
>
>
> ____________________________________________________________
> _______________________
> 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://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki     : http://contextgarden.net
> ____________________________________________________________
> _______________________
>

[-- Attachment #1.2: Type: text/html, Size: 4874 bytes --]

[-- Attachment #2: Type: text/plain, Size: 492 bytes --]

___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Increment the section counter
  2017-09-12 17:59 ` Wolfgang Schuster
  2017-09-12 21:37   ` Fabrice Couvreur
@ 2017-09-14 13:35   ` Procházka Lukáš Ing.
  1 sibling, 0 replies; 5+ messages in thread
From: Procházka Lukáš Ing. @ 2017-09-14 13:35 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: text/plain, Size: 1237 bytes --]

Hello,

BTW, I needed to add a section numbered by zero some time ago;
there is a solution which uses "conversion" parameter.

When one needs to add a zero based section "manually" (ad hoc), there is another solution, too:

----
\starttext
   \bgroup
     \setuphead[section][ownnumber=yes]
     \section{0}{Zero}
       \subsection{SSecA}
     \setupheadnumber[section][0]
   \egroup
   %
   \section{Sec}
     \subsection{SSecB}
   \section{Sec2}
\stoptext
----

Best regards,

Lukas


On Tue, 12 Sep 2017 19:59:30 +0200, Wolfgang Schuster <schuster.wolfgang@gmail.com> wrote:

> You can enable manual numbering
>
>
> \setuphead[section][ownnumber=yes]
>
> \starttext
>
> \section{3}{Section 1}
>
> \section{5}{Section 1}
>
> \section{6}{Section 1}
>
> \stoptext
>
>
> or use a custom conversion
>
>
> \defineconversion[drunk][3,5,6]
>
> \setuphead[section][conversion=drunk]
>
> \starttext
>
> \dorecurse{3}{\expanded{\section{Section \recurselevel}}}
>
> \stoptext
>
>
> Wolfgang


-- 
Ing. Lukáš Procházka | mailto:LPr@pontex.cz
Pontex s. r. o.      | mailto:pontex@pontex.cz | http://www.pontex.cz | IDDS:nrpt3sn
Bezová 1658
147 14 Praha 4

Mob.: +420 702 033 396

[-- Attachment #2: Sec0.mkiv --]
[-- Type: application/octet-stream, Size: 232 bytes --]

\starttext
  \bgroup
    \setuphead[section][ownnumber=yes]
    \section{0}{Zero}
      \subsection{SSecA}
    \setupheadnumber[section][0]
  \egroup
  %
  \section{Sec}
    \subsection{SSecB}
  \section{Sec2}
\stoptext

[-- Attachment #3: Sec0.pdf --]
[-- Type: application/pdf, Size: 7058 bytes --]

[-- Attachment #4: Type: text/plain, Size: 492 bytes --]

___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-09-14 13:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-12 15:06 Increment the section counter Fabrice Couvreur
2017-09-12 16:55 ` Rik Kabel
2017-09-12 17:59 ` Wolfgang Schuster
2017-09-12 21:37   ` Fabrice Couvreur
2017-09-14 13:35   ` Procházka Lukáš Ing.

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).