On Tue, Jan 25, 2011 at 05:17, Johan Ekh <ekh.jo...@gmail.com> wrote:

> Hi,
> I wonder if it is possible to use pstricks to generate pictures in Sphinx?
> I have lots of pstricks code and would like to use it if possible both when
> generating
> html and pdf with Sphinx.
>

Hi Johan,

You can use pstricks code inside a ``raw`` directive.

.. raw:: latex

    % Your pstricks code goes here

But that won't appear in the HTML version.  I faced a similar issue with
some LaTeX documents that used the (old) psfrag package command.  I just
converted my figures, one at a time to PNG and now include those figures
using the usual image/figure directive in the RST.  This is a tedious
solution, good for once-off conversion.

You might want to look at the matplotlib documentation, which dynamically
generates figures from Python code to PDF and PNG formats.
http://matplotlib.sourceforge.net/sampledoc/extensions.html

Maybe you could adjust the code to generate your pstricks figures in the
same way at compile time?

Kevin


Best regards,
> Johan
>
> --
> You received this message because you are subscribed to the Google Groups
> "sphinx-dev" group.
> To post to this group, send email to sphinx-dev@googlegroups.com.
> To unsubscribe from this group, send email to
> sphinx-dev+unsubscr...@googlegroups.com<sphinx-dev%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/sphinx-dev?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"sphinx-dev" group.
To post to this group, send email to sphinx-dev@googlegroups.com.
To unsubscribe from this group, send email to 
sphinx-dev+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sphinx-dev?hl=en.

Reply via email to