DITA fig element: title distorted if MoveFigureTitleToFollowImage=1

Contributor ,
Dec 28, 2020

Copy link to clipboard

Copied

Hi,

I have a small problem with the fig element. Here is how I use it:

fig_element.PNG

If I use the flag MoveFigureTitleToFollowImage=1 in the ditafm-ouput.ini as it is per default in FM, the title of the image becomes tiny and the title numbering vanishes:

fig2.PNG+

However if I set MoveFigureTitleToFollowImage to 0, the title size will be normal and the numbering is also there but the title appears on top of the image which is not nice:

fig1.PNG

A remedy to avoid the change of the title would be to separate the image element from the fig element and put the image on top of the fig element. In other words to decouple the two. The bad thing about it is that the two may separate, e.g. if the image is at the end of the page, the title can move to the next page. Any idea how to solve this issue?

TOPICS
Formatting and numbering, PDF output, Structured

Views

176

Likes

Translate

Translate

Report

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

1 Correct Answer

Adobe Employee , Jan 05, 2021
Kunal Puri Adobe Employee , Jan 05, 2021
Hi Hadi,   Wishing you a very Happy New Year to you as well.   Regarding your query, it can be fixed by importing the following DITA Base template in your STS File:https://documentcloud.adobe.com/link/track?uri=urn:aaid:scds:US:663c11aa-3377-4501-a48d-42f9371ab679Basically, this template is same as the original DITA Base Template plus it contains element definition of fm-figtitle in the EDD. Here is the screenshot of the element definition:   This change may result the Figure Title coming twice ...

Likes

Translate

Translate
Jump to answer Jump to answer
Adobe Employee ,
Jan 02, 2021

Copy link to clipboard

Copied

Hi Hadi,

 

Hope you are doing good.

 

In order to help you with your query, Some additional information is required to fully understand the problem:

 

  1. The FM Version that you are using.
  2. The route through which you are generating PDF (Composite Route / Book with FM Components Route / Flat Book route)
  3. If you are using FM2020, Is the behaviour observed with the default STS?

 

Request you to share the above information.

 

Thanks,

Kunal Puri

Likes

Translate

Translate

Report

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

Copy link to clipboard

Copied

Hi Kunal,

Thank you for getting back. 

1. I use FM 2020 16.01.831 (should be the current version). I also tried it with FM2019 same happens.

2. I use the Publish panel to generate PDF. To do this, in DITA options toggle on Save PDF via Book with components route and select all the subsequent options, including Generate flat Book hierarchy.

3. If you follow the steps above you can reproduce the same behavior using the default sts file, otherwise it is fine. But For me it is no option not to use the Book with components and flat book hierarchy.

I hope this helps and wish you a happy new year.

Hadi 

Likes

Translate

Translate

Report

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

Copy link to clipboard

Copied

Hi Hadi,

 

Wishing you a very Happy New Year to you as well.

 

Regarding your query, it can be fixed by importing the following DITA Base template in your STS File:
https://documentcloud.adobe.com/link/track?uri=urn:aaid:scds:US:663c11aa-3377-4501-a48d-42f9371ab679

Basically, this template is same as the original DITA Base Template plus it contains element definition of fm-figtitle in the EDD. Here is the screenshot of the element definition:

Capture.PNG

 

This change may result the Figure Title coming twice in the List of Figures section.

In order to fix it, you have to make some changes in ditafm-output.ini.

  1. Go to [BookWithFM-ListofFigures] section in ditafm-output.ini.
  2. Remove fm-figtitle from ElementTags field.

 

After the changes, your ditafm-output.ini should look like this:

...
[BookWithFM-ListofFigures]
Template=ListofFiguresTpl.fm
ElementTags=
ParaTags=figure.title|FigureTitle.LwDITA
...

 

These changes will surely be integrated in future FM updates.

 

Hope this helps,

Kunal Puri

Likes

Translate

Translate

Report

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

Copy link to clipboard

Copied

Hi Kunal,

Thank you very much, it works. Just a small problem remains: The image caption can still move to the next page if the figure is at the end of the page. Is there an attribute that I can use to force the caption to always stick to the image?

Hadi

Likes

Translate

Translate

Report

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

Copy link to clipboard

Copied

Hi Hadi,

Thanks for the confirmation.

I think you can do it using KeepWithPrevious element in EDD of DITA Base.

 

Something like this:

Capture.PNG

As you can observe, An all-contexts rule is added in fm-figtitle which specifies that title should remain along with the last paragraph.

You may directly import the Updated DITA Base Template (that contains the above mentioned changes) into your STS from here:
https://documentcloud.adobe.com/link/track?uri=urn:aaid:scds:US:5c1261fc-1ab2-41b5-9b52-6b084a275f92

Hope this helps,

Kunal Puri

Likes

Translate

Translate

Report

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

Copy link to clipboard

Copied

Thanks again, all good 🙂

Likes

Translate

Translate

Report

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

Copy link to clipboard

Copied

Hi Kunal, I was experimenting with the KeepWithPrevious rule in the edd of ditabase1.3.template.fm file in order to change the behavior of the fig element similarly to keep it on the same page with the previous element that comes on that page, but I was not successful. That is it did not keep the figure together with the previous element in the published pdf file. See a screenshot of the fig element from the edd. There you see under Text format rules, I have added the same block as you did with the figtitle. Any idea what I am doing wrong?

fig_element.PNG

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
hadih26673991 AUTHOR LATEST
Contributor ,
Feb 10, 2021

Copy link to clipboard

Copied

I guess I solved my own mystery. The solution I found is to put the all context rules after the conditional rules. See: 

fig_element_2.PNG

Likes

Translate

Translate

Report

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