From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christophe Rhodes Subject: Re: Options for HTML & PDF export Date: Thu, 19 May 2011 13:28:16 +0100 Message-ID: <87zkmiyivz.fsf@cantab.net> References: <7020.1305753555@alphaville.americas.hpqcorp.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from eggs.gnu.org ([140.186.70.92]:43484) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QN2Ra-0002MT-Mh for emacs-orgmode@gnu.org; Thu, 19 May 2011 08:35:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QN2RZ-0004VT-EQ for emacs-orgmode@gnu.org; Thu, 19 May 2011 08:35:10 -0400 Received: from lo.gmane.org ([80.91.229.12]:47614) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QN2RY-0004VJ-5d for emacs-orgmode@gnu.org; Thu, 19 May 2011 08:35:09 -0400 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1QN2RV-00040V-AM for emacs-orgmode@gnu.org; Thu, 19 May 2011 14:35:05 +0200 Received: from csrhodes.plus.com ([81.174.155.115]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 19 May 2011 14:35:05 +0200 Received: from csr21 by csrhodes.plus.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 19 May 2011 14:35:05 +0200 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: emacs-orgmode@gnu.org writes: > On 5/18/11 4:19 PM, "Nick Dokos" wrote: >>What is the problem with PNG exactly? I've never had any problems >>incorporating them into a PDF. It is a bitmap format, so it will not >>suffer extreme changes in magnification without some ugliness of course, >>but other than that I don't know of any problems. > > That is exactly the problem =). It does include itself into the document, > it just doesn't look very nice. Since these are data-based graphics > coming from R, their lines should be nice & crisp, but they end up looking > pretty fuzzy. For what it's worth, I've been experimenting with the tikzDevice R graphics device. I have in the preamble of my current document #+srcname: orgrsetup #+begin_src R :session *R* :exports none :results none library(tikzDevice) org.device <- function(name, ext) { file <- sprintf("%s.%s", name, ext) switch(ext, "png"=png(file, width=480, height=384), "tikz"=tikz(file, width=5, height=4)) } org.raw <- function(name, ext) { file <- sprintf("%s.%s", name, ext) switch(ext, "png"=sprintf("[[file:%s]]", file), "tikz"=sprintf("#+LaTeX: \\input{%s}", file)) } #+end_src and then I use #+begin_src R :session *R* :exports results :results value raw :var name="filename" :var ext=(csr-org-export-babel-graphics-extension) org.device(name, ext) # draw the picture here dev.off() org.raw(name,ext) #+end_src where csr-org-export-babel-graphics-extension returns "tikz" if the backend is latex, and png otherwise. This (with a bit more work on the R side) gives me scalable graphics with fonts matching the PDF document's fonts going through LaTeX, and acceptable-quality HTML. (Which is something I've been looking for for the last six years, so I'm quite pleased at the moment :-) I hope this helps to provide some ideas. Cheers, Christophe