Align image both horizontally and vertically
-
19-06-2021 - |
Question
Using docutils
, it doesn't seem possible to align an image both horizontally and vertically in reStructuredText. Vertical alignment is only accepted for substitutions, while horizontal alignment only works for inline images, thus:
.. image:: some/image.png
:align: middle
and
.. |name| image:: some/image.png
:align: center
crash.
Is there a way to control both the vertical and horizontal alignments?
Solution
I got an answer:
Since :align
is based on the HTML definition of alignment, it doesn't make sense (in general) to align images vertically in the page (in my case, I'm doing a presentation, so vertically aligning in slides makes sense).
For that reason, standalone images can only be horizontally aligned, while inline images can only be vertically aligned (on the base line).
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow