Node:Output details, Previous:Lexical details, Up:Technical manual



Output details

LilyPond's default output format is TeX. Using the option -f (or --format) other output formats can be selected also, but currently none of them work reliably.

At the beginning of the output file, various global parameters are defined. It also contains a large \special call to define PostScript routines to draw items not representable with TeX, mainly slurs and ties. A DVI driver must be able to understand such embedded PostScript, or the output will be rendered incompletely.

Then the file lilyponddefs.tex is loaded to define the macros used in the code which follows. lilyponddefs.tex includes various other files, partially depending on the global parameters.

Now the music is output system by system (a `system' consists of all 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.

The code produced by LilyPond should be run through LaTeX, not plain TeX.

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 foo.ly
     

It is important to set the indent parameter to zero in the \paper block of foo.ly.

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


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

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