reST image grid with captions?

放肆的年华 提交于 2019-12-24 00:45:47

问题


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.


回答1:


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



来源:https://stackoverflow.com/questions/12148428/rest-image-grid-with-captions

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!