[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] How to use .pdf images on Latex export, and .png images on ODT e
Charles C. Berry
Re: [O] How to use .pdf images on Latex export, and .png images on ODT export
Tue, 31 Jan 2017 09:00:04 -0800
Alpine 2.20 (OSX 67 2015-01-07)
On Tue, 31 Jan 2017, Giacomo M wrote:
I was wondering what is the best way to include pdf images on latex export
and png images on odt export (assuming same path, only extension changes). A
macro like this one:
#+MACRO: figext @@latex:.pdf@@@@odt:.png@@
doesn't seem to work.
No, it won't work as Babel runs before the exporter handles the snippets.
Something like this should do.
Run this block or put the code in your init file:
(defun org-pdf-if-latex ()
(if (eq (org-bound-and-true-p
'latex) "pdf" "png"))
This generates pdf for latex and png for all other backends (or no backend
#+BEGIN_SRC R :exports both :results graphics :file-ext (org-pdf-if-latex)
See (info "(org) file-ext")