I'd like to include inline images in my org-mode documents, but I really need a png for HTML export and a pdf for LaTeX export for it to look decent. Is there a way to express this?
4
votes
1 Answers
5
votes
I got an answer in irc that worked well for me.
#+ATTR_LaTeX: width=0.38\textwidth wrap placement={r}{0.4\textwidth}
#+ATTR_HTML: alt="old index mech" title="Old index mech" align="right"
#+begin_src emacs-lisp :exports results :results value raw
(case (and (boundp 'backend) backend)
(nil "")
(latex "[[file:img/indexing-old.pdf]]")
(html "[[file:img/indexing-old.png]]"))
#+end_src
This selects the link based on the backend at export time while still giving me HTML and LaTeX attributes. Seems pretty straightforward.