Invoking lilypond-book - GNU LilyPond
Description: GNU LilyPond

Next: Filename extensions, Previous: Music fragment options, Up: LilyPond-book

### 13.6 Invoking `lilypond-book`

`lilypond-book` produces a file with one of the following extensions: `.tex`, `.texi`, or `.html`, depending on the output format. Both `.tex` and `.texi` files need further processing.

`lilypond-book` can also create a PSFONTS file, which is required by `dvips` to produce Postscript and PDF files. You can call this file whatever you want as long as you refer to the same file when you call `dvips`.

To produce PDF output from the lilypond-book file (here called `yourfile.lytex`), you should do

    lilypond-book --psfonts yourfile.lytex
    latex yourfile.tex
    dvips -o -h yourfile.psfonts -Ppdf yourfile.dvi
    ps2pdf yourfile.ps

The `.dvi` file created by this process will not contain noteheads. This is normal; if you follow the instructions, they will be included in the `.ps` and `.pdf` files.

To produce a Texinfo document (in any output format), follow the normal procedures for Texinfo (this is, either call `texi2dvi` or `makeinfo`, depending on the output format you want to create). See the documentation of Texinfo for further details.

`lilypond-book` accepts the following command line options:

`-f` format
`--format=`format
  Specify the document type to process: `html`, `latex`, or `texi` (the default). If this option is missing, `lilypond-book` tries to detect the format automatically.

  The `texi` document type produces a Texinfo file with music fragments in the DVI output only. For getting images in the HTML version, the format `texi-html` must be used instead.

  [Note: Currently, `texi` is the same as `texi-html`.]

`-F` filter
`--filter=`filter
  Pipe snippets through filter. `lilypond-book` will not –filter and –process at the same time.

  Example:

           lilypond-book --filter='convert-ly --from=2.0.0 -' my-book.tely

`-h`
`--help`
  Print a short help message.
`-I` dir
`--include=`dir
  Add dir to the include path.
`-o` dir
`--output=`dir
  Place generated files in directory dir. Running `lilypond-book` generates lots of small files that LilyPond will process. To avoid all that garbage in the source directory use the `--output` command line option, and change to that directory before running `latex` or `makeinfo`:

           lilypond-book --output=out yourfile.lytex
           cd out
           ...

`-P` process
`--process=`command
  Process LilyPond snippets using command. The default command is `lilypond`. `lilypond-book` will not –filter and –process at the same time.
`--psfonts`
  extract all PostScript fonts into `file.psfonts` for dvips. This is necessary for `dvips -h file.psfonts`.
`-V`
`--verbose`
  Be verbose.
`-v`
`--version`
  Print version information.

##### Bugs

The Texinfo command `@pagesizes` is not interpreted. Similarly, LaTeX commands that change margins and line widths after the preamble are ignored.

Only the first `\score` of a LilyPond block is processed.

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

Other languages: English.
Using automatic language selection.