]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/user/changing-defaults.itely
Expand 's to is.
[lilypond.git] / Documentation / user / changing-defaults.itely
1 @c -*-texinfo-*-
2 @node Changing defaults
3 @chapter Changing defaults
4
5
6 The purpose of LilyPond's design is to provide the finest output
7 quality as a default. Nevertheless, it may happen that you need to
8 change this default layout.  The layout is controlled through a large
9 number of proverbial ``knobs and switches.''  This chapter does not
10 list each and every knob. Rather, it outlines what groups of controls
11 are available and explains how to lookup which knob to use for a
12 certain effect.
13
14
15 @cindex Program reference
16
17 The controls available for tuning are described in a separate
18 document, the @internalsref{Program reference} manual. That manual
19 lists all different variables, functions and options available in
20 LilyPond. It is written as a HTML document, which is available
21 @uref{http://lilypond.org/doc/Documentation/user/out-www/lilypond-internals/,on-line},
22 but is also included with the LilyPond documentation package.
23
24 There are three areas where the default settings may be changed:
25
26 @itemize @bullet
27 @item Output: changing the appearance of individual
28   objects. For example, changing stem directions, or the location of
29   subscripts.
30   
31 @item Context: changing aspects of the translation from music events to
32   notation. For example, giving each staff a separate time signature. 
33   
34 @item Global layout: changing the appearance of the spacing, line
35   breaks and page dimensions.
36 @end itemize
37
38 Then, there are separate systems for typesetting text (like
39 @emph{ritardando}) and selecting different fonts. This chapter also
40 discusses these.
41
42 Internally, LilyPond uses Scheme (a LISP dialect) to provide
43 infrastructure.  Overriding layout decisions in effect accesses the
44 program internals, which requires Scheme input.  Scheme elements are
45 introduced in a @code{.ly} file with the hash mark
46 @code{#}.@footnote{@ref{Scheme tutorial} contains a a short tutorial
47 on entering numbers, lists, strings and symbols in Scheme.}
48
49
50 @menu
51 * Interpretation contexts::     
52 * The \override command::       
53 * Fonts::                       
54 * Text markup::                 
55 * Global layout::               
56 * File structure::              
57 @end menu
58
59  
60 @node Interpretation contexts
61 @section Interpretation contexts
62
63 When music is printed, a lot of notation elements must be added to the
64 input, which is often bare bones.  For example, compare the input and
65 output of the following example:
66
67 @lilypond[verbatim,relative=2,fragment]
68   cis4 cis2. g4
69 @end lilypond
70
71 The input is rather sparse, but in the output, bar lines, accidentals,
72 clef, and time signature are added. LilyPond @emph{interprets} the
73 input. During this step, the musical information is inspected in time
74 order, similar to reading a score from left to right. While reading,
75 the program remembers where measure boundaries are, and what pitches
76 need explicit accidentals.  This information can be presented on
77 several levels.  For example, the effect of an accidental is limited
78 to a single stave, while a bar line must be synchronized across the
79 entire score.
80
81 Within LilyPond, these rules and bits of information are grouped in
82 so-called Contexts. Examples of context are @context{Voice},
83 @context{Staff}, and @context{Score}.  They are hierarchical, for
84 example, a @context{Staff} can contain many @context{Voice}s, and a
85 @context{Score} can contain many @context{Staff} contexts.
86
87 Each context has the responsibility for enforcing some notation rules,
88 creating some notation objects and maintaining the associated
89 properties.  So, the synchronization of bar lines is handled at
90 @context{Score} context.  The @context{Voice} may introduce an
91 accidentals and then the @context{Staff} context maintains the rule to
92 show or suppress the accidental for the remainder of the measure.
93
94 For simple scores, contexts are created implicitly, and you need not
95 be aware of them. For larger pieces, such as piano music, they must be
96 created explicitly to make sure that you get as many staves as you
97 need, and that they are in the correct order.  For typesetting pieces
98 with specialized notation, it can be useful to modify existing or
99 define new contexts.
100
101
102 Full description of all available contexts is in the program
103 reference, see
104 @ifhtml
105 @internalsref{Contexts}.
106 @end ifhtml
107 @ifnothtml 
108 Translation @arrow{} Context.
109 @end ifnothtml
110
111 @c [TODO: describe propagation]
112
113
114 @menu
115 * Creating contexts::           
116 * Changing context properties on the fly::  
117 * Modifying context plug-ins::  
118 * Layout tunings within contexts::  
119 * Changing context default settings::  
120 * Defining new  contexts::      
121 @end menu
122
123 @node Creating contexts
124 @subsection Creating contexts
125
126 For scores with only one voice and one staff, correct contexts are
127 created automatically. For more complex scores, it is necessary to
128 create them by hand.  There are three commands which do this.
129
130 The easiest command is @code{\new}, and it also the quickest to type.
131 It is prepended to a music expression, for example
132
133 @cindex @code{\new}
134 @cindex new contexts
135 @cindex Context, creating
136
137 @example
138   \new @var{type} @var{music expression}
139 @end example
140
141 @noindent
142 where @var{type} is a context name (like @code{Staff} or
143 @code{Voice}).  This command creates a new context, and starts
144 interpreting @var{music expression} with that.
145
146 A practical application of @code{\new} is a score with many
147 staves. Each part that should be on its own staff, is preceded with 
148 @code{\new Staff}.
149
150 @lilypond[verbatim,relative=2,raggedright,fragment]
151   << \new Staff { c4 c }
152      \new Staff { d4 d }
153   >>
154 @end lilypond
155
156 @cindex @code{\context}
157
158 Like @code{\new}, the @code{\context} command also directs a music
159 expression to a context object, but gives the context an extra name. The
160 syntax is
161
162 @example
163   \context @var{type} = @var{id} @var{music}
164 @end example
165
166 This form will search for an existing context of type @var{type}
167 called @var{id}. If that context does not exist yet, it is created.
168 This is useful if the context is referred to later on. For example, when
169 setting lyrics the melody is in a named context
170
171 @example
172  \context Voice = "@b{tenor}" @var{music}
173 @end example
174
175 @noindent
176 so the texts can be properly aligned to its notes,
177
178 @example
179 \new Lyrics \lyricsto "@b{tenor}" @var{lyrics} 
180 @end example
181
182 @noindent
183
184 Another possibility is funneling two different music expressions into
185 one context. In the following example, articulations and notes are
186 entered separately,
187
188 @verbatim
189 music =  { c4 c4 }
190 arts =  { s4-. s4-> }
191 @end verbatim
192
193 They are combined by sending both to the same @context{Voice} context,
194
195 @verbatim
196   << \new Staff \context Voice = "A" \music
197      \context Voice = "A" \arts
198   >>
199 @end verbatim
200 @lilypond[raggedright]
201 music =  { c4   c4 }
202 arts =   { s4-. s4-> }
203    \relative c''  << \new Staff \context Voice = "A" \music
204      \context Voice = "A" \arts
205   >>
206 @end lilypond
207
208 With this mechanism, it is possible to define an Urtext (original
209 edition), with the option put several distinct articulations on the
210 same notes.
211
212 @cindex @code{\context}
213 @cindex creating contexts
214
215 The third command for creating contexts is
216 @example
217   \context @var{type} @var{music}
218 @end example
219
220
221 @noindent
222 This is similar to @code{\context} with @code{= @var{id}}, but matches
223 any context of type @var{type}, regardless of its given name.
224
225 This variant is used with music expressions that can be interpreted at
226 several levels. For example, the @code{\applyoutput} command (see
227 @ref{Running a function on all layout objects}). Without an explicit
228 @code{\context}, it is usually is applied to @context{Voice}
229
230 @example
231   \applyoutput #@var{function}   % apply to Voice
232 @end example
233
234 To have it interpreted at the @context{Score} or @context{Staff} level use
235 these forms
236
237 @example
238   \context Score \applyoutput #@var{function}
239   \context Staff \applyoutput #@var{function}
240 @end example
241
242
243 @node Changing context properties on the fly
244 @subsection Changing context properties on the fly
245
246 @cindex properties
247 @cindex @code{\set}
248 @cindex changing properties
249
250 Each context can have different @emph{properties}, variables contained
251 in that context. They can be changed during the interpretation step.
252 This is achieved by inserting the @code{\set} command in the music,
253
254 @quotation
255   @code{\set } @var{context}@code{.}@var{prop}@code{ = #}@var{value} 
256 @end quotation
257
258 For example,
259 @lilypond[verbatim,relative=2,fragment]
260   R1*2 
261   \set Score.skipBars = ##t
262   R1*2
263 @end lilypond
264
265 This command skips measures that have no notes. The result is that
266 multi rests are condensed.  The value assigned is a Scheme object. In
267 this case, it is @code{#t}, the boolean True value.
268
269 If the @var{context} argument is left out, then the current bottom-most
270 context (typically @context{ChordNames}, @context{Voice}, or
271 @context{Lyrics}) is used.  In this example,
272
273 @lilypond[verbatim,relative=2,fragment]
274   c8 c c c
275   \set autoBeaming = ##f
276   c8 c c c
277 @end lilypond
278
279 @noindent
280 the @var{context} argument to @code{\set} is left out, so automatic
281 beaming is switched off in the current @internalsref{Voice}.
282
283 Contexts are hierarchical, so if a bigger context was specified, for
284 example @context{Staff}, then the change would also apply to all
285 @context{Voice}s in the current stave. The change is applied
286 `on-the-fly', during the music, so that the setting only affects the
287 second group of eighth notes.
288
289 @cindex @code{\unset} 
290
291 There is also an @code{\unset} command,
292 @quotation
293   @code{\unset }@var{context}@code{.}@var{prop}
294 @end quotation
295
296 @noindent
297 which removes the definition of @var{prop}. This command removes
298 the definition only if it is set in @var{context}, so
299
300 @example
301  \set Staff.autoBeaming = ##f
302 @end example
303
304 @noindent
305 introduces a property setting at @code{Staff} level. The setting also
306 applies to the current @code{Voice}. However,
307
308 @example
309  \unset Voice.autoBeaming
310 @end example
311
312 @noindent
313 does not have any effect. To cancel this setting, the @code{\unset}
314 must be specified on the same level as the original @code{\set}. In
315 other words, undoing the effect of @code{Staff.autoBeaming = ##f}
316 requires
317 @example
318  \unset Staff.autoBeaming
319 @end example
320
321 Like @code{\set}, the @var{context} argument does not have to be
322 specified for a bottom context, so the two statements
323
324 @example
325   \set Voice.autoBeaming = ##t 
326   \set autoBeaming = ##t 
327 @end example 
328
329 @noindent
330 are equivalent.
331
332
333 Settings that should only apply to a single time-step can be entered
334 with @code{\once}, for example in
335
336 @lilypond[verbatim,relative=2,fragment]
337   c4
338   \once \set fontSize = #4.7
339   c4
340   c4
341 @end lilypond
342
343 the property @code{fontSize} is unset automatically after the second
344 note.
345
346 A full description of all available context properties is in the
347 program reference, see
348 @ifhtml
349 @internalsref{Tunable-context-properties}.
350 @end ifhtml
351 @ifnothtml
352 Translation @arrow{} Tunable context properties.
353 @end ifnothtml
354
355
356 @node Modifying context plug-ins
357 @subsection Modifying context plug-ins
358
359 Notation contexts (like Score and Staff) not only store properties,
360 they also contain plug-ins, called ``engravers'' that create notation
361 elements. For example, the Voice context contains a
362 @code{Note_head_engraver} and the Staff context contains a
363 @code{Key_signature_engraver}.
364
365 For a full a description of each plug-in, see 
366 @ifhtml
367 @internalsref{Engravers}.
368 @end ifhtml
369 @ifnothtml
370 Program reference @arrow Translation @arrow{} Engravers.
371 @end ifnothtml
372 Every context described in
373 @ifhtml
374 @internalsref{Contexts}
375 @end ifhtml
376 @ifnothtml 
377 Program reference @arrow Translation @arrow{} Context.
378 @end ifnothtml
379 lists the engravers used for that context.
380
381
382 It can be useful to shuffle around these plug-ins. This is done by
383 starting a new context, with @code{\new} or @code{\context}, and
384 modifying it like this, 
385
386 @example
387  \new @var{context} \with @{
388    \consists @dots{}
389    \consists @dots{}
390    \remove  @dots{}
391    \remove @dots{}
392    @emph{etc.}
393  @}
394  @var{..music..}
395 @end example
396
397 where the @dots{} should be the name of an engraver. Here is a simple
398 example which removes @code{Time_signature_engraver} and
399 @code{Clef_engraver} from a @code{Staff} context,
400
401 @lilypond[relative=1, verbatim,fragment]
402 << \new Staff {
403     f2 g
404   }
405   \new Staff \with {
406      \remove "Time_signature_engraver"
407      \remove "Clef_engraver"
408   } {
409     f2 g2
410   }
411 >>
412 @end lilypond
413
414 In the second stave there are no time signature or clef symbols.  This
415 is a rather crude method of making objects disappear since it will affect
416 the entire staff. The spacing is adversely influenced too. A more
417 sophisticated methods of blanking objects is shown in @ref{Common
418 tweaks}.
419
420 The next example shows a practical application.  Bar lines and time
421 signatures are normally synchronized across the score.  This is done
422 by the @code{Timing_engraver}. This plug-in keeps an administration of
423 time signature, location within the measure, etc. By moving the
424 @code{Timing_engraver} engraver from @code{Score} to @code{Staff}
425 context, we can have a score where each staff has its own time
426 signature.
427
428 @cindex polymetric scores
429
430
431 @lilypond[relative=1,raggedright,verbatim,fragment]
432 \new Score \with {
433   \remove "Timing_engraver"
434 } <<
435   \new Staff \with {
436     \consists "Timing_engraver"
437   } {
438       \time 3/4
439       c4 c c c c c
440   }
441   \new Staff \with {
442     \consists "Timing_engraver"
443   } {
444        \time 2/4
445        c4 c c c c c
446   }
447 >>
448 @end lilypond
449
450
451 @node Layout tunings within contexts
452 @subsection Layout tunings within contexts
453
454 Each context is responsible for creating certain types of graphical
455 objects. The settings used for printing these objects are also stored by
456 context. By changing these settings, the appearance of objects can be
457 altered.
458  
459 The syntax for this is
460
461 @example
462   \override @var{context}.@var{name}@code{ #'}@var{property} = #@var{value}
463 @end example
464
465 Here @var{name} is the name of a graphical object, like @code{Stem} or
466 @code{NoteHead}, and @var{property} is an internal variable of the
467 formatting system (`grob property' or `layout property'). The latter is a
468 symbol, so it must be quoted. The subsection @ref{Constructing a
469 tweak} explains what to fill in for @var{name}, @var{property}, and
470 @var{value}. Here we only discuss functionality of this command.
471
472 The command
473
474 @verbatim
475   \override Staff.Stem #'thickness = #4.0 
476 @end verbatim
477
478 @noindent
479 makes stems thicker (the default is 1.3, with staff line thickness as a
480 unit). Since the command specifies @context{Staff} as context, it only
481 applies to the current staff. Other staves will keep their normal
482 appearance.  Here we see the command in action:
483
484 @lilypond[verbatim,relative=2,fragment]
485   c4
486   \override Staff.Stem #'thickness = #4.0 
487   c4
488   c4
489   c4
490 @end lilypond
491
492 The @code{\override} command changes the definition of the @code{Stem}
493 within the current @context{Staff}. After the command is interpreted
494 all stems are thickened.
495
496 Analogous to @code{\set}, the @var{context} argument may be left out,
497 causing it to default to @context{Voice}, and adding @code{\once} applies
498 the change during one timestep only 
499
500 @lilypond[fragment,verbatim,relative=2]
501   c4
502   \once \override Stem #'thickness = #4.0 
503   c4
504   c4 
505 @end lilypond
506
507 The @code{\override} must be done before the object is
508 started. Therefore, when altering @emph{Spanner} objects, like slurs or
509 beams, the @code{\override} command must be executed at the moment when
510 the object is created. In this example,
511
512
513 @lilypond[fragment,verbatim,relative=2]
514   \override Slur #'thickness = #3.0
515   c8[( c
516   \override Beam #'thickness = #0.6
517   c8 c]) 
518 @end lilypond
519
520 @noindent
521 the slur is fatter but the beam is not. This is because the command for
522 @code{Beam} comes after the Beam is started. Therefore it has no effect.
523
524 Analogous to @code{\unset}, the @code{\revert} command for a context
525 undoes a @code{\override} command; like with @code{\unset}, it only
526 affects settings that were made in the same context. In other words, the
527 @code{\revert} in the next example does not do anything.
528
529 @verbatim
530   \override Voice.Stem #'thickness = #4.0
531   \revert Staff.Stem #'thickness
532 @end verbatim
533
534
535
536
537 @seealso
538
539 Internals: @internalsref{OverrideProperty}, @internalsref{RevertProperty},
540 @internalsref{PropertySet}, @internalsref{All-backend-properties}, and
541 @internalsref{All-layout-objects}.
542
543
544 @refbugs
545
546 The back-end is not very strict in type-checking object properties.
547 Cyclic references in Scheme values for properties can cause hangs
548 or crashes, or both.
549
550
551 @node Changing context default settings
552 @subsection Changing context default settings
553
554 The adjustments of the previous subsections (@ref{Changing context
555 properties on the fly}, @ref{Modifying context plug-ins} and
556 @ref{Layout tunings within contexts}) can also be entered separate
557 from the music, in the @code{\paper} block,
558
559 @example
560 \paper @{
561   @dots{}
562   \context @{
563     \Staff
564
565     \set fontSize = #-2
566     \override Stem #'thickness
567     \remove "Time_signature_engraver"
568   @}
569 @}
570 @end example
571
572 Here
573 @example
574   \Staff
575 @end example
576
577 @noindent
578 takes the existing definition for context @context{Staff} from the
579 identifier @code{\Staff}. 
580
581 The statements
582 @example
583     \set fontSize = #-2
584     \override Stem #'thickness
585     \remove "Time_signature_engraver"
586 @end example
587
588 @noindent
589 affect all staves in the score.
590
591 Other contexts can be modified analogously.
592
593 The @code{\set} keyword is optional within the @code{\paper} block, so
594
595 @example
596 \context @{
597   @dots{}
598   fontSize = #-2
599 @}
600 @end example
601
602 @noindent
603 will also work.
604
605
606
607 @refbugs
608
609 It is not possible to collect context changes in a variable, and apply
610 them to one @code{\context} definition by referring to that variable.
611
612
613 @node Defining new  contexts
614 @subsection Defining new  contexts
615
616 Specific contexts, like @context{Staff} and @code{Voice}, are made of
617 simple building blocks, and it is possible to compose engraver
618 plug-ins in different combinations, thereby creating new types of
619 contexts.
620
621 The next example shows how to build a different type of
622 @context{Voice} context from scratch.  It will be similar to
623 @code{Voice}, but print centered slash noteheads only. It can be used
624 to indicate improvisation in Jazz pieces,
625
626 @lilypond[raggedright]
627   \paper { \context {
628     \name ImproVoice
629     \type "Engraver_group_engraver"
630     \consists "Note_heads_engraver"
631     \consists "Text_engraver"
632     \consists Pitch_squash_engraver
633     squashedPosition = #0
634     \override NoteHead #'style = #'slash
635     \override Stem #'transparent = ##t
636     \alias Voice
637   }
638   \context { \Staff
639     \accepts "ImproVoice"
640   }}
641
642
643 \relative c'' {
644     a4 d8 bes8 \new ImproVoice { c4^"ad lib" c 
645      c4 c^"undress" c_"while playing :)" c } 
646     a1 
647 }
648 @end lilypond
649
650
651 These settings are again done within a @code{\context} block inside a
652 @code{\paper} block,
653
654 @example
655   \paper @{
656     \context @{
657       @dots{}
658     @}
659   @}
660 @end example
661
662 In the following discussion, the example input shown should go on the
663 @dots{} in the previous fragment.
664
665 First, name the context gets a name. Instead of @context{Voice} it
666 will be called @context{ImproVoice},
667
668 @verbatim
669   \name ImproVoice
670 @end verbatim
671
672 Since it is similar to the @context{Voice}, we want commands that work
673 on (existing) @context{Voice}s to remain working. This is achieved by
674 giving the new context an alias @context{Voice},
675
676 @verbatim
677   \alias Voice
678 @end verbatim
679
680 The context will print notes, and instructive texts
681
682 @verbatim
683   \consists Note_heads_engraver
684   \consists Text_engraver
685 @end verbatim
686
687 but only on the center line,
688
689 @verbatim
690   \consists Pitch_squash_engraver
691   squashedPosition = #0
692 @end verbatim
693
694 The @internalsref{Pitch_squash_engraver} modifies note heads (created
695 by @internalsref{Note_heads_engraver}) and sets their vertical
696 position to the value of @code{squashedPosition}, in this case
697 @code{0}, the center line.
698
699 The notes look like a  slash, without a stem,
700
701 @verbatim
702     \override NoteHead #'style = #'slash
703     \override Stem #'transparent = ##t
704 @end verbatim
705
706
707 All these plug-ins have to cooperate, and this is achieved with a
708 special plug-in, which must be marked with the keyword @code{\type}.
709 This should always be @internalsref{Engraver_group_engraver},
710
711 @example
712  \type "Engraver_group_engraver"
713 @end example
714
715 Putting together, we get
716
717 @verbatim
718   \context {
719     \name ImproVoice
720     \type "Engraver_group_engraver"
721     \consists "Note_heads_engraver"
722     \consists "Text_engraver"
723     \consists Pitch_squash_engraver
724     squashedPosition = #0
725     \override NoteHead #'style = #'slash
726     \override Stem #'transparent = ##t
727     \alias Voice
728   }
729 @end verbatim
730
731 Contexts form hierarchies. We want to hang the @context{ImproVoice}
732 under @context{Staff}, just like normal @code{Voice}s. Therefore, we
733 modify the @code{Staff} definition with the @code{\accepts}
734 command,@footnote{The opposite of @code{\accepts} is @code{\denies},
735 which is sometimes when reusing existing context definitions. }
736
737
738
739 @verbatim
740   \context {
741     \Staff
742     \accepts ImproVoice    
743   }
744 @end verbatim 
745
746 Putting both into a @code{\paper} block, like
747
748 @example
749   \paper @{
750     \context @{
751       \name ImproVoice
752       @dots{}
753     @}
754   \context @{
755     \Staff
756     \accepts "ImproVoice"
757   @}
758 @}
759 @end example
760
761 Then the output at the start of this subsection can be entered as
762
763 @verbatim
764 \relative c'' {
765      a4 d8 bes8
766      \new ImproVoice {
767        c4^"ad lib" c 
768        c4 c^"undress"
769        c c_"while playing :)"
770      }
771      a1
772 }
773 @end verbatim
774   
775
776     
777
778 @node The \override command
779 @section The \override command
780
781 In the previous section, we have already touched on a command that
782 changes layout details, the @code{\override} command. In this section,
783 we will look at in more detail how to use the command in practice.
784 First, we will give a a few versatile commands, which are sufficient
785 for many situations. The next section will discuss general use of
786 @code{\override}.
787
788
789 @menu
790 * Common tweaks::               
791 * Constructing a tweak::        
792 * Navigating the program reference::  
793 * Layout interfaces::           
794 * Determining the grob property::  
795 * Difficult tweaks::            
796 @end menu
797
798
799
800 @node Common tweaks
801 @subsection Common tweaks
802
803 Some overrides are so common that predefined commands are provided as
804 a short-cut, for example, @code{\slurUp} and @code{\stemDown}. These
805 commands are described in
806 @ifhtml
807 the
808 @end ifhtml
809 @ref{Notation manual}, under the sections for slurs and stems
810 respectively.
811
812 The exact tuning possibilities for each type of layout object are
813 documented in the program reference of the respective
814 object. However, many layout objects share properties, which can be
815 used to apply generic tweaks.  We mention a few of these:
816
817 @itemize @bullet
818 @item The @code{extra-offset} property, which
819 @cindex @code{extra-offset}
820 has a pair of numbers as value, moves around objects in the printout.
821 The first number controls left-right movement; a positive number will
822 move the object to the right.  The second number controls up-down
823 movement; a positive number will move it higher.  The units of these
824 offsets are staff-spaces.  The @code{extra-offset} property is a
825 low-level feature: the formatting engine is completely oblivious to
826 these offsets.
827
828 In the following example, the second fingering is moved a little to
829 the left, and 1.8 staff space downwards:
830
831 @cindex setting object properties
832
833 @lilypond[fragment,relative=1,verbatim]
834 \stemUp
835 f-5
836 \once \override Fingering
837     #'extra-offset = #'(-0.3 . -1.8) 
838 f-5
839 @end lilypond
840
841 @item
842 Setting the @code{transparent} property will cause an object to be printed
843 in `invisible ink': the object is not printed, but all its other
844 behavior is retained. The object still takes up space, it takes part in
845 collisions, and slurs, and ties and beams can be attached to it.
846
847 @cindex transparent objects
848 @cindex removing objects
849 @cindex hiding objects
850 @cindex invisible objects
851 The following example demonstrates how to connect different voices
852 using ties. Normally, ties only connect two notes in the same
853 voice. By introducing a tie in a different voice,
854
855 @lilypond[fragment,relative=2]
856   << {
857       b8~ b8\noBeam
858   } \\ {
859        b[ g8]
860   } >>
861 @end lilypond
862
863 @noindent
864 and blanking the first up-stem in that voice, the tie appears to cross
865 voices:
866
867 @lilypond[fragment,relative=2,verbatim]
868   << {
869       \once \override Stem #'transparent = ##t
870       b8~ b8\noBeam
871   } \\ {
872        b[ g8]
873   } >>
874 @end lilypond
875
876 @item
877 The @code{padding} property for objects with
878 @cindex @code{padding}
879 @code{side-position-interface} can be set to increase distance between
880 symbols that are printed above or below notes. We only give an
881 example; a more elaborate explanation is in @ref{Constructing a
882 tweak}:
883
884 @lilypond[fragment,relative=1,verbatim]
885   c2\fermata
886   \override Script #'padding = #3
887   b2\fermata
888 @end lilypond
889
890 @end itemize
891
892 More specific overrides are also possible.  The next section
893 discusses in depth how to figure out these statements for yourself.
894
895
896 @node Constructing a tweak
897 @subsection Constructing a tweak
898
899 The general procedure of changing output, that is, entering
900 a command like
901
902 @example
903         \override Voice.Stem #'thickness = #3.0
904 @end example
905
906 @noindent
907 means that we have to determine these bits of information:
908
909 @itemize
910 @item the context: here @context{Voice}.
911 @item the layout object: here @code{Stem}.
912 @item the layout property: here @code{thickness}
913 @item a sensible value: here @code{3.0}
914 @end itemize  
915
916
917 @cindex internal documentation
918 @cindex finding graphical objects
919 @cindex graphical object descriptions 
920 @cindex tweaking
921 @cindex @code{\override}
922 @cindex @code{\set}
923 @cindex internal documentation
924
925 We demonstrate how to glean this information from the notation manual
926 and the program reference.
927
928 @node Navigating the program reference
929 @subsection Navigating the program reference
930
931 Suppose we want to move the fingering indication in the fragment
932 below:
933
934 @lilypond[fragment,relative=2,verbatim]
935 c-2
936 \stemUp
937 f
938 @end lilypond
939
940 If you visit the documentation on fingering instructions (in
941 @ref{Fingering instructions}), you will notice that there is written:
942
943 @quotation
944 @seealso
945
946 Program reference: @internalsref{FingerEvent} and @internalsref{Fingering}.
947
948 @end quotation
949
950
951
952 This fragment points to two parts of the program reference: a page
953 on @code{FingerEvent} and on @code{Fingering}.
954
955 The page on  @code{FingerEvent} describes the properties of the  music
956 expression for the input @code{-2}. The page contains many links
957 forward.  For example, it says
958
959 @quotation
960   Accepted by: @internalsref{Fingering_engraver},
961 @end quotation 
962
963 @noindent
964 That link brings us to the documentation for the Engraver, the
965 plug-in, which says
966
967 @quotation
968   This engraver creates the following layout objects: @internalsref{Fingering}.
969 @end quotation
970
971 In other words, once the @code{FingerEvent}s are interpreted, the
972 @code{Fingering_engraver} plug-in will process them.
973 The @code{Fingering_engraver} is also listed to create
974 @internalsref{Fingering} objects,
975
976
977   Lo and behold, that is also the
978 second bit of information listed under @b{See also} in the Notation
979 manual. By clicking around in the program reference, we can follow the
980 flow of information within the program, either forward (like we did
981 here), or backwards, following links like this:
982
983 @itemize @bullet
984
985 @item @internalsref{Fingering}:
986   @internalsref{Fingering} objects are created by:
987   @b{@internalsref{Fingering_engraver}}
988
989 @item @internalsref{Fingering_engraver}:
990 Music types accepted: @b{@internalsref{fingering-event}}
991 @item @internalsref{fingering-event}:
992 Music event type @code{fingering-event} is in Music expressions named
993 @b{@internalsref{FingerEvent}}
994 @end itemize
995
996 This path goes against the flow of information in the program: it
997 starts from the output, and ends at the input event.
998
999 The program reference can also be browsed like a normal document.  It
1000 contains a chapter on
1001 @ifhtml
1002 @internalsref{Music-definitions},
1003 @end ifhtml
1004 @ifnothtml
1005 @code{Music definitions}
1006 @end ifnothtml
1007 on @internalsref{Translation}, and the @internalsref{Backend}. Every
1008 chapter lists all the definitions used, and all properties that may be
1009 tuned.
1010
1011  
1012 @node Layout interfaces
1013 @subsection Layout interfaces
1014
1015 @cindex interface, layout
1016 @cindex layout interface
1017
1018 The HTML page which we found in the previous section, describes the
1019 layout object called @internalsref{Fingering}. Such an object is a
1020 symbol within the score. It has properties, which store numbers (like
1021 thicknesses and directions), but also pointers to related objects.  A
1022 layout object is also called @emph{grob},
1023 @cindex grob
1024 which is short for Graphical Object.
1025
1026
1027 The page for @code{Fingering} lists the definitions for the
1028 @code{Fingering} object. For example, the page says
1029
1030 @quotation
1031   @code{padding} (dimension, in staff space):
1032   
1033   @code{0.6}
1034 @end quotation
1035
1036 which means that the number will be kept at a distance of at least 0.6
1037 of the note head.
1038
1039
1040 Each layout object may have several functions as a notational or
1041 typographical element. For example, the Fingering object
1042 has the following aspects
1043
1044 @itemize @bullet
1045 @item Its size is independent of the horizontal spacing, unlike slurs or beams.
1046
1047 @item It is a piece of text. Granted, it is usually a very short text.
1048
1049 @item That piece of text is typeset with a font, unlike slurs or beams.
1050 @item Horizontally, the center of the symbol should be aligned to the
1051 center of the notehead
1052 @item Vertically, the symbol is placed next to the note and the staff.
1053
1054 @item The
1055  vertical position is also coordinated with other super and subscript
1056 symbols.
1057 @end itemize
1058
1059 Each of these aspects is captured in a so-called @emph{interface},
1060 which are listed on the @internalsref{Fingering} page at the bottom
1061
1062 @quotation
1063 This object supports the following interfaces:
1064 @internalsref{item-interface},
1065 @internalsref{self-alignment-interface},
1066 @internalsref{side-position-interface}, @internalsref{text-interface},
1067 @internalsref{text-script-interface}, @internalsref{font-interface},
1068 @internalsref{finger-interface}, and @internalsref{grob-interface}.
1069 @end quotation
1070
1071 Clicking any of the links will take you to the page of the respective
1072 object interface.  Each interface has a number of properties.  Some of
1073 them are not user-serviceable (``Internal properties''), but others
1074 are.
1075
1076 We have been talking of `the' @code{Fingering} object, but actually it
1077 does not amount to much. The initialization file
1078 @file{scm/define-grobs.scm} shows the soul of the `object',
1079
1080 @verbatim
1081    (Fingering
1082      . (
1083         (print-function . ,Text_item::print)
1084         (padding . 0.6)
1085         (staff-padding . 0.6)
1086         (self-alignment-X . 0)
1087         (self-alignment-Y . 0)
1088         (script-priority . 100)
1089         (font-encoding . number)
1090         (font-size . -5)
1091         (meta . ((interfaces . (finger-interface font-interface
1092                text-script-interface text-interface
1093                side-position-interface self-alignment-interface
1094                item-interface))))
1095   ))
1096 @end verbatim
1097
1098 @noindent
1099 As you can see, the @code{Fingering} object is nothing more than a
1100 bunch of variable settings, and the webpage in the Program Reference
1101 is directly generated from this definition.
1102
1103 @node Determining the grob property
1104 @subsection Determining the grob property
1105
1106
1107 Recall that we wanted to change the position of the @b{2} in 
1108
1109 @lilypond[fragment,relative=2,verbatim]
1110 c-2
1111 \stemUp
1112 f
1113 @end lilypond
1114
1115 Since the @b{2} is vertically positioned next to its note, we have to
1116 meddle with the interface associated with this positioning. This is
1117 done using @code{side-position-interface}. The page for this interface 
1118 says
1119
1120 @quotation
1121 @code{side-position-interface}
1122
1123   Position a victim object (this one) next to other objects (the
1124   support).  The property @code{direction} signifies where to put the
1125   victim object relative to the support (left or right, up or down?)
1126 @end quotation
1127
1128 @cindex padding
1129 @noindent
1130 below this description, the variable @code{padding} is described as
1131 @quotation
1132 @table @code
1133 @item padding
1134  (dimension, in staff space)
1135
1136  Add this much extra space between objects that are next to each
1137   other. 
1138 @end table
1139 @end quotation
1140
1141 By increasing the value of @code{padding}, we can move away the
1142 fingering.  The following command inserts 3 staff spaces of white
1143 between the note and the fingering:
1144 @example
1145 \once \override Voice.Fingering #'padding = #3
1146 @end example
1147
1148 Inserting this command before the Fingering object is created,
1149 i.e. before @code{c2}, yields the following result:
1150
1151 @lilypond[relative=2,fragment,verbatim]
1152 \once \override Voice.Fingering #'padding = #3
1153 c-2
1154 \stemUp
1155 f
1156 @end lilypond
1157
1158
1159 In this case, the context for this tweak is @context{Voice}.  This
1160 fact can also be deduced from the program reference, for the page for
1161 the @internalsref{Fingering_engraver} plug-in says
1162
1163 @quotation
1164   Fingering_engraver is part of contexts: @dots{} @b{@internalsref{Voice}}
1165 @end quotation
1166
1167 @node Difficult tweaks
1168 @subsection Difficult tweaks
1169
1170 There are two classes of difficult adjustments. First, when there are
1171 several of the same objects at one point, and you want to adjust only
1172 one. For example, if you want to change only one note head in a chord.
1173
1174 In this case, the @code{\applyoutput} function must be used.  The
1175 next example defines a Scheme function @code{set-position-font-size}
1176 that sets the @code{font-size} property, but only  
1177 on objects that have @internalsref{note-head-interface} and are at the
1178 right Y-position.
1179
1180 @lilypond[verbatim]
1181 #(define ((set-position-font-size pos size) grob origin current)
1182   (let*
1183       ((interfaces (ly:grob-property grob 'interfaces))
1184        (position (ly:grob-property grob 'staff-position)))
1185   (if (and
1186   
1187         ; is this a note head?
1188         (memq 'note-head-interface interfaces)
1189
1190         ; is the Y coordinate right?
1191         (= pos position))
1192
1193       ; then do it.
1194       (set! (ly:grob-property grob 'font-size) size))))
1195
1196 \relative {
1197     c
1198     \applyoutput #(set-position-font-size -2 4)
1199     <c e g>
1200 }
1201 @end lilypond
1202
1203 @noindent
1204 A similar technique can be used for accidentals. In that case, the
1205 function should check for @code{accidental-interface}.
1206
1207 Another difficult adjustment is the appearance of spanner objects,
1208 such as slur and tie. Initially, only one of these objects is created,
1209 and they can be adjust with the normal mechanism. However, in some
1210 cases the spanners cross line breaks. If this happens, these objects
1211 are cloned.  A separate object is created for every system that it is
1212 in. These are clones of the original object and inherit all
1213 properties, including @code{\override}s.
1214
1215 In other words, an @code{\override} always affects all pieces of a
1216 broken spanner. To change only one part of a spanner at a line break,
1217 it is necessary to hook into the formatting process. The
1218 @code{after-line-breaking-callback} property contains the Scheme procedure
1219 that is called after line breaks have been determined, and layout
1220 objects have been split over different systems.
1221
1222 In the following example, we define a procedure
1223 @code{my-callback}. This procedure
1224  
1225 @itemize @bullet
1226 @item
1227 determines if we have been split across line breaks
1228 @item
1229 if yes, retrieves all the split objects
1230 @item
1231 checks if we are the last of the split objects
1232 @item
1233 if yes, it sets @code{extra-offset}.
1234 @end itemize
1235
1236 This procedure is installed into @internalsref{Tie}, so the last part
1237 of broken tie is translated up.
1238
1239
1240 @lilypond[verbatim,raggedright]
1241 #(define (my-callback grob)
1242   (let* (
1243
1244       ; have we been split? 
1245       (orig (ly:grob-original grob))
1246
1247       ; if yes, get the split pieces (our siblings)
1248       (siblings (if (ly:grob? orig) (ly:spanner-broken-into orig) '() )))
1249
1250       
1251     (if (and (>= (length siblings) 2)
1252              (eq? (car (last-pair siblings)) grob))
1253         (ly:grob-set-property! grob 'extra-offset '(-2 . 5))
1254         )))
1255
1256 \relative c'' { 
1257     \override Tie  #'after-line-breaking-callback =
1258     #my-callback
1259     c1 ~ \break c2 ~ c
1260 }
1261 @end lilypond
1262
1263
1264 When applying this trick, the new @code{after-line-breaking-callback}
1265 should also call the old @code{after-line-breaking-callback}, if there
1266 is one. For example, if using this with @code{Slur},
1267 @code{Slur::after_line_breaking} should also be called.
1268
1269 @node Fonts
1270 @section Fonts
1271
1272 @menu
1273 * Selecting font sizes::        
1274 * Font selection::              
1275 @end menu
1276
1277
1278
1279 @node Selecting font sizes
1280 @subsection Selecting font sizes
1281
1282
1283 The easiest method of setting the font size of any context, is by
1284 setting the @code{fontSize} property.
1285
1286 @lilypond[fragment,relative=1,verbatim]
1287   c8
1288   \set fontSize = #-4
1289   c f
1290   \set fontSize = #3
1291   g
1292 @end lilypond
1293
1294 It does not change the size of variable symbols, such as beams or
1295 slurs.
1296
1297 Internally, the @code{fontSize} context property will cause
1298 @code{font-size} property to be set in all layout objects.  The value
1299 of @code{font-size} is a number indicating the size relative to the
1300 standard size for the current staff height.  Each step up is an
1301 increase of approximately 12% of the font size. Six steps is exactly a
1302 factor two. The Scheme function @code{magstep} converts a
1303 @code{font-size} number to a scaling factor.
1304
1305 @lilypond[fragment,relative=1,verbatim]
1306   c8
1307   \override NoteHead #'font-size = #-4
1308   c f
1309   \override NoteHead #'font-size = #3
1310   g
1311 @end lilypond
1312
1313 LilyPond has fonts in different design sizes. The music fonts for
1314 smaller sizes are chubbier, while the text fonts are relatively wider.
1315 Font size changes are achieved by scaling the design size that is
1316 closest to the desired size. The standard font size (for
1317 @code{font-size} equals 0), depends on the standard staff height. For
1318 a 20 pt staff, a 10pt font is selected.
1319
1320 The @code{font-size} mechanism does not work for fonts selected
1321 through @code{font-name}. These may be scaled with
1322 @code{font-magnification}. The @code{font-size} property can only be
1323 set on layout objects that use fonts; these are the ones supporting
1324 @internalsref{font-interface} layout interface.
1325
1326 @refcommands
1327
1328 The following commands set @code{fontSize} for the current voice:
1329
1330 @cindex @code{\tiny}
1331 @code{\tiny}, 
1332 @cindex @code{\small}
1333 @code{\small}, 
1334 @cindex @code{\normalsize}
1335 @code{\normalsize}.
1336
1337
1338
1339 @cindex magnification
1340 @cindex cue notes
1341
1342
1343 @node Font selection
1344 @subsection Font selection
1345
1346
1347
1348 @cindex font selection
1349 @cindex font magnification
1350 @cindex @code{font-interface}
1351
1352 By setting the object properties described below, you can select a
1353 font from the preconfigured font families.  LilyPond has default
1354 support for the feta music fonts and @TeX{}'s Computer Modern text
1355 fonts.
1356
1357
1358 @itemize @bullet
1359 @item @code{font-encoding}
1360 is a symbol that sets layout of the glyphs. Choices include @code{ec}
1361 for @TeX{} EC font encoding, @code{fetaBraces} (for piano staff
1362 braces), @code{fetaMusic} (the standard music font, including ancient
1363 glyphs), @code{fetaDynamic} (for dynamic signs) and @code{fetaNumber}
1364 for the number font.
1365
1366
1367 @item @code{font-family}
1368  is a symbol indicating the general class of the typeface.  Supported are
1369 @code{roman} (Computer Modern), @code{sans}, and @code{typewriter}.
1370   
1371 @item @code{font-shape}
1372   is a symbol indicating the shape of the font, there are typically
1373 several font shapes available for each font family. Choices are
1374 @code{italic}, @code{caps}, and @code{upright}.
1375
1376 @item @code{font-series}
1377 is a  symbol indicating the series of the font. There are typically several
1378 font series for each font family and shape. Choices are @code{medium}
1379 and @code{bold}. 
1380
1381 @end itemize
1382
1383 Fonts selected in the way sketched above come from a predefined style
1384 sheet.
1385
1386  The font used for printing a object can be selected by setting
1387 @code{font-name}, e.g.
1388 @example
1389   \override Staff.TimeSignature
1390       #'font-name = #"cmr17"
1391 @end example
1392
1393 @noindent
1394 Any font can be used, as long as it is available to @TeX{}. Possible
1395 fonts include foreign fonts or fonts that do not belong to the
1396 Computer Modern font family.  The size of fonts selected in this way
1397 can be changed with the @code{font-magnification} property.  For
1398 example, @code{2.0} blows up all letters by a factor 2 in both
1399 directions.
1400
1401 @cindex font size
1402 @cindex font magnification
1403
1404
1405
1406 @seealso
1407
1408 Init files: @file{ly/declarations-init.ly} contains hints how new
1409 fonts may be added to LilyPond.
1410
1411
1412
1413 @node Text markup
1414 @section Text markup
1415 @cindex text markup
1416 @cindex markup text
1417
1418
1419 @cindex typeset text
1420
1421 The internal mechanism to typeset texts is accessed with the keyword
1422 @code{\markup}. Within markup mode, you can enter texts similar to
1423 lyrics. They are simply entered, while commands use the backslash @code{\}.
1424 @cindex markup
1425
1426 @lilypond[verbatim,fragment,relative=1]
1427  c1^\markup { hello }
1428  c1_\markup { hi there }
1429  c1^\markup { hi \bold there, is \italic anyone home? }
1430 @end lilypond
1431
1432 @cindex font switching
1433
1434 The markup in the example demonstrates font switching commands.  The
1435 command @code{\bold} and @code{\italic} apply to the first following 
1436 word only; enclose a set of texts with braces to apply a command
1437 to more words:
1438 @example
1439   \markup @{ \bold @{ hi there @} @}
1440 @end example
1441
1442 @noindent
1443 For clarity, you can also do this for single arguments, e.g.
1444
1445 @verbatim
1446   \markup { is \italic { anyone } home }
1447 @end verbatim
1448
1449 @cindex font size, texts
1450
1451
1452 In markup mode you can compose expressions, similar to mathematical
1453 expressions, XML documents, and music expressions.  The braces group
1454 notes into horizontal lines. Other types of lists also exist: you can
1455 stack expressions grouped with @code{<} and @code{>} vertically with
1456 the command @code{\column}. Similarly, @code{\center-align} aligns
1457 texts by their center lines:
1458
1459 @lilypond[verbatim,fragment,relative=1]
1460  c1^\markup { \column < a bbbb c > }
1461  c1^\markup { \center-align < a bbbb c > }
1462  c1^\markup { \line < a b c > }
1463 @end lilypond
1464
1465
1466 Markups can be stored in variables, and these variables
1467 may be attached to notes, like
1468 @verbatim
1469 allegro = \markup { \bold \large { Allegro } }
1470  { a^\allegro b c d }
1471 @end verbatim
1472
1473
1474 Some objects have alignment procedures of their own, which cancel out
1475 any effects of alignments applied to their markup arguments as a
1476 whole.  For example, the @internalsref{RehearsalMark} is horizontally
1477 centered, so using @code{\mark \markup @{ \left-align .. @}} has no
1478 effect.
1479
1480 Similarly, for moving whole texts over notes with
1481 @code{\raise}, use the following trick:
1482 @lilypond[verbatim]
1483 {
1484   c'^\markup { \raise #0.5 not-raised }
1485   c'^\markup {  "" \raise #0.5 raised }
1486 }
1487 @end lilypond
1488
1489 On the second note, the text @code{raised} is moved relative to the
1490 empty string @code{""} which is not visible.  Alternatively, complete
1491 objects can be moved with layout properties such as @code{padding} and
1492 @code{extra-offset}.
1493
1494
1495
1496
1497 @seealso
1498
1499 Init files:  @file{scm/new-markup.scm}.
1500
1501
1502 @refbugs
1503
1504 No kerning or generation of ligatures is only done when the by @TeX{}
1505 backend is used.  In this case, LilyPond does not account for them so
1506 texts will be spaced slightly too wide.
1507
1508 Syntax errors for markup mode are confusing.
1509
1510
1511 @menu
1512 * Text encoding::               
1513 * Nested scores::               
1514 * Overview of text markup commands::  
1515 @end menu
1516
1517 @node Text encoding
1518 @subsection Text encoding
1519
1520 Texts can be entered in different encodings.  The encoding of the
1521 file can be set with @code{\encoding}.
1522
1523 @example
1524   \encoding "latin1"
1525 @end example
1526
1527 This command may be placed anywhere in the input file. The current
1528 encoding is passed as an extra argument to @code{\markup} commands,
1529 and is passed similarly to lyric syllables.
1530
1531 If no @code{\encoding} has been specified, then the encoding is taken
1532 from the @code{\paper} block (or @code{\bookpaper}, if @code{\paper}
1533 does not specify encoding). The variable @code{inputencoding} may be
1534 set to a string or symbol specifying  the encoding, e.g.
1535
1536 @verbatim
1537   \paper {
1538     inputencoding = "latin1"
1539   } 
1540 @end verbatim
1541
1542 Normal strings, are unaffected by @code{\encoding}. This means that
1543 the following will usually not produce ba@ss{}tuba in the title.
1544
1545 @verbatim
1546   \header {
1547     title = "Grazing cow"
1548     instrument = "Baßtuba"
1549   }
1550 @end verbatim
1551
1552 Rather, you should say
1553 @verbatim
1554     instrument = \markup { Baßtuba }
1555 @end verbatim
1556
1557 @noindent
1558 or set @code{inputencoding} in the @code{\bookpaper} block. 
1559
1560 There is a special encoding, called @code{TeX}. This encoding does not
1561 reencode text for the font used. Rather, it tries to guess the width
1562 of @TeX{} commands, such as @code{\"}. Strings encoded with @code{TeX}
1563 are passed to the output back-end verbatim.
1564
1565 @cindex encoding
1566 @cindex @code{\encoding}
1567 @cindex inputencoding
1568 @cindex @TeX{} commands in strings
1569
1570
1571 @node Nested scores
1572 @subsection Nested scores
1573
1574 It is possible to nest music inside markups, by adding a @code{\score}
1575 block to markup expression. Such a score must contain a @code{\paper}
1576 block.
1577
1578 @lilypond[verbatim,raggedright]
1579 \relative {
1580   c4  d^\markup {
1581     \score {
1582       \relative { c4 d e f }
1583       \paper { }
1584     }
1585   }
1586   e f
1587 }
1588 @end lilypond
1589  
1590
1591
1592 @node  Overview of text markup commands
1593 @subsection Overview of text markup commands
1594
1595 The following commands can all be used inside @code{\markup @{ @}}.
1596
1597 @include markup-commands.tely
1598
1599
1600 @node Global layout
1601 @section Global layout
1602
1603 The global layout determined by three factors: the page layout, the
1604 line breaks, and the spacing. These all influence each other. The
1605 choice of spacing determines how densely each system of music is set,
1606 which influences where line breaks are chosen, and thus ultimately how
1607 many pages a piece of music takes.
1608
1609 Globally spoken, this procedure happens in three steps: first,
1610 flexible distances (``springs'') are chosen, based on durations. All
1611 possible line breaking combination are tried, and the one with the
1612 best results --- a layout that has uniform density and requires as
1613 little stretching or cramping as possible --- is chosen.
1614
1615 After spacing and linebreaking, the systems are distributed across
1616 pages, taking into account the size of the page, and the size of the
1617 titles.
1618
1619
1620
1621 @menu
1622 * Setting global staff size::   
1623 * Vertical spacing of piano staves::  
1624 * Vertical spacing::            
1625 * Horizontal spacing::          
1626 * Line length::                 
1627 * Line breaking::               
1628 * Multiple movements::          
1629 * Creating titles::             
1630 * Page breaking::               
1631 * Paper size::                  
1632 * Page layout::                 
1633 @end menu
1634
1635
1636 @node Setting global staff size
1637 @subsection Setting global staff size
1638
1639 @cindex font size, setting
1640 @cindex staff size, setting
1641 @cindex @code{paper} file
1642
1643 The Feta font provides musical symbols at eight  different
1644 sizes. Each font is tuned for a different staff size: at a smaller size
1645 the font becomes heavier, to match the relatively heavier staff lines.
1646 The recommended font sizes are listed in the following table:
1647
1648 @multitable @columnfractions  .25 .25 .25 .25
1649
1650 @item @b{font name}
1651 @tab @b{staff height (pt)}
1652 @tab @b{staff height (mm)}
1653 @tab @b{use}
1654
1655 @item feta11
1656 @tab 11.22
1657 @tab 3.9 
1658 @tab pocket scores
1659
1660 @item feta13
1661 @tab 12.60
1662 @tab 4.4
1663 @tab
1664  
1665 @item feta14
1666 @tab 14.14
1667 @tab 5.0
1668 @tab 
1669
1670 @item feta16
1671 @tab 15.87
1672 @tab 5.6
1673 @tab 
1674
1675 @item feta18
1676 @tab 17.82
1677 @tab 6.3
1678 @tab song books
1679
1680 @item feta20
1681 @tab 20
1682 @tab 7.0
1683 @tab standard parts 
1684
1685 @item feta23
1686 @tab 22.45 
1687 @tab 7.9
1688 @tab 
1689
1690 @item feta26
1691 @tab 25.2 
1692 @tab 8.9
1693 @tab
1694 @c modern rental material  ?
1695
1696 @end multitable
1697
1698 These fonts are available in any sizes. The context property
1699 @code{fontSize} and the layout property @code{staff-space} (in
1700 @internalsref{StaffSymbol}) can be used to tune size for individual
1701 staves. The size of individual staves are relative to the global size,
1702 which can be set   in the following manner:
1703
1704 @example
1705   #(set-global-staff-size 14)
1706 @end example
1707
1708 This sets the global default size to 14pt staff height, and scales all
1709 fonts accordingly.
1710
1711 @seealso
1712
1713 This manual: @ref{Selecting font sizes}.
1714
1715
1716
1717
1718 @node Vertical spacing of piano staves
1719 @subsection Vertical spacing of piano staves
1720
1721 The distance between staves of a @internalsref{PianoStaff} cannot be
1722 computed during formatting. Rather, to make cross-staff beaming work
1723 correctly, that distance has to be fixed beforehand.
1724  
1725 The distance of staves in a @code{PianoStaff} is set with the
1726 @code{forced-distance} property of the
1727 @internalsref{VerticalAlignment} object, created in
1728 @internalsref{PianoStaff}.
1729
1730 It can be adjusted as follows
1731 @verbatim
1732 \new PianoStaff \with {
1733    \override VerticalAlignment #'forced-distance = #7
1734 } {
1735   ...
1736 }
1737 @end verbatim
1738 This would bring the staves together at a distance of 7 staff spaces,
1739 measured from the center line of each staff.
1740
1741 The difference is demonstrated in the following example,
1742 @lilypond[verbatim]
1743 \relative <<
1744   \new PianoStaff \with {
1745     \override VerticalAlignment #'forced-distance = #7
1746   } <<
1747     \new Staff { c1 }
1748     \new Staff { c }
1749   >>
1750   \new PianoStaff <<
1751     \new Staff { c }
1752     \new Staff { c }
1753   >>
1754 >>    
1755 @end lilypond
1756
1757
1758
1759 @refbugs
1760
1761 @code{forced-distance} cannot be changed per system.
1762
1763 @node Vertical spacing
1764 @subsection Vertical spacing
1765
1766 @cindex vertical spacing
1767 @cindex distance between staves
1768 @cindex staff distance
1769 @cindex between staves, distance
1770 @cindex staves per page
1771 @cindex space between staves
1772
1773 The height of each system is determined automatically. To prevent
1774 systems from bumping into each other, some minimum distances are set.
1775 By changing these, you can put staves closer together, and thus put
1776 more systems onto one page.
1777
1778 Normally staves are stacked vertically. To make staves maintain a
1779 distance, their vertical size is padded. This is done with the
1780 property @code{minimumVerticalExtent}. It takes a pair of numbers, so
1781 if you want to make it smaller from its default, then you could set
1782 @example
1783   \set Staff.minimumVerticalExtent = #'(-4 . 4)
1784 @end example
1785 This sets the vertical size of the current staff to 4 staff spaces on
1786 either side of the center staff line.  The argument of
1787 @code{minimumVerticalExtent} is interpreted as an interval, where the
1788 center line is the 0, so the first number is generally negative.  The
1789 staff can be made larger at the bottom by setting it to @code{(-6
1790 . 4)}. 
1791
1792
1793 @seealso
1794
1795 Internals: Vertical alignment of staves is handled by the
1796 @internalsref{VerticalAlignment} object.
1797
1798 @refbugs
1799
1800 @code{minimumVerticalExtent} is syntactic sugar for setting
1801 @code{minimum-Y-extent} of the @internalsref{VerticalAxisGroup} of the
1802 current context. It can only be changed score wide.
1803
1804
1805
1806 @node Horizontal spacing
1807 @subsection Horizontal Spacing
1808
1809 The spacing engine translates differences in durations into
1810 stretchable distances (``springs'') of differring lengths. Longer
1811 durations get more space, shorter durations get less.  The shortest
1812 durations get a fixed amount of space (which is controlled by
1813 @code{shortest-duration-space} in the @internalsref{SpacingSpanner} object). 
1814 The longer the duration, the more space it gets: doubling a
1815 duration adds a fixed amount (this amount is controlled by
1816 @code{spacing-increment}) of space to the note.
1817
1818 For example, the following piece contains lots of half, quarter, and
1819 8th notes, the eighth note is followed by 1 note head width (NHW). 
1820 The quarter note is followed by 2 NHW, the half by 3 NHW, etc.
1821 @lilypond[fragment,verbatim,relative=1] c2 c4. c8 c4. c8 c4. c8 c8
1822 c8 c4 c4 c4
1823 @end lilypond
1824
1825 Normally, @code{spacing-increment} is set to 1.2 staff space, which is
1826 approximately the width of a note head, and
1827 @code{shortest-duration-space} is set to 2.0, meaning that the
1828 shortest note gets 2.4 staff space (2.0 times the
1829 @code{spacing-increment}) of horizontal space. This space is counted
1830 from the left edge of the symbol, so the shortest notes are generally
1831 followed by one NHW of space.
1832
1833 If one would follow the above procedure exactly, then adding a single
1834 32th note to a score that uses 8th and 16th notes, would widen up the
1835 entire score a lot. The shortest note is no longer a 16th, but a 32nd,
1836 thus adding 1 NHW to every note. To prevent this, the shortest
1837 duration for spacing is not the shortest note in the score, but rather
1838 the one which occurs most frequently.
1839
1840
1841 The most common shortest duration is determined as follows: in every
1842 measure, the shortest duration is determined. The most common short
1843 duration, is taken as the basis for the spacing, with the stipulation
1844 that this shortest duration should always be equal to or shorter than
1845 1/8th note. The shortest duration is printed when you run
1846 @code{lilypond} with the @code{--verbose} option.
1847
1848 These durations may also be customized. If you set the
1849 @code{common-shortest-duration} in @internalsref{SpacingSpanner}, then
1850 this sets the base duration for spacing. The maximum duration for this
1851 base (normally 1/8th), is set through @code{base-shortest-duration}.
1852
1853 @cindex @code{common-shortest-duration}
1854 @cindex @code{base-shortest-duration}
1855 @cindex @code{stem-spacing-correction}
1856 @cindex @code{spacing}
1857
1858 Notes that are even shorter than the commoon shortest note are
1859 followed by a space that is proportional to their duration relative to
1860 the common shortest note.  So if we were to add only a few 16th notes
1861 to the example above, they would be followed by half a NHW:
1862
1863 @lilypond[fragment,verbatim,relative=2]
1864  c2 c4. c8 c4. c16[ c] c4. c8 c8 c8 c4 c4 c4
1865 @end lilypond
1866
1867
1868 In the introduction (see @ref{Engraving}), it was explained that stem
1869 directions influence spacing. This is controlled with the
1870 @code{stem-spacing-correction} property in the
1871 @internalsref{NoteSpacing}, object. These are generated for every
1872 @internalsref{Voice} context. The @code{StaffSpacing} object
1873 (generated at @internalsref{Staff} context) contains the same property
1874 for controlling the stem/bar line spacing. The following example shows
1875 these corrections, once with default settings, and once with
1876 exaggerated corrections:
1877
1878 @lilypond[raggedright]
1879 {
1880       c'4 e''4 e'4 b'4 |
1881       b'4 e''4 b'4 e''4|
1882       \override Staff.NoteSpacing #'stem-spacing-correction = #1.5
1883       \override Staff.StaffSpacing #'stem-spacing-correction = #1.5
1884       c'4 e''4 e'4 b'4 |
1885       b'4 e''4 b'4 e''4|      
1886 }
1887 @end lilypond
1888
1889
1890 @seealso
1891
1892 Internals: @internalsref{SpacingSpanner}, @internalsref{NoteSpacing},
1893 @internalsref{StaffSpacing}, @internalsref{SeparationItem}, and
1894 @internalsref{SeparatingGroupSpanner}.
1895
1896 @refbugs
1897
1898 Spacing is determined on a score wide basis. If you have a score that
1899 changes its character (measured in durations) halfway during the
1900 score, the part containing the longer durations will be spaced too
1901 widely.
1902
1903 There is no convenient mechanism to manually override spacing.  The
1904 following work-around may be used to insert extra space into a score.
1905 @example
1906  \once \override Score.SeparationItem #'padding = #1
1907 @end example
1908
1909 No work-around exists for decreasing the amount of space.
1910
1911 @node Line length
1912 @subsection Line length
1913
1914 @cindex page breaks
1915 @cindex breaking pages
1916
1917 @cindex @code{indent}
1918 @cindex @code{linewidth}
1919
1920 The most basic settings influencing the spacing are @code{indent} and
1921 @code{linewidth}. They are set in the @code{\paper} block. They
1922 control the indentation of the first line of music, and the lengths of
1923 the lines.
1924
1925 If  @code{raggedright} is set to true in the @code{\paper}
1926 block, then the lines are justified at their natural length. This
1927 useful for short fragments, and for checking how tight the natural
1928 spacing is.
1929
1930 @cindex page layout
1931 @cindex vertical spacing
1932
1933 The option @code{raggedlast} is similar to @code{raggedright}, but
1934 only affects the last line of the piece. No restrictions are put on
1935 that line. The result is similar to formatting text paragraphs. In a
1936 paragraph, the last line simply takes its natural length.
1937
1938
1939 @node Line breaking
1940 @subsection Line breaking
1941
1942 @cindex line breaks
1943 @cindex breaking lines
1944
1945 Line breaks are normally computed automatically. They are chosen such
1946 that lines look neither cramped nor loose, and that consecutive lines
1947 have similar density.
1948
1949 Occasionally you might want to override the automatic breaks; you can
1950 do this by  specifying @code{\break}. This will force a line break at
1951 this point.  Line breaks can only occur at places where there are bar
1952 lines.  If you want to have a line break where there is no bar line,
1953 you can force an invisible bar line by entering @code{\bar
1954 ""}. Similarly, @code{\noBreak} forbids a line break at a 
1955 point.
1956
1957
1958 @cindex regular line breaks
1959 @cindex four bar music. 
1960
1961 For line breaks at regular intervals  use @code{\break} separated by
1962 skips and repeated with @code{\repeat}:
1963 @example
1964 <<  \repeat unfold 7 @{
1965          s1 \noBreak s1 \noBreak
1966          s1 \noBreak s1 \break  @}
1967    @emph{the real music}
1968 >> 
1969 @end  example
1970
1971 @noindent
1972 This makes the following 28 measures (assuming 4/4 time) be broken every
1973 4 measures, and only there.
1974
1975 @refcommands
1976
1977 @code{\break}, and @code{\noBreak}.
1978 @cindex @code{\break}
1979 @cindex @code{\noBreak}
1980
1981 @seealso
1982
1983 Internals: @internalsref{BreakEvent}.
1984
1985
1986
1987 @node Multiple movements
1988 @subsection Multiple movements
1989
1990 @cindex bibliographic information
1991 @cindex titles
1992 @cindex composer
1993 @cindex Engraved by LilyPond
1994
1995 A document may contains multiple pieces of music. Examples of these
1996 are an etude book, or an orchestral part with multiple movements.
1997 Each movement is entered with a @code{\score} block,
1998
1999 @example
2000   \score @{
2001      @var{..music..}
2002   @}
2003 @end example
2004
2005 The movements are combined together to  
2006 @code{\book} block is used to group the individual movements.
2007
2008 @example
2009 \book @{
2010   \score @{
2011      @var{..}
2012   @}
2013   \score @{
2014      @var{..}
2015   @}
2016 @}
2017 @end example
2018
2019
2020 The header for each piece of music can be put inside the @code{\score}
2021 block.  The @code{piece} name from the header will be printed before
2022 each movement.  The title for the entire book can be put inside the
2023 @code{\book}, but if it is not present, the @code{\header} which is at
2024 the top of the file is inserted.
2025
2026 @cindex Engraved by LilyPond
2027 @cindex signature line
2028
2029 @example 
2030 \book @{
2031   \header @{
2032     title = "Eight miniatures" 
2033     composer = "Igor Stravinsky"
2034   @}
2035   \score @{
2036     @dots{}
2037     \header @{ piece = "Romanze" @}
2038   @}
2039   \score @{
2040     @dots{}
2041     \header @{ piece = "Menuetto" @}
2042   @}
2043 @}
2044 @end example
2045
2046 @node Creating titles
2047 @subsection Creating titles
2048
2049 Titles are created for each @code{\score} block, and over a
2050 @code{\book}.
2051
2052 The contents of the titles are taken from the @code{\header} blocks.
2053 The header block for a book supports the following 
2054 @table @code
2055 @item title
2056     The title of the music. Centered on top of the first page.
2057 @item subtitle
2058     Subtitle, centered below the title.
2059 @item poet
2060     Name of the poet, left flushed below the subtitle.
2061 @item composer
2062     Name of the composer, right flushed below the subtitle.
2063 @item meter
2064     Meter string, left flushed below the poet.
2065 @item opus
2066     Name of the opus, right flushed below the composer.
2067 @item arranger
2068     Name of the arranger, right flushed below the opus.
2069 @item instrument
2070     Name of the instrument, centered below the arranger.
2071 @item dedication            
2072     To whom the piece is dedicated.
2073 @item piece
2074     Name of the piece, left flushed below the instrument.
2075 @end table
2076
2077 This is a demonstration of the fields available, 
2078
2079 @lilypond[verbatim]
2080 \book {
2081   \header {
2082     title = "Title"
2083     subtitle = "and the subtitle"
2084     subsubtitle = "Sub sub title"
2085     poet = "Poet"
2086     composer = "Composer"
2087     texttranslator = "Text Translator"
2088     meter = "Meter"
2089     arranger = "Arranger"
2090     instrument = "Instrument"
2091     piece = "Piece"
2092   }
2093
2094   \score {
2095     \header {
2096       piece = "piece1"
2097       opus = "opus1" 
2098     }
2099     { c'1 }
2100   }
2101   \score {
2102     \header {
2103       piece = "piece2"
2104       opus = "opus2" 
2105     }
2106     { c'1 }
2107   }
2108 }
2109 @end lilypond
2110
2111 Different fonts may be selected for each element, by using a
2112 @code{\markup}, e.g.
2113
2114 @verbatim
2115   \header {
2116     title = \markup { \italic { The italic title } }
2117   }
2118 @end verbatim
2119
2120 A more advanced option is to change the Scheme functions
2121 @code{make-book-title} and @code{make-score-title} functions, defined
2122 in the @code{\bookpaper} of the @code{\book} block. These functions
2123 create a block of titling, given the information in the
2124 @code{\header}. The init file @file{ly/titling.scm} shows how the
2125 default format is created, and it may be used as a template for
2126 different styles.
2127
2128  
2129 @cindex \bookpaper
2130 @cindex header
2131 @cindex footer
2132 @cindex page layout
2133 @cindex titles
2134
2135
2136
2137
2138 @node Page breaking
2139 @subsection Page breaking
2140
2141 The default page breaking may be overriden by inserting
2142 @code{\pageBreak} or @code{\noPageBreak} commands. These commands are
2143 analogous to @code{\break} and @code{\noBreak}. They should be
2144 inserted with a bar line. These commands force and forbid a page-break
2145 from happening.  Of course, the @code{\pageBreak} command also forces
2146 a line break.
2147
2148 Page breaks are computed by the @code{page-breaking} function in the
2149 @code{\bookpaper} block. 
2150
2151 @refcommands
2152
2153 @cindex @code{\pageBreak}
2154 @code{\pageBreak}
2155 @cindex  @code{\noPageBreak} 
2156 @code{\noPageBreak} 
2157
2158 @node Paper size
2159 @subsection Paper size
2160
2161 @cindex paper size
2162 @cindex page size
2163 @cindex @code{papersize}
2164
2165 To change the paper size, there are two commands,
2166 @example
2167         #(set-default-paper-size "a4")
2168         \paper@{
2169            #(set-paper-size "a4")
2170         @}
2171 @end example
2172 The second one sets the size of the @code{\paper} block that it is in.
2173
2174 The following paper sizes are supported.
2175
2176 @table @code
2177 @item a6
2178 @item a5
2179 @item a4
2180 @item a3
2181 @item legal
2182 @item letter
2183 @item tabloid
2184 @end table 
2185
2186 @cindex orientation
2187 @cindex landscape
2188
2189 If the symbol @code{landscape} is supplied as argument to
2190 @code{set-default-paper-size}, the pages will be rotated 90 degrees,
2191 and line widths will be set longer correspondingly.
2192
2193 @example
2194 #(set-default-paper-size "a6" 'landscape)
2195 @end example 
2196
2197 @node Page layout
2198 @subsection Page layout
2199
2200 @cindex page layout
2201 @cindex margins
2202 @cindex header, page
2203 @cindex footer, page
2204
2205 LilyPond will do page layout, setting margins and adding headers and
2206 footers to each page.
2207
2208 The default layout responds to the following settings in the
2209 @code{\bookpaper} block
2210
2211 @cindex \bookpaper
2212
2213 @table @code
2214 @item firstpagenumber
2215  The value of the page number of the first page. Default is 1.
2216 @item hsize
2217  The width of the page
2218 @item vsize
2219  The height of the page
2220 @item topmargin
2221  Margin between header and top of the page
2222 @item bottommargin
2223  Margin between footer and bottom of the page
2224 @item leftmargin
2225  Margin between the left side of the page and the beginning  of the music.
2226 @item linewidth
2227  The length of the paper line.
2228 @item headsep
2229  Distance between top-most music system and the page header
2230 @item footsep
2231  Distance between bottom-most music system and the page footer
2232 @item raggedbottom
2233  If set to true, systems will not be spread across the page.  
2234 @item raggedlastbottom
2235  If set to true, systems will not be spread to fill the last page.
2236
2237 @item betweensystemspace
2238   This dimensions determines the distance between systems. It is the
2239 ideal distance between the center of the bottom staff of one system,
2240 and the center of the top staff of the next system.
2241
2242 Increasing this will provide a more even appearance of the page at the
2243 cost of using more vertical space.
2244
2245 @item betweensystempadding
2246 This dimension is the minimum amount of white space that will always
2247 be present between the bottom most symbol of one system, and the
2248 topmost of the next system.
2249
2250 Increasing this will put systems whose bounding boxes almost touch
2251 farther apart.
2252
2253 @item aftertitlespace
2254 Amount of space between title and the first system
2255 @item beforetitlespace 
2256 Amount of space between last system of the previous piece and  the
2257 title of the next
2258 @item betweentitlespace
2259 Amount of space between consecutive titles (eg. the title   of the
2260 book and the title of piece).
2261
2262 @end table
2263
2264 @example
2265         \bookpaper@{
2266            hsize = 2\cm
2267            topmargin = 3\cm
2268            bottommargin = 3\cm
2269            raggedlastbottom = ##t
2270         @}
2271 @end example
2272
2273 You can also define these values in scheme. In that case @code{mm},
2274 @code{in}, @code{pt} and @code{cm} are variables defined in
2275 @file{book-paper-defaults.ly} with values in millimeters. That's why the
2276 value has to be multiplied in the example above.
2277
2278 @example
2279         \bookpaper@{
2280         #(define bottommargin (* 2 cm)) 
2281         @}
2282 @end example
2283
2284 @cindex copyright
2285 @cindex tagline
2286
2287 The default footer is empty, except for the first page, where it the
2288 @code{copyright} field from @code{\header} is inserted, and the last
2289 page, where @code{tagline} from @code{\header} is added. The default
2290 tagline is ``Engraved by LilyPond (@var{version})''.@footnote{Nicely
2291 printed parts are good PR for us, so please leave the tagline if you
2292 can.}
2293
2294 The header and footer are created by the functions @code{make-footer}
2295 and @code{make-header}, defined in @code{\bookpaper}. The default
2296 implementations are in @file{scm/page-layout.scm}.
2297
2298 The following settings influence the header and footer layout.
2299
2300 @table @code
2301 @item printpagenumber
2302   this boolean controls whether a pagenumber is printed. 
2303 @end table
2304
2305 The page layout itself is done by two functions in the
2306 @code{\bookpaper}, @code{page-music-height} and
2307 @code{page-make-stencil}. The former tells the line-breaking algorithm
2308 how much space can be spent on a page, the latter creates the actual
2309 page given the system to put on it.
2310
2311
2312 @seealso
2313
2314 Examples: @inputfileref{input/test,page-breaks.ly}
2315
2316 @refbugs
2317
2318 The option rightmargin is defined but doesn't set the right margin
2319 yet. The value for the right margin has to be defined adjusting the
2320 values of the leftmargin and linewidth.
2321
2322 The default page header puts the page number and the @code{instrument}
2323 field from the @code{\header} block on a line.
2324
2325
2326
2327 @node File structure
2328 @section File structure
2329
2330 The bigger part of this manual is concerned with entering various
2331 forms of music in LilyPond. However, many music expressions are not
2332 valid input on their own, for example, a @code{.ly} file containing
2333 only a note
2334 @example
2335   c'4
2336 @end example
2337
2338 @noindent
2339 will result in a parsing error. Instead, music should be inside other
2340 expressions, which may be put in a file by themselves. Such
2341 expressions are called toplevel expressions.  This section enumerates
2342 them all.
2343
2344 A @code{.ly} file contains any number of toplevel expressions, where a
2345 toplevel expressions is one of the following
2346
2347 @itemize @bullet
2348 @item An output definition, such as @code{\bookpaper}, @code{\midi}
2349 and @code{\paper}. Such a definition at toplevel changes the default
2350 settings for the block entered.
2351
2352 @item An @code{\header} block. This sets the global header block. This
2353 is the block containing the definitions for book-wide settings, like
2354 composer, title, etc. 
2355
2356 @item An @code{\addquote} statement. See @ref{Quoting other voices}
2357 for more information.
2358
2359 @item A @code{\score} block. This score will be collected with other
2360 toplevel scores, and combined as a single @code{\book}.
2361
2362 This behavior can be changed by setting the variable
2363 @code{toplevel-score-handler} at toplevel.  The default handler is
2364 defined in the init file @file{scm/lily.scm}.
2365
2366 @item
2367 A @code{\book} block logically combines multiple movements
2368 (ie. multiple @code{\score} blocks) into one document. A number of
2369 @code{\scores} creates a single output file, where all movement are
2370 concatenated..
2371
2372 This behavior can be changed by setting the variable
2373 @code{toplevel-book-handler} at toplevel.  The default handler is
2374 defined in the init file @file{scm/lily.scm}.
2375
2376
2377 @item A compound music expression, such as
2378 @example
2379   @{ c'4 d' e'2 @}
2380 @end example
2381
2382 This will add the piece in a @code{\score}, and formats it into a
2383 single book together with all other toplevel @code{\score}s and music
2384 expressions.
2385  
2386 This behavior can be changed by setting the variable
2387 @code{toplevel-music-handler} at toplevel. The default handler is
2388 defined in the init file @file{scm/lily.scm}.
2389  
2390 @end itemize
2391
2392 The following example shows three things which may be entered at
2393 toplevel
2394 @verbatim
2395    \paper  {
2396      % movements are non-justified by default    
2397      raggedright = ##t
2398    }
2399
2400    \header {
2401       title = "Do-re-mi"
2402    }
2403    
2404    { c'4 d' e2 }
2405 @end verbatim
2406
2407
2408 At any point in a file, any of the following lexical instructions can
2409 be entered:
2410
2411 @itemize @bullet
2412 @item @code{\version}
2413 @item @code{\include}
2414 @item @code{\encoding}
2415 @item @code{\renameinput}
2416 @end itemize 
2417