1.11. Cross Referencing

To cross reference different parts of the book, first step is to identify canonical names/ids for the reference. e.g. section-figures and figure-red-circle. The canonical names/ids are only needed to uniquely identify the cross references. By default, the references show the actual text of the heading and figure.

For Heading the entries are defined like this:

.. _section-figures:

 Figures
=========

For Figures, the entries are defined like this (See line 1 and 7)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
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`

This is how we write in reStructuredText

See :ref:`figure-red-circle` and
:ref:`figure-blue-circle`
(They are shown as part of
:ref:`section-figures` of
:ref:`chapter-images-and-figures`)

We can also use our name for Sections. e.g.
:ref:`the section about Figures <section-figures>`,
and :ref:`this Section itself <cross-referencing>`.

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

See A red circle and A blue circle (They are shown as part of Figures of Images / Figures)

We can also use our name for Sections. e.g. the section about Figures, and this Section itself.


See more at