emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] how to handle svg files when exporting orgmode to html and pdf?


From: Aaron Ecay
Subject: Re: [O] how to handle svg files when exporting orgmode to html and pdf?
Date: Sat, 27 Jul 2013 02:36:09 -0400
User-agent: Notmuch/0.15.2+171~ge2f30a2 (http://notmuchmail.org) Emacs/24.3.50.1 (x86_64-unknown-linux-gnu)

Hi Malcom,

2013ko uztailak 17an, malcolm cook-ek idatzi zuen:
> 
> Hi, 
> 
> I am creating .svg files with R source blocks and ESS in org. 
> 
> I am happily viewing them in-line in my emacs buffer. 
> 
> I am happily exporting as html and viewing them in-line in the resulting web 
> page, including a table of images. 
> 
> I do not have an approach for including them into PDF when I export-tex-pdf. 
> 
> I'm thinking there might be an approach to converting them on-the-fly to png 
> (or something) during the export->tex->pdf. 
> 
> A similar problem was addressed with custom macros here: 
> http://thread.gmane.org/gmane.emacs.orgmode/56532/focus=58322 
> 
> But it does not work with  R source blocks that produce .svg files. 
> 
> Any suggestions for me?  Is this a lost cause?  Am I asking for too many 
> assumptions to be made by such an auto-conversion process that it is doomed 
> to fail anyway?

I have been using a variant of this workflow with some success.  Using a
patch I just pushed to the master branch, you should be able to
successfully export SVG image files to LaTeX documents, using the “svg”
LaTeX package: http://www.ctan.org/pkg/svg

No configuration should be needed on the org side.

The svg LaTeX package is a bit fussy.  It only works under pdfTeX (it
can be patched to work with LuaTeX, but cannot work with XeTeX at all).
It also requires you to have the inkscape command line program
installed.  But within those constraints it works very nicely.

You may need to arrange for whatever compilation process you use for
LaTeX files to pass the “-shell-escape” command line option to pdftex.
This allows TeX code to execute command line programs, which is needed
to communicate with inkscape and convert the SVG into something LaTeX
can use.

I think in the long run it would be nice if Org could help you translate
the image types in your document into image types an exporter
understands (basically an expanded and generalized version of what is
already done with LaTeX snippets for non-LaTeX export).  But that is
a bigger project, I think.

-- 
Aaron Ecay



reply via email to

[Prev in Thread] Current Thread [Next in Thread]