version that you are working on. See TRANSLATION for details.
@end ignore
-@c \version "2.11.65"
+@c \version "2.12.0"
@node Tweaking output
@chapter Tweaking output
We have already met the commands @code{\set} and @code{\with}, used to
change the properties of @strong{contexts} and to remove and add
@strong{engravers}, in @ref{Modifying context properties}, and
-@ref{Adding and removing engravers}. We now must meet some more
+@ref{Adding and removing engravers}. We must now introduce some more
important commands.
The command to change the properties of @strong{layout objects} is
@code{\override}. Because this command has to modify
internal properties deep within LilyPond its syntax is not
-as simple as the commands you have met so far. It needs to
+as simple as the commands you have used so far. It needs to
know precisely which property of which object in which context
has to be modified, and what its new value is to be. Let's see
how this is done.
of the @code{\override} command. Neither the context nor the
layout object should be specified; in fact, it would generate
an error to do so. These are both implied by the following
-item in the input stream. So the general syntax of the
+item in the input stream. Note also that an equals sign should
+not be present. So the general syntax of the
@code{\tweak} command is simply
@example
-\tweak #'@var{layout-property} = #@var{value}
+\tweak #'@var{layout-property} #@var{value}
@end example
A @code{\tweak} command can also be used to modify just one in
string"}; for more details about symbols and strings, see @ref{Scheme
tutorial}.
-Ok, so the @code{\override} command we need to print the lyrics
-in italics should be
+So we see that the @code{\override} command needed to print the lyrics
+in italics is:
@example
\override LyricText #'font-shape = #'italic
@end example
@noindent
-and this should be placed just in front of and close to the
-lyrics which it should affect, like this:
+This should be placed just in front of the lyrics we wish to affect,
+like so:
@cindex font-shape property, example
@cindex italic, example
them are of the type @code{Staff}, so the reason the @code{\override}
command failed to work as expected is because @code{Barline} is not in
the default @code{Voice} context. If the context is specified
-wrongly, the command simply does not work. No error message is
+incorrectly, the command simply does not work. No error message is
produced, and nothing is logged in the log file. Let's try correcting
it by adding the correct context:
Now the bar lines have vanished.
+Note, though, that setting the @code{stencil} property to @code{#f}
+will cause errors when the dimensions of the object are required for
+correct processing. For example, errors will be generated if the
+@code{stencil} property of the @code{NoteHead} object is set to
+@code{#f}. If this is the case, you can instead use the
+@code{point-stencil} function, which sets the stencil to a object
+with zero size:
+
+@lilypond[quote,verbatim,relative=2]
+{
+ c c
+ \once \override NoteHead #'stencil = #point-stencil
+ c c
+}
+@end lilypond
+
@subheading break-visibility
@cindex break-visibility property
<<
{ f c c }
\new Staff \with {
- alignAboveContext = "main" }
+ alignAboveContext = #"main" }
{ f8 f c }
>>
r4 |
<<
{ f c c }
\new Staff \with {
- alignAboveContext = "main"
+ alignAboveContext = #"main"
}
{
\override Staff.Clef #'stencil = ##f
<<
{ f c c }
\new Staff \with {
- alignAboveContext = "main"
+ alignAboveContext = #"main"
% Don't print clefs in this staff
\override Clef #'stencil = ##f
% Don't print time signatures in this staff
<<
{ f c c }
\new Staff \with {
- alignAboveContext = "main"
+ alignAboveContext = #"main"
\override Clef #'stencil = ##f
\override TimeSignature #'stencil = ##f
% Reduce all font sizes by ~24%
<<
{ f c c }
\new Staff \with {
- alignAboveContext = "main"
+ alignAboveContext = #"main"
\override Clef #'stencil = ##f
\override TimeSignature #'stencil = ##f
fontSize = #-2
@end lilypond
@noindent
-but this may be overriden to manually force all or any of the
+but this may be overridden to manually force all or any of the
individual fingering numbers above or below:
@cindex fingering example
c, c c c
@end lilypond
+@cindex slurs and outside-staff-priority
+@cindex slurs and articulations
+@cindex articulations and slurs
+
+Slurs by default are classed as within-staff objects, but
+they often appear above the staff if the notes to
+which they are attached are high on the staff. This can push
+outside-staff objects such as articulations too high, as the slur
+will be placed first. The @code{avoid-slur} property of the
+articulation can be set to @code{'inside} to bring the articulation
+inside the slur, but the @code{avoid-slur} property is effective
+only if the @code{outside-staff-priority} is also set to @code{#f}.
+Alternatively, the @code{outside-staff-priority} of the slur
+can be set to a numerical value to cause it to be placed along with
+other outside-staff objects according to that value. Here's an
+example showing the effect of the two methods:
+
+@lilypond[quote,verbatim,relative=2]
+c4( c^\markup\tiny\sharp d4.) c8
+c4(
+\once \override TextScript #'avoid-slur = #'inside
+\once \override TextScript #'outside-staff-priority = ##f
+c^\markup\tiny\sharp d4.) c8
+\once \override Slur #'outside-staff-priority = #500
+c4( c^\markup\tiny\sharp d4.) c8
+@end lilypond
+
Changing the @code{outside-staff-priority} can also be used to
control the vertical placement of individual objects, although
the results may not always be desirable. Suppose we would