[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
passing variables to lilypond code blocks
From: |
Victor A. Stoichita |
Subject: |
passing variables to lilypond code blocks |
Date: |
Thu, 18 Feb 2021 12:42:45 +0100 |
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
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- passing variables to lilypond code blocks,
Victor A. Stoichita <=