From mboxrd@z Thu Jan 1 00:00:00 1970 From: Aaron Ecay Subject: Re: how to handle svg files when exporting orgmode to html and pdf? Date: Sat, 27 Jul 2013 02:36:09 -0400 Message-ID: <87ppu4mrvq.fsf@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:58530) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V2y6v-000152-3q for emacs-orgmode@gnu.org; Sat, 27 Jul 2013 02:36:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V2y6t-00059x-SN for emacs-orgmode@gnu.org; Sat, 27 Jul 2013 02:36:13 -0400 Received: from mail-vc0-x22b.google.com ([2607:f8b0:400c:c03::22b]:39172) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V2y6t-00059r-O7 for emacs-orgmode@gnu.org; Sat, 27 Jul 2013 02:36:11 -0400 Received: by mail-vc0-f171.google.com with SMTP id ij15so1015992vcb.30 for ; Fri, 26 Jul 2013 23:36:11 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: malcolm cook Cc: emacs-orgmode@gnu.org Hi Malcom, 2013ko uztailak 17an, malcolm cook-ek idatzi zuen: >=20 > Hi,=20 >=20 > I am creating .svg files with R source blocks and ESS in org.=20 >=20 > I am happily viewing them in-line in my emacs buffer.=20 >=20 > I am happily exporting as html and viewing them in-line in the resulting = web=20 > page, including a table of images.=20 >=20 > I do not have an approach for including them into PDF when I export-tex-p= df.=20 >=20 > I'm thinking there might be an approach to converting them on-the-fly to = png=20 > (or something) during the export->tex->pdf.=20 >=20 > A similar problem was addressed with custom macros here:=20 > http://thread.gmane.org/gmane.emacs.orgmode/56532/focus=3D58322=20 >=20 > But it does not work with R source blocks that produce .svg files.=20 >=20 > Any suggestions for me? Is this a lost cause? Am I asking for too many= =20 > assumptions to be made by such an auto-conversion process that it is doom= ed=20 > 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 =E2=80=9C= svg=E2=80=9D 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 =E2=80=9C-shell-escape=E2=80=9D 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. --=20 Aaron Ecay