emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] org-export-current-backend variable and org-mode 8


From: Brett Viren
Subject: Re: [O] org-export-current-backend variable and org-mode 8
Date: Wed, 31 Jul 2013 14:41:35 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux)

Hi Christophe,

Christophe Rhodes <address@hidden> writes:

> In org-mode 7, I was able to use the (documented) variable
> org-export-current-backend to test what the current backend is, allowing
> me to dynamically produce and include images of different formats
> depending on whether I was exporting to latex (tikz) or html (png).
>
> In org-mode 8, I cannot find this variable, or any documented variable
> of a similar nature.  What is the recommended way for dispatching at the
> emacs-lisp level when exporting a document on the export backend?

I don't know if this is exactly what you are asking for but I hit on the
following a few weeks ago.  It defines an elisp macro inside the org
file and then calls it later in the header of a code block to switch the
output file names based on which backend (if any) is in effect.  I hope
it helps.

If you have a better way to do these kind of output switches, I'd like
to know.


* COMMENT setup

#+begin_src emacs-lisp :results silent
  (defmacro by-backend (&rest body)
    `(case (if (boundp 'backend) backend nil) ,@body))
#+end_src
  
* A graph

#+header: :file (by-backend (html "graph.png") (latex "graph.pdf") (t 
"graph.svg"))
#+header: :export results
#+begin_src dot
digraph Name {
        tail -> head;
}
#+end_src


-Brett.

Attachment: pgpxarPjSaVWJ.pgp
Description: PGP signature


reply via email to

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