Previous: Global layout, Up: Changing defaults



4.7 Output details

The default output format is LaTeX, which should be run through LaTeX. Using the option -f (or --format) other output formats can be selected also, but none of them work reliably.

Now the music is output system by system (a `system' is a single line from the score, consisting of staves belonging together). From TeX's point of view, a system is an \hbox which contains a lowered \vbox so that it is centered vertically on the baseline of the text. Between systems, \interscoreline is inserted vertically to have stretchable space. The horizontal dimension of the \hbox is given by the linewidth parameter from LilyPond's \paper block.

After the last system LilyPond emits a stronger variant of \interscoreline only if the macro \lilypondpaperlastpagefill is not defined (flushing the systems to the top of the page). You can avoid that by setting the variable lastpagefill in LilyPond's \paper block.

It is possible to fine-tune the vertical offset further by defining the macro \lilypondscoreshift:

     \def\lilypondscoreshift{0.25\baselineskip}

where \baselineskip is the distance from one text line to the next.

Here an example how to embed a small LilyPond file foo.ly into running LaTeX text without using the lilypond-book script (see lilypond-book manual):

     \documentclass{article}
     
     \def\lilypondpaperlastpagefill{}
     \lineskip 5pt
     \def\lilypondscoreshift{0.25\baselineskip}
     
     \begin{document}
     This is running text which includes an example music file
     \input{foo.tex}
     right here.
     \end{document}

The file foo.tex has been simply produced with

       lilypond-bin foo.ly

The call to \lineskip assures that there is enough vertical space between the LilyPond box and the surrounding text lines.

Read comments on this page, or add one.

This page is for LilyPond-2.2.6 (stable-branch).

Report errors to <bug-lilypond@gnu.org>.