Issue #557 resolved

floating images are broken with docutils 0.7

Kirill Simonov
created an issue

To reproduce: {{{ .. image:: floating-image.png :align: right

A few paragraphs of regular text. }}}

Docutils 0.7 changes the way it generates floating images: instead of using align="right", it sets the style of the image element to align-right and provides a custom CSS rule: {{{ img.align-right, .figure.align-right, object.align-right { clear: right ; float: right ; margin-left: 1em }

[...more...] }}}

Sphinx needs to replicate the new rules in its stylesheets.

Comments (7)

  1. Anonymous

    Hi, I just ran into this problem, the patch seemed to help with the alignment but image scaling seems to be broken as well. (sphinx 1.0.4, docbook 0.7)

    .. image:: images/screenshots/1024x768/menu.png :scale: 50 % :alt: screenshot :align: right


    thanks, Hamish

  2. Philippe Pinard

    The class .align-right, .align-left, .align-center in basic.css of the basic theme should be:

    .align-center {
        display: block; 
    .align-right {
        float: right;
    .align-left {
        float: left;
  3. Log in to comment