Highlighted

building block <$chapnum> not showing the correct chapter number in the list of figures

Contributor ,
Jun 25, 2020

Copy link to clipboard

Copied

I am trying to modify the ListofFiguresTpl.fm template that I use in my DITA project in order to change the numbering of the figures, appearing in the List of figures part.

The reason is that the default numbering, as it is, restarts the figure numbers in each chapter to 1 then adds up the numbers throughout the chapter. However, in the list of figures, appearing in the end of the book, the numbers are accumulating. Consequently for the same figure you get two different numbers in the chapter and in the LOF. So I decided to change the numbering by adding the chapter number first then the figure number within that chapter. I first modified the ChapterOutputTpl.fm using the paragraph designer: f:Figure <$chapnum>.<n+>:\t. This works fine. However when I do the same in the ListofFiguresTpl.fm, the chapter number is always 1.

Adobe Community Professional
Correct answer by frameexpert | Adobe Community Professional

Don't use autonumbering in the list of figures paragraphs. Use the <$paranum>, <$paranumonly>, <$elemnum>, or <$elemnumonly> building blocks to pick up the numbers from the source paragraphs themselves.

TOPICS
Formatting and numbering, Structured

Views

129

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

building block <$chapnum> not showing the correct chapter number in the list of figures

Contributor ,
Jun 25, 2020

Copy link to clipboard

Copied

I am trying to modify the ListofFiguresTpl.fm template that I use in my DITA project in order to change the numbering of the figures, appearing in the List of figures part.

The reason is that the default numbering, as it is, restarts the figure numbers in each chapter to 1 then adds up the numbers throughout the chapter. However, in the list of figures, appearing in the end of the book, the numbers are accumulating. Consequently for the same figure you get two different numbers in the chapter and in the LOF. So I decided to change the numbering by adding the chapter number first then the figure number within that chapter. I first modified the ChapterOutputTpl.fm using the paragraph designer: f:Figure <$chapnum>.<n+>:\t. This works fine. However when I do the same in the ListofFiguresTpl.fm, the chapter number is always 1.

Adobe Community Professional
Correct answer by frameexpert | Adobe Community Professional

Don't use autonumbering in the list of figures paragraphs. Use the <$paranum>, <$paranumonly>, <$elemnum>, or <$elemnumonly> building blocks to pick up the numbers from the source paragraphs themselves.

TOPICS
Formatting and numbering, Structured

Views

130

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Jun 25, 2020 0
Adobe Community Professional ,
Jun 25, 2020

Copy link to clipboard

Copied

Please post a screenshot of the LOF reference page in your list of figures.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jun 25, 2020 0
Contributor ,
Jun 25, 2020

Copy link to clipboard

Copied

Hi, here is the screenshot, including the paragraph designerLOF_Ref_Page.PNG

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jun 25, 2020 0
Adobe Community Professional ,
Jun 25, 2020

Copy link to clipboard

Copied

Don't use autonumbering in the list of figures paragraphs. Use the <$paranum>, <$paranumonly>, <$elemnum>, or <$elemnumonly> building blocks to pick up the numbers from the source paragraphs themselves.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jun 25, 2020 1
Contributor ,
Jun 25, 2020

Copy link to clipboard

Copied

Thanks Rick! <$paranum>, <$paranumonly> did the job 🙂 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jun 25, 2020 0
Contributor ,
Jun 30, 2020

Copy link to clipboard

Copied

I noticed that the cross referenced Figures are using the <$elemparanumonly> building block in order to number the figures within the text. This causes inconsistensy as the numbering of the referenced figures always starts from 1, ignoring the actual chapter number. If I would have been able to change the format to <$paranumonly>, the reference numbering should get corrected, I believe. Is there a way to replace the <$elemparanumonly> with <$paranumonly> under Format or get the <$elemparanumonly> block to reflect the current chapter number? See the attached screen shot for clarity.xref.PNG

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jun 30, 2020 0
Adobe Community Professional ,
Jun 30, 2020

Copy link to clipboard

Copied

As far as I know, the only way to edit Cross-Reference formats is through the Edit Format button of the unstructured Cross-Reference panel. In order to display this panel, go to one of the master pages, click in a text frame and choose Insert > Cross-Reference. Now you will see the Cross-Reference panel with the Edit Format button. You can click this button to change your Cross-Reference formats. There may be a more elegant way to display this, but I haven't figured it out yet.

 

Note that if you are working with .dita or .xml files, you will want to change the formats in your template.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jun 30, 2020 1
Contributor ,
Jun 30, 2020

Copy link to clipboard

Copied

Thank you, it makes sense what you suggested. So, I did as you said: changed the format in all my local templates. Unfortunately, it did not do the job as the chapter number in the cross-referenced figures (in this case) is stubornly 1 everywhere.

Then, in order to double check this, I changed the original FM templates in ...\Adobe FrameMaker 2020\Structure\xml\DITA\outputTemplates to see if the FM graphical user interface changes the <$elemparanumonly> to <$paranumonly> which it did not. The text appearing in my previous screenshot should have come from some template, or is it hard-coded?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jun 30, 2020 0
Adobe Community Professional ,
Jun 30, 2020

Copy link to clipboard

Copied

The chapter number is usually set at the book level by right-clicking on the book component and choosing Numbering. Or you can set it at the document level by choosing Format > Document > Numbering. If you want me to look at it via a web meeting, please contact me offlist. Thanks. rick at frameexpert dot com

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jun 30, 2020 0