From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: Choosing image format according to export backend Date: Fri, 9 Aug 2013 11:49:48 +0200 Message-ID: References: Mime-Version: 1.0 (Mac OS X Mail 6.5 \(1508\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:44188) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V7jKW-0003fP-Di for emacs-orgmode@gnu.org; Fri, 09 Aug 2013 05:50:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V7jKQ-0001wI-JV for emacs-orgmode@gnu.org; Fri, 09 Aug 2013 05:49:56 -0400 Received: from mail-ee0-x232.google.com ([2a00:1450:4013:c00::232]:59572) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V7jKQ-0001wC-Cp for emacs-orgmode@gnu.org; Fri, 09 Aug 2013 05:49:50 -0400 Received: by mail-ee0-f50.google.com with SMTP id d51so2044163eek.9 for ; Fri, 09 Aug 2013 02:49:49 -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: John Hendy Cc: Vincent Beffara , emacs-orgmode On 15.5.2013, at 22:21, John Hendy wrote: > On Wed, May 15, 2013 at 12:38 PM, Vincent Beffara = wrote: >> Dear list, >>=20 >> I would like to have the same org file export to both PDF (through >> LaTeX) and HTML. The problem I have is images: for printing, PDF = images >> would be best but for display in a browser, it is much better to have = a >> PNG file rather than a link to the PDF. So what I need is for the >> exporter to choose the image differently according to the backend. >=20 > I know this is more of a request for coding help, but just wanted to > add my vote that this would be great. I don't use html *that* much, > but having the option would be awesome, and the replacement of all > *.pdf links with *.png (and typically re-running R code to generate > .png version, or running imagemagick on the dir to create them) is > typically too much of a barrier so I just stick with PDF/Beamer. >=20 > I'd love something like this. I think this should be possible using filters in the exporter. - Carsten >=20 >=20 > John >=20 >>=20 >> I found this piece of code on stackoverflow: >>=20 >> #+begin_src emacs-lisp :exports results :results value raw >> (case (and (boundp 'backend) backend) >> (nil "") >> (latex "[[file:traps.pdf]]") >> (html "[[file:traps.png]]")) >> #+end_src >>=20 >> That works, but I was not able to make it recognize captions and such >> (except by pasting them in both options or otherwise modifying the = lisp >> code above). Plus the markup is a bit heavy. Is there a simpler way? >>=20 >> [One thing I thought about was to keep only one of them in the = markup, >> and modifying the output for the other backend. I kind of know how to >> do that within LaTeX by redefining the \includegraphics command but = it >> feels ... well ... not elegant. Maybe using a hook during one of the >> exports?] >>=20 >> Cheers, >>=20 >> -- >> Vincent >>=20 >>=20 >=20