[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
tex macros and lilypond-book
From: |
Han-Wen Nienhuys |
Subject: |
tex macros and lilypond-book |
Date: |
Thu, 22 May 2003 22:45:24 +0200 |
address@hidden writes:
> I'd like to define a macro for snippets of music
> examples in LaTeX so instead of writing:
>
> \begin{figure}[h]
> \caption{\emph{\small{Caption}}}
> \label{label}
> \begin{center}
> \begin[notime,smallverbatim,singleline]{lilypond}
> \clef bass
> c d e f g a b
> \end{lilypond}
> \end{center}
> \end{figure}
>
> I could write
>
> \my_lily_example_macro{
> \clef bass
> c d e f g a b
> }
>
> I guess I don't have to mention that lilypond-book naturally
> fails to work when using macros like this, since it simply processes
> everything between \begin{lilypond} and \end{lilypond} leaving
> everything else untouched. And the \begin{lilypond} and \end{lilypond}
> are only to be found in the macrodefinition, so nothing happens...
>
> Is it possible to expand user-defined macros before running
> lilypond-book or how can I solve the problem?
I would suggest defining a new environment, that does the caption
formatting, the centering, etc. Then add a macro to your editor
to insert
> \begin[notime,smallverbatim,singleline]{lilypond}
> \clef bass
> c d e f g a b
> \end{lilypond}
with a single keystroke.
--
Han-Wen Nienhuys | address@hidden | http://www.cs.uu.nl/~hanwen