From mboxrd@z Thu Jan 1 00:00:00 1970 From: Malcolm Cook Subject: Re: how to handle svg files when exporting orgmode to html and pdf? Date: Thu, 8 Aug 2013 12:46:28 -0500 Message-ID: References: <87ppu4mrvq.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:32875) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V7UIh-000088-VO for emacs-orgmode@gnu.org; Thu, 08 Aug 2013 13:47:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V7UIe-0002nu-PS for emacs-orgmode@gnu.org; Thu, 08 Aug 2013 13:47:03 -0400 Received: from mail-ie0-x22c.google.com ([2607:f8b0:4001:c03::22c]:44585) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V7UIe-0002ne-KX for emacs-orgmode@gnu.org; Thu, 08 Aug 2013 13:47:00 -0400 Received: by mail-ie0-f172.google.com with SMTP id 17so2421512iea.17 for ; Thu, 08 Aug 2013 10:46:59 -0700 (PDT) In-Reply-To: <87ppu4mrvq.fsf@gmail.com> 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 , emacs-orgmode@gnu.org, Nick Dokos , Aaron Ecay 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: \usepackage{svg} ... \includegraphics[width=3D.9\linewidth]{mtcars.png} @@backend:\includesvg{mtcars} 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 to proceed, or enter new name. (Default extension: pdf_tex) Enter file name: ! Emergency stop. l.354 \includesvg{mtcars} If you have any suggestions to me for further sleuthing I would be much obl= iged. Thanks, Malcolm Cook On Sat, Jul 27, 2013 at 1:36 AM, Aaron Ecay 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 resultin= g 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 t= o 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=3D58322 > > > > 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 man= y > > assumptions to be made by such an auto-conversion process that it is do= omed > > 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 =93svg= =94 > 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 =93-shell-escape=94 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