How to place images side by side in a restructured text?

Is there a way to place 2 different images on the same β€œline”, so side by side?

I know that there is an option :align:, but if I put two images, the first c :align: left, and the second c :align: right, it does not work, because the latter is placed in another paragraph.

+11
source share
4 answers

Try the following:

.. class:: center

This text is centered
0
source

I used substitution definitions :

|pic1| any text |pic2|

.. |pic1| image:: img1.png
   :width: 45%

.. |pic2| image:: img2.png
   :width: 45%
+17
source

, , , , :

.. image:: im1.jpg
    :width: 50 %
.. image:: im2.jpg
    :width: 50 %

This does not work, there will be some distance between the two images, which will be equal to the total width> 100%. A simple workaround sets the width to 49%. To do this, below is the result with the unformatted image above to compare: RenderedImages

Additional information: reST docs on images

+4
source
.. list-table:: 

    * - .. figure:: ../_static/1repren.png

           Fig 1. Representations

      - .. figure:: ../_static/5transparency.png

           Fig 2. Transparency
    * - .. figure:: ../_static/9ele.png

           Fig 3. Electrostatics

      - .. figure:: ../_static/11R3D.PNG.png

           Fig 4. R3D
0
source

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


All Articles