I have a small problem with the fig element. Here is how I use it:
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:
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:
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?
Hope you are doing good.
In order to help you with your query, Some additional information is required to fully understand the problem:
Request you to share the above information.
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.
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:
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:
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.
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,
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?
Thanks for the confirmation.
I think you can do it using KeepWithPrevious element in EDD of DITA Base.
Something like this:
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:
Hope this helps,
Thanks again, all good 🙂
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?
I guess I solved my own mystery. The solution I found is to put the all context rules after the conditional rules. See: