The following construct allows to scale an image in a Markdown document, while still using the original Markdown image command. No further css is needed. It turns out that a critical element is the empty line between the div
statement and the image command (that’s why I missed this a long time ago). Use margin: auto;
to center the image horizontally, without that it will be left aligned. This is to my knowledge the easiest, least intrusive way of achieving this with minimal HTML cluttering up the markdown.
<div style="width:20%; margin: auto;">

</div>
If you associate a css sheet with Markdown in DT, you can further fine tune the global appearance of figures by customizing the figure
environment, e.g to have the caption in somewhat smaller font and e.g. italics, set the background color, add a frame.
This hack depends sensitively on the ability to use md commands inside a HTML environment, so it’s potentially fragile. It could stop working with a future update of the md engine.
Important: No one is forced to use this. I have a good case for myself, and I figured (pun intended) that it would be worth sharing with those that also see some value in scaling and centering images in md.
Note: This writeup replaces the original method, that was much more cumbersome. Some of the discussion below refer to that old version.