Figures
Opened this issue · 5 comments
Knowledge base reference: http://kb.daisy.org/publishing/docs/html/figures.html
User story: "As a content creator, there is no way to get InDesign to nest figcaptions correctly in a figure tag."
Hi @LauraB7 , @gregoriopellegrino , @ways2read we have few questions about the figure captions in fixed layout epub export. Say we have a case where figure is in page x as the bottom most element and caption is in page x+1 as the top most element or vice versa. In today's export scenario these goes to two different pages. Now if we embed a caption element inside the figure tag what is expected? In this scenario do we even need to embed the caption inside the figure tag? If we embed then it will change the layout of page x.
Could you please share your thoughts on this one?
@awkawk @gregoriopellegrino @ways2read @LauraB7 @jonaslil We have release InDesign 20.0.0.55 PR build. This includes Figures support as discussed above. Please do check and provide feedback if any
cc/ @raman211 @Racmathu
@awkawk @gregoriopellegrino @ways2read @LauraB7 @jonaslil please do share your feedback so that if anything needs to be done, we can try to accomodate it in MAX.
Current Situation
The solution proposed by Adobe, using live captions or static captions, does not seem feasible for our needs (as we discussed during our last call), as book layout designers rarely use these features. Additionally, we've found some limitations with the current implementation.
Identified Scenarios
We have identified two main scenarios for images with captions in books:
- Images anchored to text, where the caption is one or more paragraphs preceding or following the image.
- Images not anchored to text, where the caption is typically in a text frame near the image.
Proposed Solutions
For Non-Anchored Images
We propose using InDesign's grouping tool. During export, when the software encounters an image grouped with one or more text frames, it should check if any text frames have the export tag figcaption
. If found, the export should generate HTML in the following structure:
<figure>
<img />
<figcaption>
<p>Content of one or more paragraphs with figcaption tag</p>
<p>© 2024</p>
</figcaption>
</figure>
If in the group there is more than one text frame with export tag figcaption
, then the contents of the different frames should be exported to a single <figcaption>
tag.
For Anchored Images
We propose adding an option in the Object Export Options dialog for each image. This option would allow users to specify if the caption is located in the N preceding or N following paragraphs. During export, the software would generate the HTML markup as follows:
If the caption is following:
<figure>
<img />
<figcaption>
<p>Content of a paragraph following the image</p>
<p>Content of the second paragraph following the image</p>
</figcaption>
</figure>
If the caption is preceding:
<figure>
<figcaption>
<p>Content of second paragraph preceding the image</p>
<p>Content of the first paragraph preceding the image</p>
</figcaption>
<img />
</figure>
Additional observations to the current implementation
In the current implementation there are unnecessary figure
tags. Now in the export, every image, even without a figcaption
, is exported inside a figure
tag. For example:
<div class="_idGenObjectLayout-1">
<figure id="_idContainer001">
<img class="_idGenObjectAttribute-1" src="image/test.jpg" alt="test" />
</figure>
</div>
This seems unnecessary and may cause layout issues, especially for small images meant to be displayed inline with text. The figure
tag should only be used if there is a figcaption
.
We also found another issue with the current implementation: caption placement. InDesign always places the figcaption
at the end of the figure
tag, even when "Alignment: Above Image" is chosen in the Caption Setup.
Additional suggestions
Add figcaption
to the list of export tags for object styles.