From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: parameterizing keyword values during a #+call Date: Thu, 25 Apr 2013 19:19:37 -0600 Message-ID: <87txmuhyvq.fsf@gmail.com> References: <94981.1366933553@greg-minshalls-mbp.local> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:34745) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UVXK4-0005c0-W4 for emacs-orgmode@gnu.org; Thu, 25 Apr 2013 21:19:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UVXK3-0007Aw-T7 for emacs-orgmode@gnu.org; Thu, 25 Apr 2013 21:19:36 -0400 Received: from mail-da0-x22f.google.com ([2607:f8b0:400e:c00::22f]:40570) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UVXK3-0007As-MD for emacs-orgmode@gnu.org; Thu, 25 Apr 2013 21:19:35 -0400 Received: by mail-da0-f47.google.com with SMTP id p1so1685449dad.20 for ; Thu, 25 Apr 2013 18:19:34 -0700 (PDT) In-Reply-To: <94981.1366933553@greg-minshalls-mbp.local> (Greg Minshall's message of "Thu, 25 Apr 2013 19:45:53 -0400") 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: Greg Minshall Cc: emacs-orgmode@gnu.org Greg Minshall 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