Re: Section number calculation

Posted by habamax on
URL: https://discuss.asciidoctor.org/Section-number-calculation-tp7771p7777.html

Not sure I understand correctly what is the problem...

So, to recap:

1. You have main doc file and several included docs
2. You want sections of included docs to be properly numbered when :sectnums: option is set

Is this correct?

By default include directive includes files as is, meaning that if you have
titles in included docs they will be titles in result doc which is usually not what you want.

If you read manual regarding include https://asciidoctor.org/docs/user-manual/#include-directive
you will find that it has options. The one we are interested in is
leveloffset. It makes all headings including title to be offset by the level
you set:

include::my_file_with_title.adoc[leveloffset=+1]

will include my_file_with_title.adoc and make all headings offset by 1 level.


Hope it will help, cheers!