lilypond-0.1.55
[lilypond.git] / Documentation / breaking
blobea1ada7e10a983ea8e949807a9f73b8f30eb1167
1 [Source files: command.hh, scommands.cc]
3 BREAKING, PREBREAK POSTBREAK, etc.
5 So what's the deal with PREBREAK and POSTBREAK and all this
6 stuff?
8 Let's take text as an example. In German some compound
9 words change their spelling if they are broken: "backen" becomes
10 "bak-ken".  TeX has a mechanism to deal with this, you would define
11 the spelling of "backen" in TeX in this way
13         \discretionary{bak-}{ken}{backen}
15 These 3 arguments are called "prebreak", "postbreak" and "nobreak"
16 text.
18 The same problem exists when typesetting music. If a line of music is
19 broken, the next line usually gets a clef. So in TeX terms, the clef
20 is a postbreak. The same thing happens with meter signs: Normally the
21 meter follows the bar. If a line is broken at that bar, the bar along
22 with the meter stays on the "last" line, but the next line also gets a
23 meter sign after the clef. Using the previous notation,
25         \discretionary{bar meter}{clef meter}{ bar meter }
27 In Lilypond, we have the same concepts (and the same
28 terminology). Each (nonrhythmic) symbol is typeset using a Command
29 (code: TYPESET). At a breakpoint, TYPESET commands can be grouped
30 using separators (in lower case):
32         BREAK_PRE, typeset(bar), typeset(meter),
33         BREAK_MID, typeset(bar), typeset(meter),
34         BREAK_POST, typeset(clef), typeset(meter), BREAK_END 
36 The BREAK command sequence is terminated with BREAK_END, so other
37 commands (like INTERPRET) may follow this sequence.