[ << Documentation work ] | [Top][Contents][Index][ ? ] | [ Website work >> ] | ||
[ < Sectioning commands ] | [ Up : Texinfo introduction and usage policy ] | [ Text formatting > ] |
4.3.4 LilyPond formatting
- Use two spaces for indentation in lilypond examples (no tabs).
-
All engravers should have double-quotes around them:
\consists "Spans_arpeggio_engraver"
LilyPond does not strictly require this, but it is a useful convention to follow.
-
All context or layout object strings should be prefaced with
#
. Again, LilyPond does not strictly require this, but it is helpful to get users accustomed to this scheme construct. i.e.\set Staff.instrumentName = #"cello"
-
Try to avoid using
#'
or#`
within when describing context or layout properties outside of an@example
or@lilypond
, unless the description explicitly requires it.ie “...setting the
transparent
property leaves the object where it is, but makes it invisible.” - If possible, only write one bar per line.
- If you only have one bar per line, omit bar checks. If you must put more than one bar per line (not recommended), then include bar checks.
-
Tweaks should, if possible, also occur on their own line.
not: \override TextScript #'padding = #3 c1^"hi" but instead: \override TextScript #'padding = #3 c1^"hi"
-
Most LilyPond input should be produced with:
@lilypond[verbatim,quote,relative=2]
or
@lilypond[verbatim,quote,relative=1]
If you want to use
\layout{}
or define variables, use@lilypond[verbatim,quote]
In rare cases, other options may be used (or omitted), but ask first.
-
Inspirational headwords are produced with
@lilypondfile[quote,ragged-right,line-width=16\cm,staffsize=16] {pitches-headword.ly}
-
LSR snippets are linked with
@lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle] {filename.ly}
excepted in Templates, where ‘doctitle’ may be omitted.
- Avoid long stretches of input code. Nobody is going to read them in print. Create small examples. However, this does not mean it has be minimal.
- Specify durations for at least the first note of every bar.
- If possible, end with a complete bar.
- Comments should go on their own line, and be placed before the line(s) to which they refer.
-
For clarity, always use { } marks even if they are not technically
required; ie
not: \context Voice \repeat unfold 2 \relative c' { c2 d } but instead: \context Voice { \repeat unfold 2 { \relative c' { c2 d } } }
-
Add a space around { } marks; ie
not: \chordmode{c e g} but instead: \chordmode { c e g }
-
Use { } marks for additional
\markup
format comands; ienot: c^\markup \tiny\sharp but instead: c^\markup { \tiny \sharp }
-
Remove any space around
<
>
marks; ienot: < c e g > 4 but instead: <c e g>4
-
Beam, slur and tie marks should begin immediately after the first
note with beam and phrase marks ending immediately after the last.
a8(\ ais16[ b cis( d] b) cis4~ b' cis,\)
-
If you want to work on an example outside of the manual (for
easier/faster processing), use this header:
\paper { indent = 0\mm line-width = 160\mm - 2.0 * 0.4\in ragged-right = ##t force-assignment = #"" line-width = #(- line-width (* mm 3.000000)) } \layout { }
You may not change any of these values. If you are making an example demonstrating special
\paper{}
values, contact the Documentation Editor.
[ << Documentation work ] | [Top][Contents][Index][ ? ] | [ Website work >> ] | ||
[ < Sectioning commands ] | [ Up : Texinfo introduction and usage policy ] | [ Text formatting > ] |