Debian Codegraph @

doc/usage/extensions/imgconverter.rst

raw
1 .. _sphinx.ext.imgconverter:
2
3 :mod:`sphinx.ext.imgconverter` -- A reference image converter using Imagemagick
4 ===============================================================================
5
6 .. module:: sphinx.ext.imgconverter
7 :synopsis: Convert images to appropriate format for builders
8
9 .. versionadded:: 1.6
10
11 .. role:: code-py(code)
12 :language: Python
13
14 This extension converts images in your document to appropriate format for
15 builders. For example, it allows you to use SVG images with LaTeX builder.
16 As a result, you don't mind what image format the builder supports.
17
18 By default the extension uses ImageMagick_ to perform conversions,
19 and will not work if ImageMagick is not installed.
20
21 .. _ImageMagick: https://www.imagemagick.org
22
23 .. note::
24
25 ImageMagick rasterizes a SVG image on conversion. As a result, the image
26 becomes not scalable. To avoid that, please use other image converters like
27 `sphinxcontrib-svg2pdfconverter`__ (which uses Inkscape or
28 ``rsvg-convert``).
29
30 .. __: https://github.com/missinglinkelectronics/sphinxcontrib-svg2pdfconverter
31
32
33 Configuration
34 -------------
35
36 .. confval:: image_converter
37 :type: :code-py:`str`
38 :default: :code-py:`'convert'` on Unix; :code-py:`'magick'` on Windows
39
40 A path to a conversion command. By default, the imgconverter finds
41 the command from search paths.
42
43 .. versionchanged:: 3.1
44
45 Use :command:`magick` command by default on windows
46
47 .. confval:: image_converter_args
48 :type: :code-py:`Sequence[str]`
49 :default: :code-py:`['convert']` on Windows; :code-py:`()` on Unix
50
51 Additional command-line arguments to give to :command:`convert`, as a list.
52
53 .. versionchanged:: 3.1
54
55 Use ``['convert']`` by default on Windows