How can I place images side-by-side in restructured text?

matteo picture matteo · Mar 3, 2014 · Viewed 7.1k times · Source

Is there a way to put 2 different images on the same "line", so, side-by side?

I know there is the :align: option, but if I put two images, the first with :align: left and the second with :align: right it doesn't work, because the latter is put in another paragraph.

Answer

fiona picture fiona · Mar 1, 2017

I used substitution definitions:

|pic1| any text |pic2|

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

.. |pic2| image:: img2.png
   :width: 45%