I’m using Pandoc 3.1.9 to convert a large document to PDF from markdown. The document includes a significant number of figures, and I would like some of them not to have the Figure X: text
before it. My main problem is that figures stick to the left when they don’t have a figure.
I have tried adding a class to the image:
{ .center width=200px }
Then using a Lua filter to check for specific classes as in:
if FORMAT:match 'latex' then
function Image (elem)
if elem.className == "center" then
return {
pandoc.RawInline('latex', '\hfill\break{\centering'),
elem,
pandoc.RawInline('latex', '\par}')
}
end
end
end
And then applying the filter on the Pandoc call:
pandoc --lua-filter=center.lua <myfile>.md -o <myfile>.pdf
But this won’t work. Other threads have suggested removing the markdown-implicit_figures
, but it does it for every image in the document, and I don’t want that. Anyone can help?
nacaru is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.