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