4

As an extension to this question: how can you add a description under each of the gridded images using Sphinx and reStructuredText?

For example, a table, three images across with a caption centered under each image.

Community
  • 1
  • 1
Jzl5325
  • 3,898
  • 8
  • 42
  • 62
  • Potential duplicate: [How can I place images side-by-side in restructured text?](https://stackoverflow.com/questions/22149669/how-can-i-place-images-side-by-side-in-restructured-text). One answer there suggests `list-table` which I think is much easier to maintain. – luator Sep 30 '21 at 10:11

1 Answers1

4

I am not sure if this is possible with just the figure directive, like it is with the image directive. However, whilst horrible to look at, you could wrap the three figures in a table. For example, the following reStructuredText

+-----------------------------------------+-----------------------------------------+-----------------------------------------+
| .. figure:: http://placehold.it/150x150 | .. figure:: http://placehold.it/150x150 | .. figure:: http://placehold.it/150x150 |
|   :alt: map to buried treasure          |   :alt: map to buried treasure          |   :alt: map to buried treasure          |
|                                         |                                         |                                         |
|   This is the caption of the figure (a  |   This is the caption of the figure (a  |   This is the caption of the figure (a  |
|   simple paragraph).                    |   simple paragraph).                    |   simple paragraph).                    |
+-----------------------------------------+-----------------------------------------+-----------------------------------------+

produces

Table of three figures in a row produced by the above reStructuredText

Community
  • 1
  • 1
Chris
  • 44,602
  • 16
  • 137
  • 156
  • Thanks for the answer. I was hoping to avoid having to wrap it in a table, but if I have too I will. I'll probably wait a day or so to see if another answer pops up. If not I'll accept this one as it is totally valid (but ugly in the source) – Jzl5325 Aug 28 '12 at 15:47