[Top][All Lists]

[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: Malcolm Cook
Subject: Re: [O] how to handle svg files when exporting orgmode to html and pdf?
Date: Thu, 8 Aug 2013 12:46:28 -0500

Aaron & Nick,

Thanks for the help.  I think I'm almost there.

So far I did

 * install a latex package (first time for everything).  I wound up
just putting svg.sty file it for now in the same directory as the .org
file since my attempts to date failed using $HOME/texfm
 * customize the emacs variable `org-latex-pdf-process` to include
'--shell-escape' (following advice in
http://orgmode.org/worg/org-dependencies.html, which outlines some
other options)
 * upgrade to inkscape version 0.48.+ (which is more recent than our
centOS repos proffered, but, hey) since the --export-latex switch that
svg.sty depends upon is not implemented till this version

When I "export to latex as PDF file", I get error "PDF file ./test.pdf
wasn't produced"

Sleuthing, I see the output .tex file includes the following lines:


However, when they get processed, and the includesvg seeks the pdf_tex
file, I get this error:

! LaTeX Error: File `mtcars.pdf_tex' not found.
Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: pdf_tex)
Enter file name:
! Emergency stop.
<read *>
l.354 \includesvg{mtcars}

If you have any suggestions to me for further sleuthing I would be much obliged.


Malcolm Cook

On Sat, Jul 27, 2013 at 1:36 AM, Aaron Ecay <address@hidden> wrote:
> 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]