Re: Problem with numbering of listings in a book

Posted by Alexander Schwartz on
URL: https://discuss.asciidoctor.org/Problem-with-numbering-of-listings-in-a-book-tp7663p7664.html

The counter for listings is accessible via listing-number. You can clear the attribute or set it to any other numeric value.

The following code snippet

:listing-caption: Listing

.First Listing
[source]
----
Hi
----

:!listing-number:

.Another Listing
[source]
----
Hi
----
leads to the following output
Listing 1. First Listing
Hi

Listing 1. Another Listing
Hi
Tested with Asciidoctor 2.0.10. The manual states: To reset a counter attribute, unset the corresponding attribute using an attribute entry. The attribute entry must be adjacent to a block or else it is ignored.
Alexander Schwartz (alexander.schwartz@gmx.net)
https://www.ahus1.de