From mboxrd@z Thu Jan 1 00:00:00 1970 From: Brett Viren Subject: Re: org-export-current-backend variable and org-mode 8 Date: Wed, 31 Jul 2013 14:41:35 -0400 Message-ID: References: <874nbavgmw.fsf@cantab.net> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:50428) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V4bay-0006gq-JB for emacs-orgmode@gnu.org; Wed, 31 Jul 2013 14:58:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V4bLX-0000k1-UZ for emacs-orgmode@gnu.org; Wed, 31 Jul 2013 14:42:13 -0400 Received: from smtpgw.bnl.gov ([2620:10a:0:3::30]:7697 helo=iron3.sec.bnl.local) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V4bLX-0000ZH-NS for emacs-orgmode@gnu.org; Wed, 31 Jul 2013 14:42:03 -0400 In-Reply-To: <874nbavgmw.fsf@cantab.net> (Christophe Rhodes's message of "Wed, 31 Jul 2013 17:27:51 +0100") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Christophe Rhodes Cc: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hi Christophe, Christophe Rhodes 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 =20=20 * A graph #+header: :file (by-backend (html "graph.png") (latex "graph.pdf") (t "grap= h.svg")) #+header: :export results #+begin_src dot digraph Name { tail -> head; } #+end_src =2DBrett. --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEYEARECAAYFAlH5WmAACgkQEixH2Z0dKCzEoACgkrurSxLM/596FA+XmI26lAPY Fp8Anjtv0UDzuMbUsnAzrjIW2vts/n2x =0fuU -----END PGP SIGNATURE----- --=-=-=--