Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fenced div/span syntax for subfigures #395

Open
fcskit opened this issue Aug 3, 2023 · 1 comment
Open

fenced div/span syntax for subfigures #395

fcskit opened this issue Aug 3, 2023 · 1 comment

Comments

@fcskit
Copy link

fcskit commented Aug 3, 2023

Could you support the fenced div/span syntax used for tables also for subfigures in addition to a

block?

:::{#fig:subfigure label="Figure"}
![subfigure caption 1](link_to_image1.png){#fig:subfigure_2}
![subfigure caption 2](link_to_image1.png){#fig:subfigure_1}
: Caption
:::

The background of my question is that I'm using Obsidian as my primary markdown editor, which has a live preview editing mode. Embedded markdown figure links are directly rendered in the live preview editing mode. The syntax above would show the images in live preview (which would be my preferred option) while placing the subfigures in a div block will not, since the markdown code inside the div will by interpreted as normal text and not as markdown.

It would also be a bit more consistent, because the same syntax works for tables.

@lierdakil
Copy link
Owner

Hi. Fenced divs should work fine for subfigures, pandoc-crossref doesn't even know whether the div is fenced or not. You do need a paragraph break before caption, however. Also, : is superfluous, the last paragraph in subfigure div is interpreted as the caption verbatim. So this should work:

:::{#fig:subfigure}
![subfigure caption 1](link_to_image1.png){#fig:subfigure_2}
![subfigure caption 2](link_to_image1.png){#fig:subfigure_1}

Caption
:::

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants