]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/user/writing-texinfo.txt
Merge branch 'master' of git://git.sv.gnu.org/lilypond.git into td-lily
[lilypond.git] / Documentation / user / writing-texinfo.txt
1 DOCUMENTATION FORMATTING
2 ------------------------
3
4 The language is called texinfo; you can see its manual here:
5 http://www.gnu.org/software/texinfo/manual/texinfo/
6
7 However, you don't need to read those docs.  The most important
8 thing to notice is that text is text.  If you see a mistake in the
9 text, you can fix it.  If you want to change the order of
10 something, you can cut-and-paste that stuff into a new location.
11
12
13 %%%%% SECTIONING COMMANDS
14
15 Most of the manual operates at the
16         @node Foo
17         @subsubsection Foo
18 level.  Sections are created with
19         @node Foo
20         @subsection Foo
21 commands.
22
23 * sectioning commands (@node and @section) must not appear inside
24   an @ignore.  Separate those commands with a space, ie @n ode.
25
26
27
28 %%%%% LILYPOND FORMATTING
29
30 * Use two spaces for indentation in lilypond examples.  (no tabs)
31
32 * All text strings should be prefaced with #.  LilyPond does not
33   strictly require this, but it is helpful to get users accustomed
34   to this scheme construct.  ie
35     \set Staff.instrumentName = #"cello"
36
37 * All engravers should have double-quotes around them:
38     \consists "Spans_arpeggio_engraver"
39   Again, LilyPond does not strictly require this, but it is a
40   useful standard to follow.
41
42 * Examples should end with a complete bar if possible.
43
44 * If possible, only write one bar per line.  The notes on each
45   line should be an independent line -- tweaks should occur on
46   their own line if possible.
47   Bad:
48     \override textscript #'padding = #3 c1^"hi"
49   Good:
50     \override textscript #'padding = #3
51     c1^"hi"
52
53 * LilyPond input should be produced via
54     @lilypond[verbatim,quote,ragged-right]
55   with `fragment' and `relative=2' optional.
56
57   Examples about page layout may alter the quote/ragged-right
58   options.  Omitting `verbatim' is not allowed except for special
59   circumstances.
60
61 * Inspirational headwords are produced with
62   @lilypondfile[quote,ragged-right,line-width=16\cm,staffsize=16]
63   {pitches-headword.ly}
64
65 * LSR snippets are linked with
66   @lilypondfile[verbatim,lilyquote,ragged-right,texidoc]
67   {filename.ly}
68
69 * Avoid long stretches of input code.  Noone is going to read them
70   in print.  Please create a smaller example.  (the smaller
71   example does not need to be minimal, however)
72
73 * Specify durations for at least the first note of every bar.
74
75 * If possible, end with a complete bar.
76
77 * Comments should go on their own line, and be placed before the
78   line(s) to which they refer.
79
80 * If you only have one bar per line, omit bar checks.  If you
81   put more than one bar per line (not recommended), then include
82   bar checks.
83
84 * If you want to work on an example outside of the manual (for
85   easier/faster processing), use this header:
86
87 \paper {
88   #(define dump-extents #t)
89   indent = 0\mm
90   line-width = 160\mm - 2.0 * 0.4\in
91   ragged-right = ##t
92   force-assignment = #""
93   line-width = #(- line-width (* mm  3.000000))
94 }
95
96 \layout {
97 }
98
99   You may not change any of these values.  If you are making an
100   example demonstrating special \paper{} values, contact the
101   Documentation Editor.
102
103
104 %%%%% TEXT FORMATTING
105
106 * Lines should be less than 72 characters long.  (I personally
107   recommend writing with 66-char lines, but don't bother modifying
108   existing material.)
109
110 * Do not use tabs.
111
112 * Do not use spaces at the beginning of a line (except in @example
113   or @verbatim environments), and do not use more than a single
114   space between words.  `makeinfo' copies the input lines verbatim
115   without removing those spaces.
116
117 * Use two spaces after a period.
118
119 * In examples of syntax, use @var{musicexpr} for a music
120   expression.
121
122 * Variables or numbers which consist of a single character
123   (probably followed by a punctuation mark) should be tied
124   properly, either to the previous or the next word.  Example:
125
126       The variable@tie{}@var{a} ...
127
128 * To get consistent indentation in the DVI output it is better to
129   avoid the @verbatim environment.  Use the @example environment
130   instead if possible, but without extraneous indentation.  For
131   example, this
132
133     @example
134       foo {
135         bar
136       }
137     @end example
138
139   should be replaced with
140
141     @example
142     foo {
143       bar
144     }
145     @end example
146
147   where `@example' starts the line (without leading spaces).
148
149 * Do not compress the input vertically; this is, do not use
150
151     Beginning of logical unit
152     @example
153     ...
154     @end example
155     continuation of logical unit
156
157   but
158
159     Beginning of logical unit
160
161     @example
162     ...
163     @end example
164
165     @noindent
166     continuation of logical unit
167
168   This makes it easier to avoid forgetting the `@noindent'.  Only
169   use @noindent if the material is discussing the same material;
170   new material should simply begin without anything special on the
171   line above it.
172
173 * in @itemize use @item on a separate line like this:
174   @itemize
175   @item
176   Foo
177
178   @item
179   Bar
180
181   Do not use @itemize @bullet.
182
183 * To get LilyPond version, use @version{} (this does not work inside
184   LilyPond snippets).  If you write "@version{}" (enclosed with
185   quotes), or generally if @version{} is not followed by a space,
186   enclose it with
187
188   @w{ ... }
189
190   e.g.
191
192   @w{"@version{}"}
193
194   to prevent an ugly line break in PDF output.
195
196
197 %%%%% SYNTAX SURVEY
198
199 @c - single line comments
200   "@c NOTE:" is a comment which should remain in the final
201   version.  (gp only command ;)
202 @ignore ... @end ignore - multi-line comment
203
204 @cindex - General index. Please add as many as you can.  Don't
205   capitalize the first word.
206 @funindex - is for a \lilycommand.
207
208 @example ... @end ignore - example text that should be set as a
209   blockquote.  Any {} must be escaped with @{ }@
210 @itemize @item A @item B ... @end itemize - for bulleted lists.
211   Do not compress vertically like this.
212
213 @code{} - typeset in a tt-font. Use for actual lilypond code or
214   property/context names.
215 @notation{} - refers to pieces of notation, e.g.
216   "@notation{cres.}".  Also use to specific lyrics ("the
217   @notation{A - men} is centered")
218 @q{} - Single quotes. Used for `vague' terms.
219 @qq{} - Double quotes.  Used for actual quotes ("he said").
220
221 @tie{} - Variables or numbers which consist of a single character
222   (probably followed by a punctuation mark) should be tied
223   properly, either to the previous or the next word.  Example:
224     "The letter@tie{}@q{I} is skipped"
225
226 @var - Use for variables.
227 @warning{} - produces a "Note: " box. Use for important messages.
228
229 @bs - Generates a backslash inside @warning.
230     Any `\' used inside @warning (and @q or @qq) must be written as `@bs{}' 
231     (texinfo would also allow \\, but this breaks with PDF output).
232
233
234
235 %%%%% OTHER TEXT CONCERNS
236
237 * References must occur at the end of a sentence, for more
238   information see @ref{the texinfo manual}.  Ideally this should
239   also be the final sentence of a paragraph, but this is not
240   required.  Any link in a doc section must be duplicated in the
241   @seealso section at the bottom.
242
243 * Introducing examples must be done with
244      . (ie finish the previous sentence/paragaph)
245      : (ie `in this example:')
246      , (ie `may add foo with the blah construct,')
247   The old "sentence runs directly into the example" method is not
248   allowed any more.
249
250 * Abbrevs in caps, e.g., HTML, DVI, MIDI, etc.
251
252 * Colon usage
253
254   1. To introduce lists
255   2. When beginning a quote: "So, he said,..."
256      This usage is rarer.  Americans often just use a comma.
257   3. When adding a defining example at the end of a sentence.
258
259 * Non-ASCII characters which are in utf-8 should be directly used;
260   this is, don't say `Ba@ss{}tuba' but `Baßtuba'.  This ensures that
261   all such characters appear in all output formats.
262