lilypond-devel
[Top][All Lists]
Advanced

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

doc addition: lilypond-book and ties/slurs/... continuing past the end o


From: Vaclav Smilauer
Subject: doc addition: lilypond-book and ties/slurs/... continuing past the end of fragment
Date: Wed, 31 May 2006 16:15:41 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

I suggest adding the following to "13.2 Integrating LaTeX and music", as
an extra feature. It would be useful for HTML and texinfo as well, but
this works for LaTeX only. Best regards,

Vaclav Smilauer

---

Sometimes, it is useful to display music elements as if they continued
after the end of the fragment, such as ties and slurs. It can be done by
breaking the staff and suppressing inclusion of the rest of the lilypond
output. Ties/slurs will look as if they continued on the next line, but
without that line being present:

 [show figure of the next LaTeX code snippet; go
 http://www.arcig.cz/~eudoxos/lily-doc/ for EPS and PNG
 versions, as generated by lilypond (2.6.3) from the lilypond-book
 generated snippet with --preview, in case there are technical
 difficulties generating the image for texinfo/HTML documentation
 automatically.  Picture speaks for thousand words!]h

To achieve this, define \betweenLilyPondSystem in such a way that
inclusion of other systems is terminated once the required number of
them is included. Since \betweenLilypondSystem is first called _after_
the first system, including only the first system is trivial, e.g.:

 \def\betweenLilyPondSystem#1{\endinput}

 \begin[fragment]{lilypond}
    c'1\( e'( c'~ \break c' d) e f\)
 \end{lilypond}

If a greater number of systems is requested, TeX conditional has to be
used before the \endinput. In this example, replace "2" by the numer of
systems you want in the output:

 \def\betweenLilyPondSystem#1{
     \ifnum##1<2\else\endinput\fi
 }
 ...

Remember that the definition of \betweenLilyPondSystem is effective
until TeX quits the current group (such as LaTeX environment) or is
overridden by another definition (which is, in most cases, for the rest
of the document). To reset your definition, say

 \let\betweenLilyPondSystem\undefined

in your LaTeX source.

[Consider inclusion of the rest, I am not sure:]

You can avoid typing by defining a TeX macro

 \def\justFirstNSystemsPlease#1{
    \def\betweenLilyPondSystem##1{\ifnum##1<#1\else\endinput\fi}
 }

and then saying only how many systems you want before each fragment:

 \justFirstNSystemsPlease{3}
 \begin{lilypond}...\end{lilypond}
 \justFirstNSystemsPlease{1}
 \begin{lilypond}...\end{lilypond}







reply via email to

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