4.7.2 Using variables for layout adjustments

Override commands are often long and tedious to type, and they
have to be absolutely correct. If the same overrides are to be
used many times it may be worth defining variables to hold them.

Suppose we wish to emphasize certain words in lyrics by printing
them in bold italics. The \italic and \bold
commands only work within lyrics if they are embedded, together with
the word or words to be modified, within a \markup block,
which makes them tedious to enter. The need to embed the words
themselves prevents their use in simple variables. As an
alternative can we use \override and \revert commands?

These would also be extremely tedious to enter if there were many
words requiring emphasis. But we can define these as two
variables and use those to bracket the words to be emphasized.
Another advantage of using variables for these overrides is that
the spaces around the dot are not necessary, since they are not
being interpreted in \lyricmode directly. Here’s an example
of this, although in practice we would choose shorter names
for the variables to make them quicker to type: