lierdakil / pandoc-crossref

Pandoc filter for cross-references
https://lierdakil.github.io/pandoc-crossref/
GNU General Public License v2.0
911 stars 72 forks source link

Arrange two images vertically for figure #391

Closed julianbarg closed 1 year ago

julianbarg commented 1 year ago

As stated above. I seem to be unable to do this. My preferred solution would be the same as the long-form syntax for creating a table with a fenced div, i.e.:

:::{#fig:label} ![](figure1.png)

![](figure2.jpg) : Caption :::

pandoc-crossref v0.3.16.0 git commit UNKNOWN (UNKNOWN) built with Pandoc v3.1.2, pandoc-types v1.23 and GHC 8.8.4

pandoc 3.1.2 Features: -server +lua Scripting engine: Lua 5.4

lierdakil commented 1 year ago

The : before the caption messes with Pandoc, it parsers it as a definition list. By convention, the last paragraph in a subfigures div is treated as caption by pandoc-crossref without any extra markers.

What is your target output format?

This seems to work for html:

---
subfigGrid: true
---

:::{#fig:label}
![](figure1.png)

![](figure2.jpg)

Caption
:::

For LaTeX, don't set subfigGrid.

julianbarg commented 1 year ago

That works! Brilliant! It seems to change how some other illustrations get processed, but overall great result. Might be worth adding that example to the docs.