Hi,

First I should say that I'm really impressed with Sphinx, and thank you for 
providing and supporting it: Wonderful!

OK, I'd like to see better capabilities for figures in documents, including
  * auto-numbering and referencing.
  * multiple parts to a figure (e.g, side-by-side, or in a grid).
  * good results in both html and latex/pdf.

So far, I haven't quite found a solution with all these features, and was 
hoping either for some pointers on how to do this better, or pointers on 
how to make it so that sphinx can make this easier.

I've looked and tried the numfig extension.  This works fine for individual 
figures::

    .. _examplefig:

    .. figure::  examplefig.png
       :width: 50 %
       :align: center
       :figwidth: 80 %

       Caption for figure

    As seen in :num:`Figure #examplefig` ....

I think numfig is not without issues, but that is not my complaint here.  

To have two figures side by side, one can do this with bare images::

    .. _fig2:

        .. image::  fig2a.png
           :width: 49 %
        .. image::  fig2b.png
           :width: 49 %

        Figure 2.  Caption for figure ...

But this doesn't support auto-numbering or references.

One could put figures in a table::

    +------------------------+------------------------+
    |.. _figa:               |.. _figb:               |
    |                        |                        |
    |.. figure:: left.png    |.. figure:: right.png   |
    |   :width: 95 %         |   :width: 95 %         |
    |   :align: center       |   :align: center       |
    |                        |                        |
    |   Caption A here       |   Caption B here       |
    +------------------------+------------------------+

    See :num:`Figure #figa` for details.

But this has two problems: a) it leaves each figure as a separate entity, 
with it's own label and caption, and b) it doesn't render correctly in 
latex / pdf, as it puts each figure environment as a portion of a table 
(tabulary) environment, which causes errors because the figure environment 
is not in "Outer par mode". In my view, this approach is not perfect, as 
one may want to think of this as a single figure with a single caption for 
different sub-figures.

I tried many combinations of figure and image directives, but could not 
find a workable solution.  As it is, I'm left with document tree with 
dozens of figures that have to be numbered by hand.    

Is there a way to accomplish all of these features (auto-numbering and 
referencing of figures, multiple parts to figures, rendering in both html 
and latex/pdf)?

If not, is there any chance of adding better support for figures, say with 
a grid of sub-figures?

Thanks,

--Matt Newville

-- 
You received this message because you are subscribed to the Google Groups 
"sphinx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sphinx-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to