سؤال

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?

هل كانت مفيدة؟

المحلول

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).

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top