emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Salomon Turgman <sturgman@gmail.com>
To: org mode <emacs-orgmode@gnu.org>
Subject: Import Reusable org-babel snippet using #+SETUPFILE
Date: Tue, 9 Jun 2020 13:28:13 -0400	[thread overview]
Message-ID: <CA+yQROoZM0fUrZOLrGsrK-b_Rk_a2yRNmYs6Xy-24VLS29Kj1A@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 886 bytes --]

Hello all,

I have created what I hoped was a reusable org-babel snippet that looks
like this:

#+NAME: simulation
#+HEADER: :var cap="DEFAULTCAPTION" :cache yes :eval no-export :var
altimage="1_image.svg#img1"
#+BEGIN_SRC emacs-lisp :var divid="defid" :var num=1 :results html :exports
results
(format
"cool string that uses parameters %s %s ..."
num cap divid altimage (capitalize divid) divid)
#+END_SRC

I will use this snippet with something like:

#+CALL: simulation(cap="bam", num=1, divid="bamid"...)

Now, if I include the definition in every org file that I want to use it,
everything works well. However, if I include the definition in a central
org file that I import using #+SETUPFILE, things break and I don't get the
proper output in my html exports.

Is there a way that I can "import" that snippet without rewriting it in
every file I need it?

Thanks in advance!

-s-

[-- Attachment #2: Type: text/html, Size: 1238 bytes --]

             reply	other threads:[~2020-06-09 17:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-09 17:28 Salomon Turgman [this message]
2020-06-09 23:09 ` Import Reusable org-babel snippet using #+SETUPFILE Nicolas Goaziou
  -- strict thread matches above, loose matches on Subject: below --
2020-06-15 19:52 Douglas Perrin
2020-06-16 15:21 ` Salomon Turgman
2020-06-17 14:23   ` Salomon Turgman
2020-06-18 16:03 Douglas Perrin

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=CA+yQROoZM0fUrZOLrGsrK-b_Rk_a2yRNmYs6Xy-24VLS29Kj1A@mail.gmail.com \
    --to=sturgman@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public 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).