Search code examples
pythonrestructuredtextrst2pdf

rst2pdf: Referencing automatically-numbered figures


I have directives in my rst document, which insert figures; and I use rst2pdf's :counter: directive to automatically number them.

.. figure:: Graphics\Manual_test_timeline.png
   :scale: 100%
   :align: center

   Figure :counter:`figure`. Manual Testing Timeline

The caption renders as Figure 1. Manual Testing Timeline.

How can I reference those automatically numbered figures elsewhere in the document? I need to be able to write

See ??? for more details on the timeline.

Where ??? is a reference to the text in caption of the figure (including the number).

Is there a way to do this with either standard restructured text or a special rst2pdf hack?


Solution

  • There is no way to do that automatically. There are, of course, ways to do that manually.