figure directive cannot have options (align , scale, alt)

Guy Dalberto avatarGuy Dalberto created an issue

versions

Python 2.6, Sphinx 0.6.3, docutils 0.6.0. Same problem with Sphinx 0.6.2, docutils 0.5.0

description

It is impossible to use options (:align:, :scale:, :alt:) with the figure directive.

The figure directive works without options and with caption and legend.

The image directive works with options (but without caption and legend of course)

symptoms

Warnings image file not readable while running sphinx

The name of the file is the concatenation of figure URL and options with all whitespace removed.

  • WARNING: image file not readable: _static/sphinx.png:alt:Sphinxfulllogo
  • WARNING: image file not readable: _static/sphinx.png:align:center
  • WARNING: image file not readable: _static/sphinx.png:scale:50:alt:Sphinxfulllogo

sample reSt source

.. figure:: /_static/sphinx.png
    :alt: Sphinx full logo

    The Sphinx full logo (from static).

.. figure:: /_static/sphinx.png
    :align: center

   The Sphinx full logo (from static).

.. figure:: /_static/sphinx.png
    :scale: 50
    :alt: Sphinx full logo

Comments (2)

  1. Log in to comment
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.