Cross references

Internal document references

Use .. _label name: plus a blank line before any text location.

Then you can reference to those labels in the reST way (only works for labels within the document):

`label name`_

Example: citation

Or in the Sphinx way:

:ref:`displayed text <label>`

Which can be used between documents.

Example: paragraph

Alternatively, you can also use the :name: option in most blocks:

.. list-table::
   :header-rows: 0
   :name: list example

   ...

Example: list

Section titles, footnotes, and citations automatically are link targets.

Note

According to the Sphinx documentation you can also user the :ref: role directly with the label name (e.g. :ref:`label name`) if the label name is placed just before a section label.

Footnotes

You can create a footnote by:

Put the reference in the text [1]_.

.. [1] Footnote

Footnotes can have automatic labels with [#] 1.

1

In addition you can also use [#someText] that will be displayed as any other label.

Together with automatic labels there are also automatic symbols using [*].

Citations

With a similar syntax to footnotes, there are [citations]

.. [REL09] Citation

Is referenced as [REL09]_ REL09_ or rel09_.
citations

citation example

Other documents

Other documetns can be referenced with the :doc: directive.

:doc:`reference to a doc <includeDirective>`

reference to a doc

File includes

This text comes from a file that be included as from the current one with the include directive.

You can select only part of the file with the start-line and end-line options.

Check all the different options that you can use.

Example:

.. include:: includeDirective.rst

The literalinclude directive allows you to include the file into a container. This example:

.. literalinclude:: includeDirective.rst
   :language: text
   :linenos:

is shown as:

1This text comes from a file
2that be included as
3from the current one
4with the
5``include`` directive.
6
7You can select only part of the file with the *start-line* and *end-line* options.
8
9Check all the different `options <http://docutils.sourceforge.net/docs/ref/rst/directives.html#include>`_ that you can use.

Python objects

See: cross-referencing Python. More information about it can be found in this document.