[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] Choosing image format according to export backend
From: |
Vincent Beffara |
Subject: |
Re: [O] Choosing image format according to export backend |
Date: |
Wed, 15 May 2013 19:59:55 +0200 |
User-agent: |
Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.3.50 (darwin) |
> 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