From: Eric Schulte <schulte.eric@gmail.com> To: Greg Minshall <minshall@umich.edu> Cc: emacs-orgmode@gnu.org Subject: Re: parameterizing keyword values during a #+call Date: Thu, 25 Apr 2013 19:19:37 -0600 [thread overview] Message-ID: <87txmuhyvq.fsf@gmail.com> (raw) In-Reply-To: <94981.1366933553@greg-minshalls-mbp.local> (Greg Minshall's message of "Thu, 25 Apr 2013 19:45:53 -0400") Greg Minshall <minshall@umich.edu> 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
next prev parent reply other threads:[~2013-04-26 1:19 UTC|newest] Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top 2013-04-25 23:45 Greg Minshall 2013-04-26 1:19 ` Eric Schulte [this message] 2013-04-26 11:46 ` Greg Minshall 2013-04-26 22:27 ` Greg Minshall 2013-04-26 22:34 ` Eric Schulte 2013-04-26 22:50 ` Greg Minshall 2013-04-30 14:40 ` Greg Minshall 2013-04-30 18:46 ` Gary Oberbrunner 2013-05-01 5:02 ` Eric Schulte 2013-05-01 10:52 Greg Minshall
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style List information: https://www.orgmode.org/ * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=87txmuhyvq.fsf@gmail.com \ --to=schulte.eric@gmail.com \ --cc=emacs-orgmode@gnu.org \ --cc=minshall@umich.edu \ --subject='Re: parameterizing keyword values during a #+call' \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
Code repositories for project(s) associated with this inbox: https://git.savannah.gnu.org/cgit/emacs/org-mode.git This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).