Home > Net >  side-by-side images in the restructuredtext by sphinx-python
side-by-side images in the restructuredtext by sphinx-python

Time:12-17

I would like to have the images side by side in pdf and html. I use the sphinx to generate the restructuredtext.

It would be good to look as follows: enter image description here

I have considered using csv-table, but it does not work well for the outlines around the images are awkward. .. csv-table:: :header: :widths: 60, 60

".. figure:: ../_static/1.png :width: 75mm :height: 75mm :align: left", ".. figure:: ../_static/2.png :width: 75mm :height: 75mm :align: right enter image description here

CodePudding user response:

I suggest you fall back to the raw HTML output as this is very difficult, if not impossible to do in Restructed Text only.

.. raw:: HTML

   <div style="display: flex">
      <img src="_static/1.png">
      <img src="_static/2.png">
   </div>

You are going to need basic HTML skills to style it though.

CodePudding user response:

You can try using an extension that supports grids, like the following:

  • Related