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