Skip to main content
hadih26673991
Inspiring
October 13, 2020
Question

Figure numbering restarts in every chapter (DITA)

  • October 13, 2020
  • 3 replies
  • 1016 views

I am facing a problem which is becoming a boomerang:

What is the best way to get consistent figure numbering in DITA documents throughout the chapters?

It is worth mentionming that I publish my DITA bookmap via the publish panel not using File-> Save as...

The problem is: If I use the Format: f:Figure <n+>:\t for figure:title, FrameMaker restarts the Figure caption number to 1 in every chapter. Consequently you have multiple figures with the same number in your document (bad idea).

If I set the figure.title Format to: f:Figure <$chapnum>.<n+>: \sn, the numbering becomes consistent but the cross referencing to those figures is not.

For this case, I have tried the following cross reference formats:

1. Figure with Number:

In the first case the chapnum is set to one in every chapter, i.e. all referenced Figures start with 1.some number follows.

2. any combination with Page number:

In this case the page number restarts from 1 in every chapter. 

 

Conclusion is that none of the formats above would result in a correct referenced number. The only way to avoid wrong numbering would be to use the DITA Default Format, i.e. to avoid any number in the caption and to use just the text. The main issue with this format is that if you print the pdf on paper, it becomes difficult to go to the page where the figure is located, as you do not have any number rather than the text itself.

So my question is: how should I refer to figures in a DITA application in a reasonable way?

This topic has been closed for replies.

3 replies

LinSims
Community Expert
Community Expert
October 19, 2020

I can't help you directly with this since I worked in DITA for barely 3 months and had nothing to do with creating EDDs or DTDs, but have you looked at Leximation's DITA-FMx plugin? It's a tool that assists in using DITA in the FM front-end, and one of its functions is to "Generate a PDF-ready FrameMaker book from a DITA map or bookmap; automatically apply pagination, numbering, custom templates, etc."

hadih26673991
Inspiring
October 19, 2020

I haven't yet looked into Leximation as I thought I have to pay extra for a license. 

I also noticed that using FM2019, the references come out correctly. Maybe there is an issue with FM2020.

LinSims
Community Expert
Community Expert
October 19, 2020

Leximation isn't free, no. A single user license is $235 and includes a year of maintenance. My general opinion is that if something saves you time and pain, it's usually worth the cost.

 

Also, Scott Preston is very accessible and willing to help with issues.

Legend
October 19, 2020
  • have you tried <$paranumonly> instead of <$paranum>? I don't use it often, so I can't immediately visualise what results it might give in your case
  • since you ask, I use XML Mind: I was initially put off FM for DITA by the default formatting, which I didn't like and which (at least way back then) appeared impossible to adapt without major surgery, and took just as swift a dislike to Oxygen because of its (then) interface. XML Mind gives me the "there when you want it, not there when you don't" feeling of working with FM, and an unintrusive interface. Visually, it only took two small tweaks to get output – outdented headings, corporate colour for heading texts – that looks very close to the Bookmaster-derived styles I'd defined for FM.
hadih26673991
Inspiring
October 19, 2020

Thanks for letting me know. I would consider XML Mind in my next project. Yes I had tried <$paranumonly> as well. I guess the issue is rooted somewhere else. If i convert the ditamap to book with fm components, the references come out correctly in the book file, but not in the pdf! 

Legend
October 14, 2020

Based on standard FM, I've taken a quick look at one of my books, and note that:

  • numbering options at book level are set to increase chapter numbers but restart paragraph numbering to 1 for each chapter
  • the numbering definition I've tested for figure captions is F:Figure <$chapnum>-<n+>.\t
  • the cross-reference format is <$paranum> <$paratext>, on page <$pagenum>
  • the result is see Figure 4-3. Removing the battery, on page 22

Hope this gets you a bit closer to what you're aiming for!

[disclaimer: I don't let FM anywhere near my DITA files] 

hadih26673991
Inspiring
October 14, 2020

Hi, thank you for your reply. Your solution would work for standard or unstructured FM as you mentioned. I gave your solution a try on a DITA bookmap with xml content files. Unfortunately, I do not get the chapter numbers correctly. They stay 1. In other words <$paranum> generates something like: 1.# and # is the number of figure in that chapter.

Out of curiosity what software or package do you use to publish your DITA files?