From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vincent Beffara Subject: Re: Choosing image format according to export backend Date: Wed, 15 May 2013 19:59:55 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:55033) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ucfzo-0006wL-GO for emacs-orgmode@gnu.org; Wed, 15 May 2013 14:00:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ucfzj-00027A-Ri for emacs-orgmode@gnu.org; Wed, 15 May 2013 14:00:12 -0400 Received: from plane.gmane.org ([80.91.229.3]:33274) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ucfzj-000273-LY for emacs-orgmode@gnu.org; Wed, 15 May 2013 14:00:07 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Ucfzh-0006WA-PZ for emacs-orgmode@gnu.org; Wed, 15 May 2013 20:00:05 +0200 Received: from 192.33.214.222 ([192.33.214.222]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 15 May 2013 20:00:05 +0200 Received: from vbeffara by 192.33.214.222 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 15 May 2013 20:00: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 > 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. ... my entry for the dirtiest piece of code possible (but it works for now): (defun vb-massage-includegraphics (str backend opts) (replace-regexp-in-string ".png}" ".pdf}" str)) (add-hook 'org-export-filter-final-output-functions 'vb-massage-includegraphics) Am I on the right track? Meaning, after adding a test on the backend, possibly a file existence check and so on. Or am I missing a simpler way? Cheers, -- Vincent