Setting the Starting sectnum

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Setting the Starting sectnum

Tom Swan
I would like to be able to begin section numbering with 12.1, 12.2, 12.3 etc, but it seems :sectnum: always starts with 1. Is there a way to set the starting number and then have automatic numbering continue from there?
www.tomswan.com
Reply | Threaded
Open this post in threaded view
|

Re: Setting the Starting sectnum

rockyallen
I don't think it is in Asciidoctor core yet, but when this came up in issue 1113  Dan pointed to this extension


Reply | Threaded
Open this post in threaded view
|

Re: Setting the Starting sectnum

mojavelinux
Administrator
In reply to this post by Tom Swan
At the moment this can be done with a Treeprocessor.


There's an open issue to add this behavior to core. See https://github.com/asciidoctor/asciidoctor/issues/1434

-Dan

On Sun, Dec 18, 2016 at 5:00 PM, Tom Swan [via Asciidoctor :: Discussion] <[hidden email]> wrote:
I would like to be able to begin section numbering with 12.1, 12.2, 12.3 etc, but it seems :sectnum: always starts with 1. Is there a way to set the starting number and then have automatic numbering continue from there?



If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Setting-the-Starting-sectnum-tp5157.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML



--
Dan Allen | @mojavelinux | https://twitter.com/mojavelinux
Reply | Threaded
Open this post in threaded view
|

Re: Setting the Starting sectnum

mojavelinux
Administrator
In reply to this post by rockyallen
Spot on, rocky!

-Dan

On Sun, Dec 18, 2016 at 5:45 PM, rockyallen [via Asciidoctor :: Discussion] <[hidden email]> wrote:
I don't think it is in Asciidoctor core yet, but when this came up in issue 1113  Dan pointed to this extension





If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Setting-the-Starting-sectnum-tp5157p5158.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML



--
Dan Allen | @mojavelinux | https://twitter.com/mojavelinux
Reply | Threaded
Open this post in threaded view
|

Re: Setting the Starting sectnum

Tom Swan
In reply to this post by rockyallen

Thank you! That's exactly what I needed. I hope this change does make it into core -- I would definitely find this feature useful. -- Tom

On December 18, 2016 at 7:45 PM "rockyallen [via Asciidoctor :: Discussion]" <[hidden email]> wrote:

I don't think it is in Asciidoctor core yet, but when this came up in issue 1113  Dan pointed to this extension





If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Setting-the-Starting-sectnum-tp5157p5158.html
To unsubscribe from Setting the Starting sectnum, click here.
NAML
www.tomswan.com
Reply | Threaded
Open this post in threaded view
|

Re: Setting the Starting sectnum

Tom Swan
In reply to this post by mojavelinux
That works great. Thank you Rocky and Dan. To get chapter 12's numbers correct, it seems sectnumoffset must be 11. Is that intentional? (No biggie either way.) Following is the command I use with the extension in the current path. -- Tom

  asciidoctor -r ./sectnumoffset-treeprocessor.rb -a sectnums -a sectnumoffset=11 c12.txt
www.tomswan.com
Reply | Threaded
Open this post in threaded view
|

Re: Setting the Starting sectnum

mojavelinux
Administrator
Correct. That's because sectnumoffset is an offset (the amount added to the starting number), not a start number itself. Though, we could consider changing the attribute to sectnumstart.

-Dan

On Sun, Dec 18, 2016 at 6:19 PM, Tom Swan [via Asciidoctor :: Discussion] <[hidden email]> wrote:
That works great. Thank you Rocky and Dan. To get chapter 12's numbers correct, it seems sectnumoffset must be 11. Is that intentional? (No biggie either way.) Following is the command I use with the extension in the current path. -- Tom

  asciidoctor -r ./sectnumoffset-treeprocessor.rb -a sectnums -a sectnumoffset=11 c12.txt


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Setting-the-Starting-sectnum-tp5157p5162.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML



--
Dan Allen | @mojavelinux | https://twitter.com/mojavelinux
Reply | Threaded
Open this post in threaded view
|

Re: Setting the Starting sectnum

Tom Swan
Got it. sectnumstart is probably simpler. -- Tom

On December 18, 2016 at 9:50 PM "mojavelinux [via Asciidoctor :: Discussion]" <[hidden email]> wrote:

Correct. That's because sectnumoffset is an offset (the amount added to the starting number), not a start number itself. Though, we could consider changing the attribute to sectnumstart.

-Dan

On Sun, Dec 18, 2016 at 6:19 PM, Tom Swan [via Asciidoctor :: Discussion] <[hidden email]> wrote:
That works great. Thank you Rocky and Dan. To get chapter 12's numbers correct, it seems sectnumoffset must be 11. Is that intentional? (No biggie either way.) Following is the command I use with the extension in the current path. -- Tom

  asciidoctor -r ./sectnumoffset-treeprocessor.rb -a sectnums -a sectnumoffset=11 c12.txt


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Setting-the-Starting-sectnum-tp5157p5162.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML



--
Dan Allen | @mojavelinux | https://twitter.com/mojavelinux



If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Setting-the-Starting-sectnum-tp5157p5163.html
To unsubscribe from Setting the Starting sectnum, click here.
NAML

 
www.tomswan.com