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