From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Cook, Malcolm" Subject: Re: how to handle svg files when exporting orgmode to html and pdf? Date: Fri, 9 Aug 2013 21:01:08 +0000 Message-ID: References: <87ppu4mrvq.fsf@gmail.com> <874nb0f00a.fsf@gmail.com> <87txizew3h.fsf@gmail.com> <87r4e3euje.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:57690) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V7toL-0005Sc-EI for emacs-orgmode@gnu.org; Fri, 09 Aug 2013 17:01:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V7toH-0006hH-0c for emacs-orgmode@gnu.org; Fri, 09 Aug 2013 17:01:25 -0400 Received: from smtp01.stowers.org ([12.201.176.61]:47205) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V7toG-0006h8-P1 for emacs-orgmode@gnu.org; Fri, 09 Aug 2013 17:01:20 -0400 In-Reply-To: Content-Language: en-US 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' , 'Suvayu Ali' , 'Eric Schulte' , 'Vincent Beffara' , "'Thomas S. Dye'" , "'philten@cern.ch'" , 'Charles Berry' , 'Aaron Ecay' Thomas, Suvayu, Aaron, Nick, Eric, Carsten, Phil, et al, Thanks for all your help. I am now satisfied with approach for exporting images to inline html and in= line latex=3D>pdf. In my hands, the following code block will produce in-line images in html a= nd be included in exported pdf. #+LATEX_HEADER: \usepackage{svg} #+begin_src R :results graphics output :exports both :file mtcars.svg with(mtcars,plot(wt, mpg)) #+end_src=20 I am using: Emacs 24.3.1 Suvayus orgmode export filter: (defun my-svg-graphics (contents backend info) (when (eq backend 'latex) (replace-regexp-in-string "\\`\\\\includegraphics.+\\({.+\.svg}\\)" "\\\\includesvg\1" contents)) ) (add-to-list 'org-export-filter-link-functions 'my-svg-graphics) * svg latex package v1.0 2004/11/05 * 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) * customize org-export-html-inline-image-extensions to include "svg"=20 * 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 * upgrade org-mode version 8.0.7-377 built from git pull yesterday I think I've covered all the pieces. I have not explored how/whether any options passed to includegraphics are i= nterpreted by includesvg. Now, if I could get .svg images to display inline in my emacs buffer. The = following is not respected, at least in my hands. =20 '(org-export-latex-inline-image-extensions (quote ("pdf" "jpeg" "jpg" "png= " "ps" "eps" "svg"))) Any takers? ~ Malcolm >-----Original Message----- >From: emacs-orgmode-bounces+mec=3Dstowers.org@gnu.org [mailto:emacs-orgmo= de-bounces+mec=3Dstowers.org@gnu.org] On >Behalf Of Malcolm Cook >Sent: Thursday, August 08, 2013 9:05 PM >To: Malcolm Cook; emacs-orgmode@gnu.org; Nick Dokos >Subject: Re: [O] how to handle svg files when exporting orgmode to html a= nd pdf? > >Aaron, > >Thanks for staying with me on this. > >I'm not sure what you're suggesting. > >Nonetheless, I just updated org from `git clone git://orgmode.org/org-mod= e.git` > >So, now I'm got org-version release_8.0.7-377-gef2d47.dirty. > >Are you suggesting that with this patch.svg created with exporting >graphics :file should now display in the emacs buffer when I toggle >display of inline images? I wish they would. They do not, despite my >adding "svg" to org-export-latex-inline-image-extensions. > >Are you suggesting that such a .svg created by org code block would be >appear in the pdf created when I export to latex -> pdf? I wish that >also... that's what I've been trying to accomplish. > >Thanks!, > > >Malcolm > > >PS - I see you are/were in PA in linguistics. My first job after my >masters in AI from U Mass was at CMU's psych dept as a lisp programmer >for John Anderson's intelligent tutoring systems. I then went on in >computational linguistics a bit, working on a marcus parser based >natural language processing system at wang labs. Ages ago. Now I'm >in computational biology. The one commonality through it all? Emacs! >-- >Malcolm Cook >h - 913.642.5257 >c - 913.226.1542 >w - 816.926.4449 > > >On Thu, Aug 8, 2013 at 4:34 PM, Aaron Ecay wrote: >> Hi Malcom, >> >> There is a patch that was added to the master branch of the org git >> repository on Jul 27, which turns this from a link into a real inclusio= n >> of the image. So, it will only work as intended if you are using a git >> checkout from after that date. >> >> My apologies, I should have made this more prominent in my earlier >> mails. >> >> -- >> Aaron Ecay