[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] parameterizing keyword values during a #+call
From: |
Eric Schulte |
Subject: |
Re: [O] parameterizing keyword values during a #+call |
Date: |
Thu, 25 Apr 2013 19:19:37 -0600 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) |
Greg Minshall <address@hidden> writes:
> hi. i would have an org file that uses lots of #+calls to various
> asymptote routines (babelled into the file) to produce graphics. i
> would like to export this file to both html and to latex (specifically
> beamer). for html, i would like, e.g., SVG files, and for latex, PDF
> files. the file name is normally passed to the asymptote routine via a
> :file parameter, to wit
> ----
> #+call: disc[:file images/disc.svg]() :results file
> ----
> and the file extension (".svg" in the above) determines the format of
> the asymptote output.
>
> is there an obvious way to allow the file extension to take on different
> values depending on which sort of export is driving its execution? i
> had hoped that replacing ".svg" with something like ".{{{ext()}}}",
> where "ext" was a macro which selected amongst the alternatives(*),
> would do the trick. but that doesn't appear to be the case.
>
Something like the following should work.
#+call: disc[:file (if (and (boundp org-export-current-backend) (equal
org-export-current-backend 'html)) "foo.svg" "foo.tex")]() :results file
And you could wrap up the extra-long Emacs-lisp in a function or macro
in your init to avoid the overlength header argument.
>
> thanks in advance (and with full appreciation of what a pain macros
> are to implement fully, halfly, anyly), Greg Minshall
>
> (*)
> #+MACRO: ext @@latex:pdf@@@@beamer:pdf@@@@html:svg@@
>
--
Eric Schulte
http://cs.unm.edu/~eschulte