# How to control image size when exporting to HTML via dvisvgm?

The org-mode source

#+OPTIONS: toc:nil creator:nil author:nil timestamp:nil num:t validate:nil
#+OPTIONS: tex:dvisvgm

\begin{tikzpicture}
\draw (0,0) circle (3cm);
\end{tikzpicture}


exports cleanly to HTML.

The tex option can be changed from dvisvgm to dvipng or imagemagick and it continues to work, but with a difference: When using dvipng or imagemagick the image size is constant; when using dvisvgm the image size is automatically adjusted to occupy the maximum space available. This means that the image size changes as the browser window is resized.

Is there a way to keep the image size constant when exporting images created by LaTeX snippets to HTML via SVG?

ox-html uses object tags of the org-svg class to embed the generated SVG files. The default stylesheet has the following rule:

.org-svg { width: 90%; }


This leads to embedded SVGs that take up 90% of the screen space. Such as below:

This can be solved by overriding this in your own stylesheet:

.org-svg { width: auto; }


The output is then not scaled proportionally to the width anymore:

• Interesting. Any way to get the baseline to match up? – Andrew Swann Sep 24 '17 at 10:11