Incorrect figure numbering when my document is split across multiple files

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

Incorrect figure numbering when my document is split across multiple files

siddjain
I have a document that is split into multiple files. My top level adoc looks like this:

:doctype: book
:leveloffset: 1

include::chap01.adoc[]

include::chap02.adoc[]

My chap02.adoc header has

:chapter: 2
:figure: 0

and I insert images into the chapter like

[id=transaction_flow, reftext={chapter}.{counter:figure}]
.Lifecycle of a transaction. 
image::transaction_flow.png[]

The problem I am running into is that the figure captions in chapter 2 do not start with Figure 2.1 even though I reset the figure counter to 0 in the header of chapter 2. Instead they start with Figure 2.X where X = count of figures in chapter 1 + 1. How can I fix this?
Reply | Threaded
Open this post in threaded view
|

Re: Incorrect figure numbering when my document is split across multiple files

mojavelinux
Administrator
I think what you are asking about is this issue: https://github.com/asciidoctor/asciidoctor/issues/2291

The reftext is only used in an xref. The number used in the caption is provided by built-in behavior.

Best,

-Dan

On Wed, Oct 16, 2019 at 5:04 PM siddjain [via Asciidoctor :: Discussion] <[hidden email]> wrote:
I have a document that is split into multiple files. My top level adoc looks like this:

:doctype: book
:leveloffset: 1

include::chap01.adoc[]

include::chap02.adoc[]

My chap02.adoc header has

:chapter: 2
:figure: 0

and I insert images into the chapter like

[id=transaction_flow, reftext={chapter}.{counter:figure}]
.Lifecycle of a transaction. 
image::transaction_flow.png[]

The problem I am running into is that the figure captions in chapter 2 do not start with Figure 2.1 even though I reset the figure counter to 0 in the header of chapter 2. Instead they start with Figure 2.X where X = count of figures in chapter 1 + 1. How can I fix this?



If you reply to this email, your message will be added to the discussion below:
https://discuss.asciidoctor.org/Incorrect-figure-numbering-when-my-document-is-split-across-multiple-files-tp7235.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