emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] Choosing image format according to export backend


From: Vincent Beffara
Subject: [O] Choosing image format according to export backend
Date: Wed, 15 May 2013 19:38:23 +0200
User-agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.3.50 (darwin)

Dear list,

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.

I found this piece of code on stackoverflow:

#+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

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?

[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?]

Cheers,

-- 
Vincent




reply via email to

[Prev in Thread] Current Thread [Next in Thread]