lyluatex: wrapper with both lilypond code and optional arguments

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

lyluatex: wrapper with both lilypond code and optional arguments

Malte Meyn-3
Hi list,

I have the following problem: I want to use a wrapper for the ly
environment that contains some \layout code, music function definitions
etc. *And* I would like to use lyluatex’s label argument. Any idea how
to do both? The following example shows both a ly environment with label
and a wrapper called “aly”. But I haven’t found a way to label the aly
environment.

Thanks in advance for any hints and help!
Malte

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\documentclass[a4paper,12pt]{article}
\usepackage{lipsum}

\usepackage[nofragment,labelprefix=nbsp:]{lyluatex}

\newcommand{\preLilyPondExample}{\par\medskip}
\newcommand{\postLilyPondExample}{\par\medskip}

\newenvironment{aly}{
\ly
\layout {
   \context {
     \Voice
     \override NoteHead.color = ##blue
   }
}
}{\endly}

\begin{document}
\textbf{\pageref{nbsp:test}}

\lipsum
\begin{ly}[label=test]
   \new Staff \with {
     instrumentName = "Octobass"
   } \relative {
     c'1 R1*20
   }
\end{ly}
\lipsum
\begin{aly}
   \new Staff \with {
     instrumentName = "Octobass"
   } \relative {
     c'1 R1*20
   }
\end{aly}
\lipsum
\end{document}

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: lyluatex: wrapper with both lilypond code and optional arguments

Malte Meyn-3


Am 17.09.18 um 16:30 schrieb Malte Meyn:

> Hi list,
>
> I have the following problem: I want to use a wrapper for the ly
> environment that contains some \layout code, music function definitions
> etc. *And* I would like to use lyluatex’s label argument. Any idea how
> to do both? The following example shows both a ly environment with label
> and a wrapper called “aly”. But I haven’t found a way to label the aly
> environment.
>
> Thanks in advance for any hints and help!
> Malte

Forgot to mention: I tried to use \begin{dly}[…] here instead of \ly:

> \newenvironment{aly}{
> \ly
> \layout {
>    \context {
>      \Voice
>      \override NoteHead.color = ##blue
>    }
> }
> }{\endly}

But then the LilyPond code is processed by LuaLaTeX. And LuaLaTeX
complains that it doesn’t know the \layout command ;)

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user