Scale svg figure in sphinx html output (rest)

I have a figure in the restructured text using the scale directive as follows:

.. figure:: images/my_image.svg :scale: 150 % 

In the HTML output of the sphinx, the image is completely fine, except that it does not scale. (The svg image has width and height and viewBox information)

It is strange that unlike the png digits, the <img> in the HTML file does not contain attributes for the width and height of the image (hm, for some reason cannot determine the width and height of sphinx?).

What is the reason for this? Does sphinx support the directive :scale: for svg digits?

+5
source share
1 answer

You can try setting the width. It can also be assigned a percentage of the current line width as a value.

 .. figure:: images/my_image.svg :width: 100% 
+6
source

Source: https://habr.com/ru/post/1214284/


All Articles