lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Include file handling in lilypond-book


From: Karljurgen Feuerherm
Subject: Include file handling in lilypond-book
Date: Tue, 11 Jul 2017 23:54:09 +0000

Hello,

 

Putting together an exercise book using XeLaTeX and the lilypond environment. Everything works relatively well until I try to use an include file with variable definitions.

 

MWE:

 

                % !TEX encoding = UTF-8 Unicode

                % !TEX TS-program = LilyPond-Book

                % !LILYPOND tex = xelatex

                \documentclass{memoir}

               

%             \newcommand{\Ggrace}{\grace { g''32 }}

                \begin{document}

                \begin{lilypond}

                {

                  \include "lilypond-variables.ly"

                  \time 2/4

                  \grace { g''32 } g'4  \Ggrace a'4  \Ggrace b'4  \Ggrace c''4

                  \Ggrace d''4 \Ggrace e''4 \Ggrace f''4         g''4

                          a''2         g''4         f''4 \Ggrace e''4

                  \Ggrace d''4 \Ggrace c''4 \Ggrace b'4  \Ggrace a'4

                  \Ggrace g'4

                  \bar "||"

                }

                \end{lilypond}

                \end{document}

 

LILYPOND-VARIABLES.LY:

 

                Ggrace = {  \grace { g''32 }  }

 

The in-line g grace note is typeset just fine. The variable references, however, either choke, or (if I trash files after choking) are not expanded upon typesetting.

 

(I had originally tried to do this with a *tex include file with \newcommands, but that did not work either.)

 

The code below works fine in Frescobaldi:

 

\include "lilypond-variables.ly"

{

                 \time 2/4

                  \grace { g''32 } g'4  \Ggrace a'4  \Ggrace b'4  \Ggrace c''4

                  \Ggrace d''4 \Ggrace e''4 \Ggrace f''4         g''4

                          a''2         g''4         f''4 \Ggrace e''4

                  \Ggrace d''4 \Ggrace c''4 \Ggrace b'4  \Ggrace a'4

                  \Ggrace g'4

                  \bar "||"

}

 

So I’m assuming there’s a trick to the placement/invocation of the include file which I’m not privy to…? Using macOS Sierra 10.12.5 (16F73) and TL 2016; LilyPond-Book engine 2.0.4 (2014/03/23).

 

Thanks!


reply via email to

[Prev in Thread] Current Thread [Next in Thread]