I have two files named a.rst
and b.rst
, both of which contain a good deal of text. In a.rst
, I define a figure:
.. figure:: ../images/some-image.png
:scale: 70%
:align: center
:alt: Some Text
Some Caption
I would like to have the same image and caption in b.rst
with the same figure number, But repeating the above code gives me a new figure.
As a compromise, I can refer to this image in b.rst
using the :numref:
directive, but that does not resolve to the figure. It only displays the name as a piece of code.
I understand that these are two question, but I think they are sufficiently related. How can I repeat or reference a figure defined in a rst file in another file.
Edit to elaborate on the expected output: I want the resulting files to have the following content:
a.html
:
Fig. 1 + caption
Fig. 2 + caption
Fig. 3 + caption
b.html
:
Fig. 4 + caption
Fig. 2 + caption
Fig. 5 + caption
Effectively, this would add the figure to b.rst
not as a separate entity, but merely as a mirror of what was in a.rst
. This is similar to what was discussed here.