Login  Register

Re: Dynamic Figure Indexing

Posted by mojavelinux on Oct 28, 2018; 10:35pm
URL: https://discuss.asciidoctor.org/Dynamic-Figure-Indexing-tp6556p6557.html

You can write a tree processor that visits all the figures in a document and sets an explicit caption.

In fact, there's already an extension available that does something similar to what you are asking. See https://github.com/asciidoctor/asciidoctor-extensions-lab/blob/master/lib/autoxref-treeprocessor.rb

Cheers,

-Dan

On Sun, Oct 28, 2018 at 2:18 PM ellieborden [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Is there a way to assign figure numbers dynamically using Asciidoctor?

I indexed them by section so, for example, the third figure in section 6 is captioned Figure 6.03.

The problem is that I currently have these captions hard-coded and if I want to insert a new section, I have to rename all of the figure captions and references within all of the following sections.

Here is my document for reference. 





If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Dynamic-Figure-Indexing-tp6556.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