1.3. Images / Figures

1.3.1. Images

Images are in-lined in the code. But, they don’t have cross-reference.

This is how we write in reStructuredText

.. image:: /img/red-circle.*

.. image:: /img/blue-circle.*

The reStructuredText text shown above is represented as shown below...

../../_images/red-circle.png ../../_images/blue-circle.png

1.3.2. Figures

Figures are placed where space is are available to place this figure. i.e. it is possible that in PDF, the figure are shown on next page. Not in continuation with the text. But, figures get a cross-reference.

This is how we write in reStructuredText

See :ref:`figure-red-circle`


.. _figure-red-circle:

.. figure:: /img/red-circle.*

    A red circle

.. _figure-blue-circle:

.. figure:: /img/blue-circle.*

    A blue circle


See :ref:`figure-blue-circle`

The reStructuredText text shown above is represented as shown below...

Note

Since, this is not the PDF, figures would be shown directly below. In case of PDF, the figures would be in next available free space.

See A red circle

../../_images/red-circle.png

A red circle

../../_images/blue-circle.png

A blue circle

See A blue circle


See more at

  • Image in reStructuredText Directives.
  • Figure in reStructuredText Directives.