|
From: Guenter M. <mi...@us...> - 2011-11-23 07:53:42
|
On 2011-11-22, Bob Plantz wrote:
> I wish to create both epub and pdf (for printing) versions of my book
> from the same rst source. I create html for the epub and latex for the
> pdf. The formats of the figures (vector graphics) need to be different
> for each: svg for html; eps for latex.
> I have created the source:
> .. figure:: book_figs/decoderRing
> :align: center
> :class: latex
> .. figure:: book_figs/decoderRing.svg
> :align: center
> :class: epub
> When I use rst2html.py --strip-elements-with-class=latex to get html I get:
...
><div class="figure align-center">
></div>
...
> In both cases I have to remove the "null" figures for each file.
> This is acceptable; I will have to do other tweaking anyway. But if
> there's a better way to achieve this "if-else" construct, I would like
> to learn it.
You choose a difficult element to start with. The "figure" directive passes
most arguments to the included image object. Use
figclass : text
Set a "classes" attribute value on the figure element.
See the "directives" doc at
docutils/docs/ref/rst/directives.html#figure
Günter
|