Pandoc can easily render the same source file to html or LaTeX and then pdf. In many cases, I'd like to use different versions of the same image file depending on which backend is being used: When the original "image" is a vector figure, possibly containing text (e.g. PostScript, PDF, maybe SVG), I'd like to use that version to generate LaTeX and PDF, so there's not loss of quality. But browsers don't generally render those well, so I'd like to generate and use a raster (e.g. PNG) image when generating HTML.
Is there any way to do this in Pandoc? What I was hoping would "just work" was something like the \includegraphics{}
LaTeX macro where, if you provide the filename with no extension, it identifies all the image files matching that stem and applies some heuristic to pick the best option.
pandoc-svg
filter) – Purslane