For nearly three weeks now EmacsForMacOSX natively supports viewing SVG figures inline (hurray!).
As expected, and unlike raster images, SVG figures typically have no background.
It is sufficient to set
(setq org-startup-with-inline-images t)
and then the line
[[./figure.svg]]
in an org-mode
file will appear inline.
That's exactly how the SVG figures, whether output to HTML or PDF, will need to be—since the background will be white. But while writing (and being rather partial to a dark Emacs background) I'd like to see the figure on a white background.
How do I force SVG figures to appear inline on a white background?
Also, since C-ha svg
brings up nothing yet, a second(ary) question is worth asking here: how can I set the width of SVG figures in the Emacs frame? (Their width is already consistent and determined by the width of the printed page.)
The SVG image above
For reference, here is the SVG image used above.
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
width="200" height="150"
viewBox="0 0 200 150"
version="1.1">
<g>
<path d="M 10 10 L 190 10 L 190 140 L 10 140 z"
fill="none" stroke="blue" stroke-width="5" />
<circle cx="100" cy="75" r="50"
fill="none" stroke="blue" stroke-width="5" />
</g>
</svg>
Such an image meant for a light (white) background will in general be unusable on a dark (black) background, hence the question.
Related
This solution, which doesn't work for me, attempts to solve the problem through org-mode
—but in any case the issue is now one of SVG.