]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/hu/usage/lilypond-book.itely
Run scripts/auxiliar/update-with-convert-ly.sh
[lilypond.git] / Documentation / hu / usage / lilypond-book.itely
1 @c -*- coding: utf-8; mode: texinfo; -*-
2
3 @ignore
4     Translation of GIT committish: f77212d801fa4603bf596a19cecf5a068f1d9d85
5
6     When revising a translation, copy the HEAD committish of the
7     version that you are working on.  For details, see the Contributors'
8     Guide, node Updating translation committishes..
9 @end ignore
10
11 @c \version "2.19.21"
12
13 @c Note: keep this node named so that `info lilypond-book' brings you here.
14 @node lilypond-book
15 @chapter A @command{lilypond-book} használata
16 @translationof lilypond-book
17
18 Amennyiben egy dokumentumba kottapéldákat szeretnénk beszúrni, megtehetjük,
19 hogy azok képeit egyesével létrehozzuk a LilyPond segítségével PostScript
20 vagy PNG formátumban, és mint bármilyen más képeket, beillesztjük azokat egy
21 @LaTeX{} vagy HTML dokumentumba.
22
23 A @command{lilypond-book} ennek a folyamatnak az automatizálására szolgál:
24 ez a program kiszedi a LilyPond kódrészleteket egy dokumentumból, lefordítja
25 őket a @command{lilypond} segítségével, és az így kapott képeket beilleszti
26 az eredeti kódrészletek helyére. A kottakép méretei igazodnak a dokumentum
27 elrendezéséhez.
28
29 A @command{lilypond-book} egy különálló parancssori program; a parancssoros
30 programok futtatásának módját a @ref{Parancssori használat} írja le bővebben.
31
32 A @command{lilypond-book} jelenleg a @LaTeX{}, HTML, Texinfo és DocBook
33 formátumokat támogatja.
34
35 @cindex texinfo
36 @cindex latex
37 @cindex texinfo
38 @cindex texi
39 @cindex html
40 @cindex docbook
41 @cindex dokumentumok, kottapéldák
42 @cindex HTML, kottapéldák
43 @cindex Texinfo, kottapéldák
44 @cindex DocBook, kottapéldák
45 @cindex @LaTeX{}, kottapéldák
46
47 @menu
48 * Egy kottapéldákat tartalmazó dokumentum::
49 * Zene és szöveg integrációja::
50 * Kottapéldák paraméterei::
51 * A lilypond-book futtatása::
52 * Fájlkiterjesztések::
53 * lilypond-book sablonok::
54 * Közös tartalomjegyzék::
55 * További módszerek zene és szöveg kombinálására::
56 @end menu
57
58
59 @node Egy kottapéldákat tartalmazó dokumentum
60 @section Egy kottapéldákat tartalmazó dokumentum
61 @translationof An example of a musicological document
62
63 @cindex zenetudomány
64 Bizonyos dokumentumok kottapéldákat tartalmaznak. Ezek között vannak
65 zenetudományi értekezések, énekeskönyvek, vagy ehhez hasonló kézikönyvek.
66 Ezeket úgy is el lehet készíteni, hogy a szövegbe beillesztjük a kottaábrákat.
67 Azonban ahhoz, hogy ne kelljen minden egyes kottarészlet szedését külön
68 elvégezni, a HTML, @LaTeX{}, Texinfo és DocBook formátumú dokumentumok esetén
69 mód nyílik ennek automatizálására.
70
71 Egy @code{lilypond-book} nevű parancsfájl a LilyPond nyelvén írt
72 kódrészleteket szépen formázott kottapéldákká alakítja át. Íme egy rövid,
73 magyarázatokkal ellátott @LaTeX{} példa.
74
75 @subheading Bemenet
76
77 @quotation
78 @verbatim
79 \documentclass[a4paper]{article}
80
81 \begin{document}
82
83 A \verb+lilypond-book+ segítségével feldolgozott dokumentumok
84 kottapéldákat tartalmazhatnak. Például:
85
86 \begin{lilypond}
87 \relative {
88   c'2 e2 \tuplet 3/2 { f8 a b } a2 e4
89 }
90 \end{lilypond}
91
92 A beállításokat szögletes zárójelbe kell tenni:
93
94 \begin{lilypond}[fragment,quote,staffsize=26,verbatim]
95   c'4 f16
96 \end{lilypond}
97
98 A nagyobb kottapéldákat ki lehet emelni külön fájlba, majd beilleszteni
99 őket a \verb+\lilypondfile+ paranccsal:
100
101 \lilypondfile[quote,noindent]{screech-and-boink.ly}
102
103 \end{document}
104 @end verbatim
105 @end quotation
106
107 @subheading Feldolgozás
108
109 A fenti dokumentumot egy @file{lilybook.lytex} nevű fájlba mentve futtassuk le
110 a következő parancsokat:
111
112 @c keep space after @version{} so TeX doesn't choke
113 @example
114 lilypond-book --output=out --pdf lilybook.lytex
115 @emph{lilypond-book (GNU LilyPond) @version{} }
116 @emph{Reading lilybook.lytex...}
117 @emph{...}
118 @emph{Compiling lilybook.tex...}
119 cd out
120 pdflatex lilybook
121 @emph{...}
122 xpdf lilybook
123 @emph{(az @command{xpdf} helyére értelemszerűen tetszőleges PDF-nézegető
124 kerülhet)}
125 @end example
126
127 A @command{lilypond-book} és a @command{latex} rengeteg ideiglenes fájlt
128 hoznak létre. Annak érdekében, hogy ezek külön alkönyvtárba kerüljenek, a
129 @code{--output=@var{alkönyvtár}} opciót kell megadni.
130
131 Lent látható a fenti @LaTeX{} példa kimenete.@footnote{Ezt a dokumentumot a
132 Texinfo generálta, így apró eltérések lehetnek.} Ezzel elsajátítottuk a
133 lilypond-book használatának alapjait.
134
135 @page
136
137 @subheading Kimenet
138
139 A @command{lilypond-book} segítségével feldolgozott dokumentumok
140 kottapéldákat tartalmazhatnak. Például:
141
142 @lilypond
143 \relative {
144   c'2 e2 \tuplet 3/2 { f8 a b } a2 e4
145 }
146 @end lilypond
147
148 A beállításokat szögletes zárójelbe kell tenni:
149
150 @lilypond[fragment,quote,staffsize=26,verbatim]
151 c'4 f16
152 @end lilypond
153
154 A nagyobb kottapéldákat ki lehet emelni külön fájlba, majd beilleszteni
155 őket a @code{\lilypondfile} paranccsal:
156
157 @lilypondfile[quote,noindent]{screech-and-boink.ly}
158
159
160 @page
161
162 @node Zene és szöveg integrációja
163 @section Zene és szöveg integrációja
164 @translationof Integrating music and text
165 @untranslated
166
167 Here we explain how to integrate LilyPond with various output formats.
168
169 @menu
170 * LaTeX::
171 * Texinfo::
172 * HTML::
173 * DocBook::
174 @end menu
175
176 @node LaTeX
177 @subsection @LaTeX{}
178 @untranslated
179
180 @LaTeX{} is the de-facto standard for publishing layouts in the exact
181 sciences.  It is built on top of the @TeX{} typesetting engine,
182 providing the best typography available anywhere.
183
184 See
185 @uref{http://@/www@/.ctan@/.org/@/tex@/-archive/@/info/@/lshort/@/english/,
186 @emph{The Not So Short Introduction to @LaTeX{}}} for an overview on how
187 to use @LaTeX{}.
188
189 Music is entered using
190
191 @example
192 \begin@{lilypond@}[options,go,here]
193   YOUR LILYPOND CODE
194 \end@{lilypond@}
195 @end example
196
197 @noindent
198 or
199
200 @example
201 \lilypondfile[options,go,here]@{@var{filename}@}
202 @end example
203
204 @noindent
205 or
206
207 @example
208 \lilypond[options,go,here]@{ YOUR LILYPOND CODE @}
209 @end example
210
211 Additionally, @code{\lilypondversion} displays the current version
212 of lilypond.
213 Running @command{lilypond-book} yields a file that can be further
214 processed with @LaTeX{}.
215
216 We show some examples here.  The @code{lilypond} environment
217
218 @example
219 \begin@{lilypond@}[quote,fragment,staffsize=26]
220   c' d' e' f' g'2 g'2
221 \end@{lilypond@}
222 @end example
223
224 @noindent
225 produces
226
227 @lilypond[quote,fragment,staffsize=26]
228 c' d' e' f' g'2 g'2
229 @end lilypond
230
231 The short version
232
233 @example
234 \lilypond[quote,fragment,staffsize=11]@{<c' e' g'>@}
235 @end example
236
237 @noindent
238 produces
239
240 @lilypond[quote,fragment,staffsize=11]{<c' e' g'>}
241
242 @noindent
243 Currently, you cannot include @code{@{} or @code{@}} within
244 @code{\lilypond@{@}}, so this command is only useful with the
245 @code{fragment} option.
246
247 The default line width of the music will be adjusted by examining the
248 commands in the document preamble, the part of the document before
249 @code{\begin@{document@}}.  The @command{lilypond-book} command sends
250 these to @LaTeX{} to find out how wide the text is.  The line width for
251 the music fragments is then adjusted to the text width.  Note that this
252 heuristic algorithm can fail easily; in such cases it is necessary to
253 use the @code{line-width} music fragment option.
254
255 @cindex titling and lilypond-book
256 @cindex \header in @LaTeX{} documents
257
258 Each snippet will call the following macros if they have been defined by
259 the user:
260
261 @itemize @bullet
262 @item @code{\preLilyPondExample} called before the music,
263
264 @item @code{\postLilyPondExample} called after the music,
265
266 @item @code{\betweenLilyPondSystem[1]} is called between systems if
267 @code{lilypond-book} has split the snippet into several PostScript
268 files.  It must be defined as taking one parameter and will be
269 passed the number of files already included in this snippet.
270 The default is to simply insert a @code{\linebreak}.
271 @end itemize
272
273 @ignore
274 Broken stuff.  :(
275
276 @cindex Latex, feta symbols
277 @cindex fetachar
278
279 To include feta symbols (such as flat, segno, etc) in a LaTeX
280 document, use @code{\input@{titledefs@}}
281
282 @example
283 \documentclass[a4paper]@{article@}
284
285 \input@{titledefs@}
286
287 \begin@{document@}
288
289 \fetachar\fetasharp
290
291 \end@{document@}
292 @end example
293
294 The font symbol names are defined in the file feta20.tex; to find
295 the location of this file, use the command
296
297 @example
298 kpsewhich feta20.tex
299 @end example
300
301 @end ignore
302
303 @snippets
304
305 Sometimes it is useful to display music elements (such as ties and slurs)
306 as if they continued after the end of the fragment.  This can be done by
307 breaking the staff and suppressing inclusion of the rest of the LilyPond
308 output.
309
310 In @LaTeX{}, define @code{\betweenLilyPondSystem} in such a way that
311 inclusion of other systems is terminated once the required number of
312 systems are included.  Since @code{\betweenLilyPondSystem} is first
313 called @emph{after} the first system, including only the first system
314 is trivial.
315
316 @example
317 \def\betweenLilyPondSystem#1@{\endinput@}
318
319 \begin@{lilypond@}[fragment]
320   c'1\( e'( c'~ \break c' d) e f\)
321 \end@{lilypond@}
322 @end example
323
324 If a greater number of systems is requested, a @TeX{} conditional must
325 be used before the @code{\endinput}.  In this example, replace @q{2} by
326 the number of systems you want in the output.
327
328 @example
329 \def\betweenLilyPondSystem#1@{
330     \ifnum#1<2\else\expandafter\endinput\fi
331 @}
332 @end example
333
334 @noindent
335 (Since @code{\endinput} immediately stops the processing of the current
336 input file we need @code{\expandafter} to delay the call of @code{\endinput}
337 after executing @code{\fi} so that the @code{\if}-@code{\fi} clause is
338 balanced.)
339
340 Remember that the definition of @code{\betweenLilyPondSystem} is
341 effective until @TeX{} quits the current group (such as the @LaTeX{}
342 environment) or is overridden by another definition (which is, in
343 most cases, for the rest of the document).  To reset your
344 definition, write
345
346 @example
347 \let\betweenLilyPondSystem\undefined
348 @end example
349
350 @noindent
351 in your @LaTeX{} source.
352
353 This may be simplified by defining a @TeX{} macro
354
355 @example
356 \def\onlyFirstNSystems#1@{
357     \def\betweenLilyPondSystem##1@{%
358       \ifnum##1<#1\else\expandafter\endinput\fi@}
359 @}
360 @end example
361
362 @noindent
363 and then saying only how many systems you want before each fragment,
364
365 @example
366 \onlyFirstNSystems@{3@}
367 \begin@{lilypond@}...\end@{lilypond@}
368 \onlyFirstNSystems@{1@}
369 \begin@{lilypond@}...\end@{lilypond@}
370 @end example
371
372
373 @seealso
374 There are specific @command{lilypond-book} command line options and
375 other details to know when processing @LaTeX{} documents, see
376 @ref{Invoking lilypond-book}.
377
378
379 @node Texinfo
380 @subsection Texinfo
381 @untranslated
382
383 Texinfo is the standard format for documentation of the GNU project.  An
384 example of a Texinfo document is this manual.  The HTML, PDF, and Info
385 versions of the manual are made from the Texinfo document.
386
387 In the input file, music is specified with
388
389 @example
390 @@lilypond[options,go,here]
391   YOUR LILYPOND CODE
392 @@end lilypond
393 @end example
394
395 @noindent
396 or
397
398 @example
399 @@lilypond[options,go,here]@{ YOUR LILYPOND CODE @}
400 @end example
401
402 @noindent
403 or
404
405 @example
406 @@lilypondfile[options,go,here]@{@var{filename}@}
407 @end example
408
409 Additionally, @code{@@lilypondversion} displays the current version
410 of lilypond.
411
412 When @command{lilypond-book} is run on it, this results in a Texinfo
413 file (with extension @file{.texi}) containing @code{@@image} tags for
414 HTML, Info and printed output.  @command{lilypond-book} generates images
415 of the music in EPS and PDF formats for use in the printed output, and
416 in PNG format for use in HTML and Info output.
417
418 We show two simple examples here.  A @code{lilypond} environment
419
420 @example
421 @@lilypond[fragment]
422 c' d' e' f' g'2 g'
423 @@end lilypond
424 @end example
425
426 @noindent
427 produces
428
429 @lilypond[fragment]
430 c' d' e' f' g'2 g'
431 @end lilypond
432
433 The short version
434
435 @example
436 @@lilypond[fragment,staffsize=11]@{<c' e' g'>@}
437 @end example
438
439 @noindent
440 produces
441
442 @lilypond[fragment,staffsize=11]{<c' e' g'>}
443
444 Contrary to @LaTeX{}, @code{@@lilypond@{...@}} does not generate an
445 in-line image.  It always gets a paragraph of its own.
446
447
448 @node HTML
449 @subsection HTML
450 @untranslated
451
452 Music is entered using
453
454 @example
455 <lilypond fragment relative=2>
456 \key c \minor c4 es g2
457 </lilypond>
458 @end example
459
460 @noindent
461 @command{lilypond-book} then produces an HTML file with appropriate image
462 tags for the music fragments:
463
464 @lilypond[fragment,relative=2]
465 \key c \minor c4 es g2
466 @end lilypond
467
468 For inline pictures, use @code{<lilypond ... />}, where the options
469 are separated by a colon from the music, for example
470
471 @example
472 Some music in <lilypond relative=2: a b c/> a line of text.
473 @end example
474
475 To include separate files, say
476
477 @example
478 <lilypondfile @var{option1} @var{option2} ...>@var{filename}</lilypondfile>
479 @end example
480
481 For a list of options to use with the @code{lilypond} or
482 @code{lilypondfile} tags, see @ref{Music fragment options}.
483
484 Additionally, @code{<lilypondversion/>} displays the current version
485 of lilypond.
486
487
488 @cindex titling in HTML
489 @cindex preview image
490 @cindex thumbnail
491
492 @node DocBook
493 @subsection DocBook
494 @untranslated
495
496 For inserting LilyPond snippets it is good to keep the conformity of our
497 DocBook document, thus allowing us to use DocBook editors, validation
498 etc.  So we don't use custom tags, only specify a convention based on the
499 standard DocBook elements.
500
501 @subheading Common conventions
502
503 For inserting all type of snippets we use the @code{mediaobject} and
504 @code{inlinemediaobject} element, so our snippets can be formatted
505 inline or not inline.  The snippet formatting options are always
506 provided in the @code{role} property of the innermost element (see in
507 next sections).  Tags are chosen to allow DocBook editors format the
508 content gracefully.  The DocBook files to be processed with
509 @command{lilypond-book} should have the extension @file{.lyxml}.
510
511 @subheading Including a LilyPond file
512
513 This is the most simple case.  We must use the @file{.ly} extension for
514 the included file, and insert it as a standard @code{imageobject}, with
515 the following structure:
516
517 @example
518 <mediaobject>
519   <imageobject>
520     <imagedata fileref="music1.ly" role="printfilename" />
521   </imageobject>
522 </mediaobject>
523 @end example
524
525 Note that you can use @code{mediaobject} or @code{inlinemediaobject}
526 as the outermost element as you wish.
527
528 @subheading Including LilyPond code
529
530 Including LilyPond code is possible by using a @code{programlisting},
531 where the language is set to @code{lilypond} with the following
532 structure:
533
534 @example
535 <inlinemediaobject>
536   <textobject>
537     <programlisting language="lilypond" role="fragment verbatim staffsize=16 ragged-right relative=2">
538 \context Staff \with @{
539   \remove "Time_signature_engraver"
540   \remove "Clef_engraver"@}
541   @{ c4( fis) @}
542     </programlisting>
543   </textobject>
544 </inlinemediaobject>
545 @end example
546
547 As you can see, the outermost element is a @code{mediaobject} or
548 @code{inlinemediaobject}, and there is a @code{textobject} containing
549 the @code{programlisting} inside.
550
551 @subheading Processing the DocBook document
552
553 Running @command{lilypond-book} on our @file{.lyxml} file will create a
554 valid DocBook document to be further processed with @file{.xml}
555 extension.  If you use
556 @uref{http://@/dblatex@/.sourceforge@/.net@/,dblatex}, it will create a
557 PDF file from this document automatically.  For HTML (HTML Help,
558 JavaHelp etc.) generation you can use the official DocBook XSL
559 stylesheets, however, it is possible that you have to make some
560 customization for it.
561
562
563 @node Kottapéldák paraméterei
564 @section Kottapéldák paraméterei
565 @translationof Music fragment options
566 @untranslated
567
568 In the following, a @q{LilyPond command} refers to any command described
569 in the previous sections which is handled by @command{lilypond-book} to
570 produce a music snippet.  For simplicity, LilyPond commands are only
571 shown in @LaTeX{} syntax.
572
573 Note that the option string is parsed from left to right; if an option
574 occurs multiple times, the last one is taken.
575
576 The following options are available for LilyPond commands:
577
578 @table @code
579 @item staffsize=@var{ht}
580 Set staff size to @var{ht}, which is measured in points.
581
582 @item ragged-right
583 Produce ragged-right lines with natural spacing, i.e.,
584 @code{ragged-right = ##t} is added to the LilyPond snippet.  This is the
585 default for the @code{\lilypond@{@}} command if no @code{line-width}
586 option is present.  It is also the default for the @code{lilypond}
587 environment if the @code{fragment} option is set, and no line width is
588 explicitly specified.
589
590 @item noragged-right
591 For single-line snippets, allow the staff length to be stretched to
592 equal that of the line width, i.e., @code{ragged-right = ##f} is
593 added to the LilyPond snippet.
594
595 @item line-width
596 @itemx line-width=@var{size}\@var{unit}
597 Set line width to @var{size}, using @var{unit} as units.  @var{unit} is
598 one of the following strings: @code{cm}, @code{mm}, @code{in}, or
599 @code{pt}.  This option affects LilyPond output (this is, the staff
600 length of the music snippet), not the text layout.
601
602 If used without an argument, set line width to a default value (as
603 computed with a heuristic algorithm).
604
605 If no @code{line-width} option is given, @command{lilypond-book} tries to
606 guess a default for @code{lilypond} environments which don't use the
607 @code{ragged-right} option.
608
609 @item notime
610 Do not print the time signature, and turns off the timing (time signature,
611 bar lines) in the score.
612
613 @item fragment
614 Make @command{lilypond-book} add some boilerplate code so that you can
615 simply enter, say,
616
617 @example
618 c'4
619 @end example
620
621 @noindent
622 without @code{\layout}, @code{\score}, etc.
623
624 @item nofragment
625 Do not add additional code to complete LilyPond code in music snippets.
626 Since this is the default, @code{nofragment} is redundant normally.
627
628 @item indent=@var{size}\@var{unit}
629 Set indentation of the first music system to @var{size}, using
630 @var{unit} as units.  @var{unit} is one of the following strings:
631 @code{cm}, @code{mm}, @code{in}, or @code{pt}.  This option affects
632 LilyPond, not the text layout.
633
634 @item noindent
635 Set indentation of the first music system to zero.  This option affects
636 LilyPond, not the text layout.  Since no indentation is the default,
637 @code{noindent} is redundant normally.
638
639 @item quote
640 Reduce line length of a music snippet by @math{2*0.4}@dmn{in} and put
641 the output into a quotation block.  The value @q{0.4@dmn{in}} can be
642 controlled with the @code{exampleindent} option.
643
644 @item exampleindent
645 Set the amount by which the @code{quote} option indents a music snippet.
646
647 @item relative
648 @itemx relative=@var{n}
649 Use relative octave mode.  By default, notes are specified relative to
650 middle@tie{}C.  The optional integer argument specifies the octave of
651 the starting note, where the default @code{1} is middle C.
652 @code{relative} option only works when @code{fragment} option is set,
653 so @code{fragment} is automatically implied by @code{relative},
654 regardless of the presence of any @code{(no)fragment} option in the
655 source.
656 @end table
657
658 LilyPond also uses @command{lilypond-book} to produce its own
659 documentation.  To do that, some more obscure music fragment options are
660 available.
661
662 @table @code
663 @item verbatim
664 The argument of a LilyPond command is copied to the output file and
665 enclosed in a verbatim block, followed by any text given with the
666 @code{intertext} option (not implemented yet); then the actual music is
667 displayed.  This option does not work well with @code{\lilypond@{@}} if
668 it is part of a paragraph.
669
670 If @code{verbatim} is used in a @code{lilypondfile} command, it is
671 possible to enclose verbatim only a part of the source file.  If the
672 source file contain a comment containing @samp{begin verbatim} (without
673 quotes), quoting the source in the verbatim block will start after the
674 last occurrence of such a comment; similarly, quoting the source verbatim
675 will stop just before the first occurrence of a comment containing
676 @samp{end verbatim}, if there is any.  In the following source file
677 example, the music will be interpreted in relative mode, but the
678 verbatim quote will not show the @code{relative} block, i.e.
679
680 @example
681 \relative @{ % begin verbatim
682   c'4 e2 g4
683   f2 e % end verbatim
684 @}
685 @end example
686
687 @noindent
688 will be printed with a verbatim block like
689
690 @example
691   c4 e2 g4
692   f2 e
693 @end example
694
695 @noindent
696 If you would like to translate comments and variable names in verbatim
697 output but not in the sources, you may set the environment variable
698 @code{LYDOC_LOCALEDIR} to a directory path; the directory should
699 contain a tree of @file{.mo} message catalogs with @code{lilypond-doc}
700 as a domain.
701
702 @item addversion
703 (Only for Texinfo output.)  Prepend line @code{\version
704 @@w@{"@@version@{@}"@}} to @code{verbatim} output.
705
706 @item texidoc
707 (Only for Texinfo output.)  If @command{lilypond} is called with the
708 @option{--header=@/texidoc} option, and the file to be processed is
709 called @file{foo.ly}, it creates a file @file{foo.texidoc} if there
710 is a @code{texidoc} field in the @code{\header}.  The @code{texidoc}
711 option makes @command{lilypond-book} include such files, adding its
712 contents as a documentation block right before the music snippet.
713
714 Assuming the file @file{foo.ly} contains
715
716 @example
717 \header @{
718   texidoc = "This file demonstrates a single note."
719 @}
720 @{ c'4 @}
721 @end example
722
723 @noindent
724 and we have this in our Texinfo document @file{test.texinfo}
725
726 @example
727 @@lilypondfile[texidoc]@{foo.ly@}
728 @end example
729
730 @noindent
731 the following command line gives the expected result
732
733 @example
734 lilypond-book --pdf --process="lilypond \
735   -dbackend=eps --header=texidoc" test.texinfo
736 @end example
737
738 Most LilyPond test documents (in the @file{input} directory of the
739 distribution) are small @file{.ly} files which look exactly like this.
740
741 For localization purpose, if the Texinfo document contains
742 @code{@@documentlanguage @var{LANG}} and @file{foo.ly} header
743 contains a @code{texidoc@var{LANG}} field, and if @command{lilypond}
744 is called with @option{--header=@/texidoc@var{LANG}}, then
745 @file{foo.texidoc@var{LANG}} will be included instead of
746 @file{foo.texidoc}.
747
748 @item doctitle
749 (Only for Texinfo output.) This option works similarly to
750 @code{texidoc} option: if @command{lilypond} is called with the
751 @option{--header=@/doctitle} option, and the file to be processed is
752 called @file{foo.ly} and contains a @code{doctitle} field in the
753 @code{\header}, it creates a file @file{foo.doctitle}.  When
754 @code{doctitle} option is used, the contents of @file{foo.doctitle},
755 which should be a single line of @var{text}, is inserted in the
756 Texinfo document as @code{@@lydoctitle @var{text}}.
757 @code{@@lydoctitle} should be a macro defined in the Texinfo document.
758 The same remark about @code{texidoc} processing with localized
759 languages also applies to @code{doctitle}.
760
761 @item nogettext
762 (Only for Texinfo output.) Do not translate comments and variable
763 names in the snippet quoted verbatim.
764
765 @item printfilename
766 If a LilyPond input file is included with @code{\lilypondfile}, print
767 the file name right before the music snippet.  For HTML output, this
768 is a link.  Only the base name of the file is printed, i.e. the
769 directory part of the file path is stripped.
770
771 @end table
772
773
774 @node A lilypond-book futtatása
775 @section A @command{lilypond-book} futtatása
776 @translationof Invoking lilypond-book
777 @untranslated
778
779 @command{lilypond-book} produces a file with one of the following
780 extensions: @file{.tex}, @file{.texi}, @file{.html} or @file{.xml},
781 depending on the output format.  All of @file{.tex}, @file{.texi} and
782 @file{.xml} files need further processing.
783
784 @subheading Format-specific instructions
785
786 @subsubheading @LaTeX{}
787
788 There are two ways of processing your @LaTeX{} document for printing or
789 publishing: getting a PDF file directly with PDF@LaTeX{}, or getting a
790 PostScript file with @LaTeX{} via a DVI to PostScript translator like
791 @command{dvips}.  The first way is simpler and recommended@footnote{Note
792 that PDF@LaTeX{} and @LaTeX{} may not be both usable to compile any
793 @LaTeX{} document, that is why we explain the two ways.}, and whichever
794 way you use, you can easily convert between PostScript and PDF with
795 tools, like @command{ps2pdf} and @command{pdf2ps} included in
796 Ghostscript package.
797
798 To produce a PDF file through PDF@LaTeX{}, use
799
800 @example
801 lilypond-book --pdf yourfile.lytex
802 pdflatex yourfile.tex
803 @end example
804
805 @cindex outline fonts
806 @cindex type1 fonts
807 @cindex dvips
808 @cindex invoking dvips
809 To produce PDF output via @LaTeX{}/@command{dvips}/@command{ps2pdf}, you
810 should do
811
812 @example
813 lilypond-book yourfile.lytex
814 latex yourfile.tex
815 dvips -Ppdf yourfile.dvi
816 ps2pdf yourfile.ps
817 @end example
818
819 @noindent
820 The @file{.dvi} file created by this process will not contain
821  note heads.  This is normal; if you follow the instructions, they
822 will be included in the @file{.ps} and @file{.pdf} files.
823
824 Running @command{dvips} may produce some warnings about fonts; these
825 are harmless and may be ignored.  If you are running @command{latex} in
826 twocolumn mode, remember to add @code{-t landscape} to the
827 @command{dvips} options.
828
829 @subsubheading Texinfo
830
831 To produce a Texinfo document (in any output format), follow the normal
832 procedures for Texinfo; this is, either call @command{texi2pdf} or
833 @command{texi2dvi} or @command{makeinfo}, depending on the output format
834 you want to create.
835 @ifinfo
836 @xref{Format with texi2dvi, , , texinfo, GNU Texinfo}, and @ref{Creating
837 an Info File, , , texinfo, GNU Texinfo}.
838 @end ifinfo
839 @ifnotinfo
840 See the documentation of Texinfo for further details.
841 @end ifnotinfo
842
843
844 @subheading Command line options
845
846 @command{lilypond-book} accepts the following command line options:
847
848 @table @code
849 @item -f @var{format}
850 @itemx --format=@var{format}
851 Specify the document type to process: @code{html}, @code{latex},
852 @code{texi} (the default) or @code{docbook}.  If this option is missing,
853 @command{lilypond-book} tries to detect the format automatically, see
854 @ref{Filename extensions}.  Currently, @code{texi} is the same as
855 @code{texi-html}.
856
857 @c This complicated detail is not implemented, comment it out -jm
858 @ignore
859 The @code{texi} document type produces a Texinfo file with music
860 fragments in the printed output only.  For getting images in the HTML
861 version, the format @code{texi-html} must be used instead.
862 @end ignore
863
864 @item -F @var{filter}
865 @itemx --filter=@var{filter}
866 Pipe snippets through @var{filter}.  @code{lilypond-book} will
867 not --filter and --process at the same time.  For example,
868
869 @example
870 lilypond-book --filter='convert-ly --from=2.0.0 -' my-book.tely
871 @end example
872
873 @item -h
874 @itemx --help
875 Print a short help message.
876
877 @item -I @var{dir}
878 @itemx --include=@var{dir}
879 Add @var{dir} to the include path.  @command{lilypond-book} also looks
880 for already compiled snippets in the include path, and does not write
881 them back to the output directory, so in some cases it is necessary to
882 invoke further processing commands such as @command{makeinfo} or
883 @command{latex} with the same @code{-I @var{dir}} options.
884
885 @item -o @var{dir}
886 @itemx --output=@var{dir}
887 Place generated files in directory @var{dir}.  Running
888 @command{lilypond-book} generates lots of small files that LilyPond will
889 process.  To avoid all that garbage in the source directory, use the
890 @option{--output} command line option, and change to that directory
891 before running @command{latex} or @command{makeinfo}.
892
893 @example
894 lilypond-book --output=out yourfile.lytex
895 cd out
896 ...
897 @end example
898
899 @itemx --skip-lily-check
900 Do not fail if no lilypond output is found.  It is used for LilyPond
901 Info documentation without images.
902
903 @itemx --skip-png-check
904 Do not fail if no PNG images are found for EPS files.  It is used for
905 LilyPond Info documentation without images.
906
907 @itemx --lily-output-dir=@var{dir}
908 Write lily-XXX files to directory @var{dir}, link into @code{--output}
909 directory.  Use this option to save building time for documents in
910 different directories which share a lot of identical snippets.
911
912 @itemx --info-images-dir=@var{dir}
913 Format Texinfo output so that Info will look for images of music in
914 @var{dir}.
915
916 @itemx --latex-program=@var{prog}
917 Run executable @command{prog} instead of @command{latex}.  This is
918 useful if your document is processed with @command{xelatex}, for
919 example.
920
921 @itemx --left-padding=@var{amount}
922 Pad EPS boxes by this much.  @var{amount} is measured in millimeters,
923 and is 3.0 by default.  This option should be used if the lines of
924 music stick out of the right margin.
925
926 The width of a tightly clipped system can vary, due to notation
927 elements that stick into the left margin, such as bar numbers and
928 instrument names.  This option will shorten each line and move each
929 line to the right by the same amount.
930
931 @item -P @var{command}
932 @itemx --process=@var{command}
933 Process LilyPond snippets using @var{command}.  The default command is
934 @code{lilypond}.  @code{lilypond-book} will not @code{--filter} and
935 @code{--process} at the same time.
936
937 @item --pdf
938 Create PDF files for use with PDF@LaTeX{}.
939
940 @itemx --use-source-file-names
941 Write snippet output files with the same base name as their source file.
942 This option works only for snippets included with @code{lilypondfile}
943 and only if directories implied by @code{--output-dir} and
944 @code{--lily-output-dir} options are different.
945
946 @item -V
947 @itemx --verbose
948 Be verbose.
949
950 @item -v
951 @itemx --version
952 Print version information.
953 @end table
954
955 @knownissues
956
957 The Texinfo command @code{@@pagesizes} is not interpreted.  Similarly,
958 @LaTeX{} commands that change margins and line widths after the preamble
959 are ignored.
960
961 Only the first @code{\score} of a LilyPond block is processed.
962
963
964 @node Fájlkiterjesztések
965 @section Fájlkiterjesztések
966 @translationof Filename extensions
967 @untranslated
968
969 You can use any filename extension for the input file, but if you do not
970 use the recommended extension for a particular format you may need to
971 manually specify the output format; for details, see @ref{Invoking
972 lilypond-book}.  Otherwise, @command{lilypond-book} automatically
973 selects the output format based on the input filename's extension.
974
975 @quotation
976 @multitable @columnfractions .2 .5
977 @item @strong{extension} @tab @strong{output format}
978 @item
979 @item @file{.html} @tab HTML
980 @item @file{.htmly} @tab HTML
981 @item @file{.itely} @tab Texinfo
982 @item @file{.latex} @tab @LaTeX{}
983 @item @file{.lytex} @tab @LaTeX{}
984 @item @file{.lyxml} @tab DocBook
985 @item @file{.tely} @tab Texinfo
986 @item @file{.tex} @tab @LaTeX{}
987 @item @file{.texi} @tab Texinfo
988 @item @file{.texinfo} @tab Texinfo
989 @item @file{.xml} @tab HTML
990 @end multitable
991 @end quotation
992
993 If you use the same filename extension for the input file than the
994 extension @command{lilypond-book} uses for the output file, and if the
995 input file is in the same directory as @command{lilypond-book} working
996 directory, you must use @code{--output} option to make
997 @command{lilypond-book} running, otherwise it will exit with an error
998 message like @qq{Output would overwrite input file}.
999
1000
1001 @node lilypond-book sablonok
1002 @section lilypond-book sablonok
1003 @translationof lilypond-book templates
1004 @untranslated
1005
1006 These templates are for use with @code{lilypond-book}.  If you're not familiar
1007 with this program, please refer to
1008 @ref{lilypond-book}.
1009
1010 @subsection LaTeX
1011
1012 You can include LilyPond fragments in a LaTeX document.
1013
1014 @example
1015 \documentclass[]@{article@}
1016
1017 \begin@{document@}
1018
1019 Normal LaTeX text.
1020
1021 \begin@{lilypond@}
1022 \relative @{
1023   a'4 b c d
1024 @}
1025 \end@{lilypond@}
1026
1027 More LaTeX text, and options in square brackets.
1028
1029 \begin@{lilypond@}[fragment,relative=2,quote,staffsize=26,verbatim]
1030 d4 c b a
1031 \end@{lilypond@}
1032 \end@{document@}
1033 @end example
1034
1035 @subsection Texinfo
1036
1037 You can include LilyPond fragments in Texinfo; in fact, this entire manual
1038 is written in Texinfo.
1039
1040 @example
1041 \input texinfo @c -*-texinfo-*-
1042 @@node Top
1043 @@top
1044
1045 Texinfo text
1046
1047 @@lilypond
1048 \relative @{
1049   a4 b c d
1050 @}
1051 @@end lilypond
1052
1053 More Texinfo text, and options in brackets.
1054
1055 @@lilypond[verbatim,fragment,ragged-right]
1056 d4 c b a
1057 @@end lilypond
1058
1059 @@bye
1060 @end example
1061
1062
1063 @subsection html
1064
1065 @example
1066 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
1067 <!-- header_tag -->
1068 <HTML>
1069 <body>
1070
1071 <p>
1072 Documents for lilypond-book may freely mix music and text.  For
1073 example,
1074 <lilypond>
1075 \relative @{
1076   a'4 b c d
1077 @}
1078 </lilypond>
1079 </p>
1080
1081 <p>
1082 Another bit of lilypond, this time with options:
1083
1084 <lilypond fragment quote staffsize=26 verbatim>
1085 a4 b c d
1086 </lilypond>
1087 </p>
1088
1089 </body>
1090 </html>
1091
1092
1093 @end example
1094
1095 @subsection xelatex
1096
1097 @verbatim
1098 \documentclass{article}
1099 \usepackage{ifxetex}
1100 \ifxetex
1101 %xetex specific stuff
1102 \usepackage{xunicode,fontspec,xltxtra}
1103 \setmainfont[Numbers=OldStyle]{Times New Roman}
1104 \setsansfont{Arial}
1105 \else
1106 %This can be empty if you are not going to use pdftex
1107 \usepackage[T1]{fontenc}
1108 \usepackage[utf8]{inputenc}
1109 \usepackage{mathptmx}%Times
1110 \usepackage{helvet}%Helvetica
1111 \fi
1112 %Here you can insert all packages that pdftex also understands
1113 \usepackage[ngerman,finnish,english]{babel}
1114 \usepackage{graphicx}
1115
1116 \begin{document}
1117 \title{A short document with LilyPond and xelatex}
1118 \maketitle
1119
1120 Normal \textbf{font} commands inside the \emph{text} work,
1121 because they \textsf{are supported by \LaTeX{} and XeteX.}
1122 If you want to use specific commands like \verb+\XeTeX+, you
1123 should include them again in a \verb+\ifxetex+ environment.
1124 You can use this to print the \ifxetex \XeTeX{} command \else
1125 XeTeX command \fi which is not known to normal \LaTeX .
1126
1127 In normal text you can easily use LilyPond commands, like this:
1128
1129 \begin{lilypond}
1130 {a2 b c'8 c' c' c'}
1131 \end{lilypond}
1132
1133 \noindent
1134 and so on.
1135
1136 The fonts of snippets set with LilyPond will have to be set from
1137 inside
1138 of the snippet.  For this you should read the AU on how to use
1139 lilypond-book.
1140
1141 \selectlanguage{ngerman}
1142 Auch Umlaute funktionieren ohne die \LaTeX -Befehle, wie auch alle
1143 anderen
1144 seltsamen Zeichen: __ ______, wenn sie von der Schriftart
1145 unterst__tzt werden.
1146 \end{document}
1147 @end verbatim
1148
1149
1150 @node Közös tartalomjegyzék
1151 @section Közös tartalomjegyzék
1152 @translationof Sharing the table of contents
1153 @untranslated
1154
1155 These functions already exist in the OrchestralLily package:
1156
1157 @example
1158 @url{http://repo.or.cz/w/orchestrallily.git}
1159 @end example
1160
1161 For greater flexibility in text handling, some users prefer to
1162 export the table of contents from lilypond and read it into
1163 @LaTeX{}.
1164
1165 @subsubheading Exporting the ToC from LilyPond
1166
1167 This assumes that your score has multiple movements in the same lilypond
1168 output file.
1169
1170 @smallexample
1171 #(define (oly:create-toc-file layout pages)
1172   (let* ((label-table (ly:output-def-lookup layout 'label-page-table)))
1173     (if (not (null? label-table))
1174       (let* ((format-line (lambda (toc-item)
1175              (let* ((label (car toc-item))
1176                     (text  (caddr toc-item))
1177                     (label-page (and (list? label-table)
1178                                      (assoc label label-table)))
1179                     (page (and label-page (cdr label-page))))
1180                (format #f "~a, section, 1, @{~a@}, ~a" page text label))))
1181              (formatted-toc-items (map format-line (toc-items)))
1182              (whole-string (string-join formatted-toc-items ",\n"))
1183              (output-name (ly:parser-output-name parser))
1184              (outfilename (format "~a.toc" output-name))
1185              (outfile (open-output-file outfilename)))
1186         (if (output-port? outfile)
1187             (display whole-string outfile)
1188             (ly:warning (_ "Unable to open output file ~a for the TOC information") outfilename))
1189         (close-output-port outfile)))))
1190
1191 \paper @{
1192   #(define (page-post-process layout pages) (oly:create-toc-file layout pages))
1193 @}
1194 @end smallexample
1195
1196 @subsubheading Importing the ToC into LaTeX
1197
1198 In LaTeX, the header should include:
1199
1200 @c no, this doesn't require the smallexample, but since the other
1201 @c two blocks on this page use it, I figured I might as well
1202 @c user it here as well, for consistency. -gp
1203 @smallexample
1204 \usepackage@{pdfpages@}
1205 \includescore@{nameofthescore@}
1206 @end smallexample
1207
1208 @noindent
1209 where @code{\includescore} is defined as:
1210
1211 @smallexample
1212 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1213 % \includescore@{PossibleExtension@}
1214 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1215
1216 % Read in the TOC entries for a PDF file from the corresponding .toc file.
1217 % This requires some heave latex tweaking, since reading in things from a file
1218 % and inserting it into the arguments of a macro is not (easily) possible
1219
1220 % Solution by Patrick Fimml on #latex on April 18, 2009:
1221 % \readfile@{filename@}@{\variable@}
1222 % reads in the contents of the file into \variable (undefined if file
1223 % doesn't exist)
1224 \newread\readfile@@f
1225 \def\readfile@@line#1@{%
1226 @{\catcode`\^^M=10\global\read\readfile@@f to \readfile@@tmp@}%
1227 \edef\do@{\noexpand\g@@addto@@macro@{\noexpand#1@}@{\readfile@@tmp@}@}\do%
1228 \ifeof\readfile@@f\else%
1229 \readfile@@line@{#1@}%
1230 \fi%
1231 @}
1232 \def\readfile#1#2@{%
1233 \openin\readfile@@f=#1 %
1234 \ifeof\readfile@@f%
1235 \typeout@{No TOC file #1 available!@}%
1236 \else%
1237 \gdef#2@{@}%
1238 \readfile@@line@{#2@}%
1239 \fi
1240 \closein\readfile@@f%
1241 @}%
1242
1243
1244 \newcommand@{\includescore@}[1]@{
1245 \def\oly@@fname@{\oly@@basename\@@ifmtarg@{#1@}@{@}@{_#1@}@}
1246 \let\oly@@addtotoc\undefined
1247 \readfile@{\oly@@xxxxxxxxx@}@{\oly@@addtotoc@}
1248 \ifx\oly@@addtotoc\undefined
1249 \includepdf[pages=-]@{\oly@@fname@}
1250 \else
1251 \edef\includeit@{\noexpand\includepdf[pages=-,addtotoc=@{\oly@@addtotoc@}]
1252 @{\oly@@fname@}@}\includeit
1253 \fi
1254 @}
1255 @end smallexample
1256
1257
1258 @node További módszerek zene és szöveg kombinálására
1259 @section További módszerek zene és szöveg kombinálására
1260 @translationof Alternate methods of mixing text and music
1261 @untranslated
1262
1263 Other means of mixing text and music (without
1264 @command{lilypond-book}) are discussed in
1265 @ref{LilyPond output in other programs}.
1266
1267