Repository navigation
One caption per diagram, and picture and diagram widths - #132
Merged
Merged
Conversation
A [[CAPTION:]] line next to a diagram gave it two captions: pandoc made one from the picture's alt text, and the marker made another. In Word, a diagram with a caption line above or below it is no longer made a figure by pandoc. In HTML, PDF and PowerPoint a caption line below a diagram now captions it, as one above already did, instead of being left as a paragraph beside pandoc's caption. A diagram with no caption line keeps the alt text as its caption. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ket2UPXgz46XKSUqpuPixk
- Word: pandoc ignores a width in %, so widths.lua turns {width=50%}
into cm of the template's text width (page less margins), which the
engine reads from the reference document. HTML and PDF already
honoured %.
- Diagrams take width="100%" (or cm, mm, in, px) after the language,
passed on to the picture; anything else stops the build with the
file and line.
- Guide and example project: [[PAGEBREAK]], a diagram captioned below,
and full-width and 60% diagrams.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ket2UPXgz46XKSUqpuPixk
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
One caption per diagram
A
[[CAPTION:Figure]]line next to a diagram gave it two captions, because pandoc also made one from the picture's alt text:[[CAPTION:Table]]lines are not counted, so they still go to their table.markers.lua): a caption line below a diagram now captions the figure inside the diagram's centred div.Picture and diagram widths
[](a.png){width=50%}now works in Word too. pandoc's Word writer ignores%, so the newwidths.luaconverts it to cm of the template's text width (page width less margins), which the engine reads from the reference document. With no page set in the template it uses 14.82 cm, the widest pandoc makes a picture then. HTML and PDF already honoured%.width="100%"(orcm,mm,in,px) after the language. Any other value stops the build with the file and line.Docs and example
The writing guide and
examples/show[[PAGEBREAK]](03_operations.md), a diagram captioned below, and diagrams at 100% and 60% (02_design.md).Testing
mainafter Docker start-up wait, [[PAGEBREAK]], one caption per diagram, picture widths #130 and Support the [[PAGEBREAK]] directive #131.%widths for a diagram and a picture against a template with a 17 cm text width in Word and HTML; a bad width is an error.tests/test_examples.py, whose 7 failures also occur onmainin this environment because Graphviz, Mermaid and PlantUML are not installed here.py-doc lintis clean onexamples/docsanddocs/guide;ruff checkis clean.🤖 Generated with Claude Code
https://claude.ai/code/session_01Ket2UPXgz46XKSUqpuPixk
Generated by Claude Code