[Tex/LaTex] Full-width figures with Pandoc

markdownpandoctwo-columnwide-image

I want to produce a figure which spans both columns in a two column layout document, exactly as discussed here: Displaying a wide figure in a two-column document

I'm writing in Markdown and using Pandoc to convert to Latex, and then to PDF (I like to have the .tex intermediate step so that I can see exactly how my work is typeset). I haven't been able to find a way of telling Pandoc to produce a full width image either by using the starred figure environment (as discussed in the afore-linked thread) or by some other mechanism.

I can achieve my desired result by manually tweaking the Latex output by Pandoc to use figure*, but that's a bit of a pain as I have to repeat this (by hand) every time I compile a new version of my document from (the Markdown) source.

I could also achieve this by including the raw Latex code in my Markdown file, but I was hoping for a cleaner solution. However, this is what I will fall back to if nothing better is possible.

For completeness, here is the syntax I'm using to include the figure in my Markdown document.

![Figure caption](assets/my-figure.png){width=100%}

Best Answer

To date there is no pure pandoc solution to what you want. However, that may be easily achieved with custom filter. Chime in to pandoc-discuss and ask for help in building a filter for that.