lilypond-user
[Top][All Lists]
Advanced

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

lyluatex: wrapper with both lilypond code and optional arguments


From: Malte Meyn
Subject: lyluatex: wrapper with both lilypond code and optional arguments
Date: Mon, 17 Sep 2018 16:30:42 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0

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}



reply via email to

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