unofficial mirror of emacs-orgmode@gnu.org
 help / color / mirror / code / Atom feed
From: "Victor A. Stoichita" <victor@svictor.net>
To: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: passing variables to lilypond code blocks
Date: Thu, 18 Feb 2021 12:42:45 +0100
Message-ID: <87lfbld2kq.fsf@svictor.net> (raw)

Hi,
I’m trying to understand how ob-lilypond handles variables.
I have the following minimal example which compiles correctly:
#+begin_src lilypond :file test.png :cache no
  myVar = { e f g}
  \relative c' { a b c d \myVar }
#+end_src

Can I move the definition of myVar to a header argument of the 
source block?
When I write this: 
#+begin_src lilypond :file test.png :cache no :var 
 myVar="{ e f g }"
  \relative c' { a b c d \myVar }
#+end_src
The compiler complains: "unknown escaped string: `\myVar'".

This makes me think that myVar is not passed at all to the code 
block. What is the correct way to do this?

I know that I can do it with noweb syntax. However, I would prefer 
to use header args because I need those variables in all lilypond 
code blocks. Ultimately, I plan to pass them from 
org-babel-default-header-args:lilypond.

Victor


                 reply	other threads:[~2021-02-18 11:45 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=87lfbld2kq.fsf@svictor.net \
    --to=victor@svictor.net \
    --cc=emacs-orgmode@gnu.org \
    --subject='Re: passing variables to lilypond code blocks' \
    /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

unofficial mirror of emacs-orgmode@gnu.org

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://yhetil.org/orgmode/0 orgmode/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 orgmode orgmode/ https://yhetil.org/orgmode \
		emacs-orgmode@gnu.org
	public-inbox-index orgmode

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.yhetil.org/yhetil.emacs.orgmode
	nntp://news.gmane.io/gmane.emacs.orgmode


code repositories for project(s) associated with this inbox:

	orgmode.git.git (no URL configured)

AGPL code for this site: git clone http://ou63pmih66umazou.onion/public-inbox.git