From: Han-Wen Nienhuys Date: Fri, 29 Aug 2003 21:23:49 +0000 (+0000) Subject: rename ly2dvi.py to lilypond.py X-Git-Tag: release/1.9.6~52 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=f160a5aa08dcda1077a3f446efcf489cd0c8e03e;p=lilypond.git rename ly2dvi.py to lilypond.py set PDF as default, and always make PDF. --- diff --git a/ChangeLog b/ChangeLog index 2caec396a2..4796f798b2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,7 @@ 2003-08-29 Han-Wen Nienhuys * scripts/lilypond.py: rename ly2dvi.py to lilypond.py + set PDF as default, and always make PDF. * lily/GNUmakefile (SUBDIRS): rename binary to lilypond-bin diff --git a/Documentation/user/invoking.itexi b/Documentation/user/invoking.itexi index 4360324fff..ec7ec87f0c 100644 --- a/Documentation/user/invoking.itexi +++ b/Documentation/user/invoking.itexi @@ -6,13 +6,199 @@ This chapter details the technicalities of running LilyPond. @menu +* Invoking lilypond:: Titling LilyPond scores. * Invoking the lilypond binary:: * Error messages:: * Reporting bugs:: * Point and click:: -* Invoking ly2dvi:: Titling LilyPond scores. @end menu +@node Invoking lilypond +@section Invoking lilypond + +Nicely titled output is created through a separate program: +@file{@code{lilypond}} is a script that uses the LilyPond formatting +engine (which is in a separate program) and La@TeX{} to create a +nicely titled piece of sheet music, in PDF (Portable Document Format) +format. + +@example + @code{lilypond} [@var{option}]@dots{} @var{file}@dots{} +@end example + +To have @code{lilypond} read from stdin, use a dash @code{-} for @var{file}. + +The @code{lilypond} program supports the following options: + +@table @code +@item -k,--keep + Keep the temporary directory with all output +files. The temporary directory is created in the current directory as @code{@code{lilypond}.dir}. +@item -d,--dependencies + Write @code{Makefile} dependencies for every input file. +@item -h,--help + Print usage help. +@item -I,--include=@var{dir} + Add @var{dir} to LilyPond's include path. +@item -m,--no-paper + Produce MIDI output only. +@item --no-lily + Do not run @file{lilypond-bin}. Useful for debugging @code{lilypond}. +@item -o,--output=@var{file} + Generate output to @var{file}. The extension of @var{file} is ignored. +@item --no-pdf + Do not generate (PDF) or PS. + +@cindex PDF +@cindex Scalable fonts + +@c why is this comment here? --hwn + + If you use lilypond-book or your own wrapper files, do not use +@code{\usepackage[[T1]@{fontenc@}} in the file header but do not forget +@code{\usepackage[latin1]@{inputenc@}} if you use any other +non-anglosaxian characters. + +@item --png + Also generate pictures of each page, in PNG format. +@item --psgz + Gzip the postscript file. +@item --html + Make a .HTML file with links to all output files. +@item --preview + Also generate a picture of the first system of the score. + +@cindex preview +@cindex picture +@cindex bitmap +@cindex pixmap +@cindex thumbnail +@cindex screenshot + +@item -s,--set=@var{key}=@var{val} + Add @var{key}= @var{val} to the settings, overriding those specified +in the files. Possible keys: @code{language}, @code{latexheaders}, +@code{latexpackages}, @code{latexoptions}, @code{papersize}, +@code{pagenumber}, @code{linewidth}, @code{orientation}, +@code{textheight}. +@item -v,--version +Show version information. +@item -V,--verbose +Be verbose. +@item --debug +Print even more information. This is useful when generating bugreports. +@item -w,--warranty +Show the warranty with which GNU LilyPond comes. (It comes with +@strong{NO WARRANTY}!) +@end table + +@subsection Titling layout + +@code{lilypond} extracts the following header fields from the LY files +to generate titling; an example demonstrating all these fields is in +@inputfileref{input/test,ly2dvi-testpage.ly}: + +@table @code +@item title + The title of the music. Centered on top of the first page. +@item subtitle + Subtitle, centered below the title. +@item poet + Name of the poet, left flushed below the subtitle. +@item composer + Name of the composer, right flushed below the subtitle. +@item meter + Meter string, left flushed below the poet. +@item opus + Name of the opus, right flushed below the composer. +@item arranger + Name of the arranger, right flushed below the opus. +@item instrument + Name of the instrument, centered below the arranger. +@item dedication + To whom the piece is dedicated. +@item piece + Name of the piece, left flushed below the instrument. +@item head + A text to print in the header of all pages. It is not called +@code{header}, because @code{\header} is a reserved word in LilyPond. +@item copyright + A text to print in the footer of the first page. Default is to + print the standard footer also on the first page. +@item footer + A text to print in the footer of all but the last page. +@item tagline + Line to print at the bottom of last page. The default text is ``Lily +was here, @var{version-number}''. +@end table + + +@cindex header +@cindex footer +@cindex page layout +@cindex titles + + + +@subsection Additional parameters + +The @code{lilypond} program responds to several parameters specified +in a @code{\paper} section of the input file. They can be overridden +by supplying a @code{--set} command line option. + +@table @code +@item language + Specify La@TeX{} language: the @code{babel} package will be +included. Default: unset. + + Read from the @code{\header} block. + +@item latexheaders + Specify additional La@TeX{} headers file. + + Normally read from the @code{\header} block. Default value: empty. + +@item latexpackages + Specify additional La@TeX{} packages file. This works cumulative, +so you can add multiple packages using multiple @code{-s=latexpackages} options. + Normally read from the @code{\header} block. Default value: +@code{geometry}. + +@item latexoptions + Specify additional options for the La@TeX{} +@code{\documentclass}. You can put any valid value here. This was +designed to allow @code{lilypond} to produce output for double-sided +paper, with balanced margins and pagenumbers on alternating sides. To +achieve this specify @code{twoside}. + +@item orientation + Set orientation. Choices are @code{portrait} or @code{landscape}. Is +read from the @code{\paper} block, if set. + +@item textheight + The vertical extension of the music on the page. It is normally + calculated automatically, based on the paper size. + +@item linewidth + The music line width. It is normally read from the @code{\paper} +block. + +@item papersize + The paper size (as a name, e.g. @code{a4}). It is normally read from +the @code{\paper} block. + +@item pagenumber + If set to @code{no}, no page numbers will be printed. If set to a +positive integer, start with this value as the first page number. + + + @item fontenc + The font encoding, should be set identical to the @code{font-encoding} + property in the score. +@end table + + + @node Invoking the lilypond binary @section Invoking the lilypond binary @cindex Invoking LilyPond @@ -24,8 +210,9 @@ This chapter details the technicalities of running LilyPond. The LilyPond system consists of two parts: a binary executable, which is responsible for the formatting functionality, and support scripts, which post-process the resulting output. Normally, the support scripts -are called, which in turn invoke the @code{lilypond-bin} binary. However, -@code{lilypond-bin} may be called directly as follows. +are called, which in turn invoke the @code{lilypond-bin} +binary. However, @code{lilypond-bin} may be called directly as +follows. @example lilypond-bin [@var{option}]@dots{} @var{file}@dots{} @@ -43,7 +230,7 @@ block, then the rest of the scores will be output in numbered files, starting with @file{filename-1.tex}. Several files can be specified; they will each be processed independently. @footnote{The status of GUILE is not reset across invocations, so be careful not to change any - default settings from within Scheme.} + system defaults from within Scheme.} @section Command line options @@ -63,7 +250,7 @@ information. @c @c Output format for sheet music. Choices are @code{tex} (for @TeX{} -output, to be processed with plain @TeX{}, or through ly2dvi), +output, to be processed with plain @TeX{}, or through @code{lilypond}), @code{pdftex} for PDF@TeX{} input, @code{ps} (for PostScript), @code{scm} (for a Scheme dump), @code{sk} (for Sketch) and @code{as} (for ASCII-art). @@ -413,189 +600,3 @@ are harmless, and can be ignored. -@node Invoking ly2dvi -@section Invoking ly2dvi - -Nicely titled output is created through a separate program: -@file{ly2dvi} is a script that uses LilyPond and La@TeX{} to create a -nicely titled piece of sheet music, in DVI format or PostScript: - -@example - ly2dvi [@var{option}]@dots{} @var{file}@dots{} -@end example - -To have ly2dvi read from stdin, use a dash @code{-} for @var{file}. - -Ly2dvi supports the following options: - -@table @code -@item -k,--keep - Keep the temporary directory including LilyPond and ly2dvi output -files. The temporary directory is created in the current directory as @code{ly2dvi.dir}. -@item -d,--dependencies - Write @code{Makefile} dependencies for every input file. -@item -h,--help - Print usage help. -@item -I,--include=@var{dir} - Add @var{dir} to LilyPond's include path. -@item -m,--no-paper - Produce MIDI output only. -@item --no-lily - Do not run LilyPond; useful for debugging ly2dvi. -@item -o,--output=@var{file} - Generate output to @var{file}. The extension of @var{file} is ignored. -@item -P,--postscript - Also generate PostScript output, using dvips. The postscript uses -the standard @TeX{} bitmap fonts for your printer. -@item -p,--pdf - Also generate Portable Document Format (PDF). This option will -generate a PS file using scalable fonts, and will run the PS file -through @code{ps2pdf} producing a PDF file. - -@cindex PDF -@cindex Scalable fonts - - If you use lilypond-book or your own wrapper files, do not use -@code{\usepackage[[T1]@{fontenc@}} in the file header but do not forget -@code{\usepackage[latin1]@{inputenc@}} if you use any other -non-anglosaxian characters. - -@item --png - Also generate pictures of each page, in PNG format. -@item --psgz - Gzip the postscript file. -@item --html - Make a .HTML file with links to all output files. -@item --preview - Also generate a picture of the first system of the score. - -@cindex preview -@cindex picture -@cindex bitmap -@cindex pixmap -@cindex thumbnail -@cindex screenshot - -@item -s,--set=@var{key}=@var{val} - Add @var{key}= @var{val} to the settings, overriding those specified -in the files. Possible keys: @code{language}, @code{latexheaders}, -@code{latexpackages}, @code{latexoptions}, @code{papersize}, -@code{pagenumber}, @code{linewidth}, @code{orientation}, -@code{textheight}. -@item -v,--version -Show version information. -@item -V,--verbose -Be verbose. -@item --debug -Print even more information. This is useful when generating bugreports. -@item -w,--warranty -Show the warranty with which GNU LilyPond comes. (It comes with -@strong{NO WARRANTY}!) -@end table - -@subsection Titling layout - -Ly2dvi extracts the following header fields from the LY files to -generate titling; an example demonstrating all these fields is in -@inputfileref{input/test,ly2dvi-testpage.ly}: - -@table @code -@item title - The title of the music. Centered on top of the first page. -@item subtitle - Subtitle, centered below the title. -@item poet - Name of the poet, left flushed below the subtitle. -@item composer - Name of the composer, right flushed below the subtitle. -@item meter - Meter string, left flushed below the poet. -@item opus - Name of the opus, right flushed below the composer. -@item arranger - Name of the arranger, right flushed below the opus. -@item instrument - Name of the instrument, centered below the arranger. -@item dedication - To whom the piece is dedicated. -@item piece - Name of the piece, left flushed below the instrument. -@item head - A text to print in the header of all pages. It is not called -@code{header}, because @code{\header} is a reserved word in LilyPond. -@item copyright - A text to print in the footer of the first page. Default is to - print the standard footer also on the first page. -@item footer - A text to print in the footer of all but the last page. -@item tagline - Line to print at the bottom of last page. The default text is ``Lily -was here, @var{version-number}''. -@end table - - -@cindex header -@cindex footer -@cindex page layout -@cindex titles - - - -@subsection Additional parameters - -Ly2dvi responds to several parameters specified in a @code{\paper} -section of the input file. They can be overridden by supplying a -@code{--set} command line option. - -@table @code -@item language - Specify La@TeX{} language: the @code{babel} package will be -included. Default: unset. - - Read from the @code{\header} block. - -@item latexheaders - Specify additional La@TeX{} headers file. - - Normally read from the @code{\header} block. Default value: empty. - -@item latexpackages - Specify additional La@TeX{} packages file. This works cumulative, -so you can add multiple packages using multiple @code{-s=latexpackages} options. - Normally read from the @code{\header} block. Default value: -@code{geometry}. - -@item latexoptions - Specify additional options for the La@TeX{} -@code{\documentclass}. You can put any valid value here. This was -designed to allow ly2dvi to produce output for double-sided paper, -with balanced margins and pagenumbers on alternating sides. To achieve -this specify @code{twoside}. - -@item orientation - Set orientation. Choices are @code{portrait} or @code{landscape}. Is -read from the @code{\paper} block, if set. - -@item textheight - The vertical extension of the music on the page. It is normally - calculated automatically, based on the paper size. - -@item linewidth - The music line width. It is normally read from the @code{\paper} -block. - -@item papersize - The paper size (as a name, e.g. @code{a4}). It is normally read from -the @code{\paper} block. - -@item pagenumber - If set to @code{no}, no page numbers will be printed. If set to a -positive integer, start with this value as the first page number. - - - @item fontenc - The font encoding, should be set identical to the @code{font-encoding} - property in the score. -@end table - - diff --git a/Documentation/user/lilypond-book.itely b/Documentation/user/lilypond-book.itely index 0291645ee0..ebe8d9510d 100644 --- a/Documentation/user/lilypond-book.itely +++ b/Documentation/user/lilypond-book.itely @@ -218,12 +218,11 @@ A special feature not (yet) available in other output formats, is the @example trip.ly @end example -This runs @file{trip.ly} through ly2dvi (see also @ref{Invoking -ly2dvi}), and substitutes a preview image in the output. The image +This runs @file{trip.ly} through @code{lilypond} (see also @ref{Invoking +lilypond}), and substitutes a preview image in the output. The image links to a separate HTML file, so clicking it will take the viewer to a menu, with links to images, midi and printouts. -@cindex ly2dvi @cindex titling in THML @cindex preview image @cindex thumbnail diff --git a/Documentation/user/lilypond.tely b/Documentation/user/lilypond.tely index d9084de8d8..b94ada7b03 100644 --- a/Documentation/user/lilypond.tely +++ b/Documentation/user/lilypond.tely @@ -14,7 +14,7 @@ Distributions will want to install lilypond.info doing: @direntry @c ;; prepend GNU for dir, must be unique * GNU LilyPond: (lilypond). The GNU music typesetter. -* ly2dvi: (lilypond)Invoking ly2dvi:: Titling LilyPond scores. +* lilypond: (lilypond)Invoking lilypond:: Titling LilyPond scores. * Glossary: (music-glossary). Glossary of music terms. * convert-ly: (lilypond)Invoking convert-ly:: Older LilyPond versions. * midi2ly: (lilypond)Invoking midi2ly:: Importing MIDI. diff --git a/Documentation/user/refman.itely b/Documentation/user/refman.itely index 4062b76b9d..5ec71cf33f 100644 --- a/Documentation/user/refman.itely +++ b/Documentation/user/refman.itely @@ -527,7 +527,7 @@ used in music aimed at beginners: The @code{EasyNotation} variable overrides a @internalsref{Score} context. You probably will want to print it with magnification or a large font size to make it more readable. To print with -magnification, you must create a DVI file (with @file{ly2dvi}) and +magnification, you must create a DVI file (with @file{lilypond}) and then enlarge it with something like @file{dvips -x 2000 file.dvi}. See the @code{dvips} documentation for more details. To print with a larger font, see @ref{Font Size}. @@ -537,8 +537,8 @@ larger font, see @ref{Font Size}. @cindex ghostscript If you view the result with Xdvi, then staff lines will show through -the letters. Printing the PostScript file obtained with ly2dvi does -produce the correct result. +the letters. Printing the PostScript file obtained does produce the +correct result. @node Easier music entry @@ -8276,14 +8276,14 @@ spacing is. The page layout process happens outside the LilyPond formatting engine: variables controlling page layout are passed to the output, -and are further interpreted by @code{ly2dvi}. @code{ly2dvi} responds -to the following variables in the @code{\paper} block. The variable -@code{textheight} sets the total height of the music on each page. -The spacing between systems is controlled with @code{interscoreline}, -its default is 16pt. The distance between the score lines will -stretch in order to fill the full page @code{interscorelinefill} is -set to a positive number. In that case @code{interscoreline} -specifies the minimum spacing. +and are further interpreted by @code{lilypond} wrapper program. It +responds to the following variables in the @code{\paper} block. The +variable @code{textheight} sets the total height of the music on each +page. The spacing between systems is controlled with +@code{interscoreline}, its default is 16pt. The distance between the +score lines will stretch in order to fill the full page +@code{interscorelinefill} is set to a positive number. In that case +@code{interscoreline} specifies the minimum spacing. @cindex @code{textheight} @cindex @code{interscoreline} @@ -8324,7 +8324,7 @@ the default font, then use the 20 point font. The file @code{paper16.ly} will now include a file named @file{a4.ly}, which will set the paper variables @code{hsize} and @code{vsize} (used by -@code{lilypond} and @code{ly2dvi}). +@code{lilypond-book} and @code{lilypond}). @refcommands @@ -8335,7 +8335,7 @@ will set the paper variables @code{hsize} and @code{vsize} (used by @seealso -@ref{Invoking ly2dvi}, +@ref{Invoking lilypond}, @inputfileref{input/regression,between-systems.ly}, and @internalsref{NonMusicalPaperColumn}. diff --git a/Documentation/user/tutorial.itely b/Documentation/user/tutorial.itely index c7eb233424..3808b14b73 100644 --- a/Documentation/user/tutorial.itely +++ b/Documentation/user/tutorial.itely @@ -41,8 +41,8 @@ reference. This tutorial starts with a short introduction to the LilyPond music language. After this first contact, we will show you how to to -produce printed output, normally using the program @code{ly2dvi}. You -should then be able to create and print your first sheets of music. +produce printed output. You should then be able to create and print +your first sheets of music. @menu * First steps:: Music language of LilyPond. @@ -273,21 +273,11 @@ your text editor, enter the following input and save the file as @end example @end quotation -@cindex ly2dvi - -@c now this is weird, running ly2dvi to run LilyPond -@c (therefore name change proposal) - -LilyPond is the program that computes the sheet music. All other -things, such as adding titles, page breaking and other page layout, -are done by a small wrapper program called -@code{ly2dvi}. @code{ly2dvi} calls LilyPond to render the music, and -then adds the titling and page layout instructions. To process -@file{test.ly} with @code{ly2dvi}, proceed as follows: +To process @file{test.ly}, proceed as follows: @quotation @example -ly2dvi -p test.ly +lilypond test.ly @end example @end quotation @@ -308,12 +298,12 @@ DVI output to `test.dvi'... @cindex Viewing music @cindex xdvi -The result of the ly2dvi is the file @file{test.pdf}.@footnote{For -@TeX{} afficionados, there is also a @file{test.dvi} file. It can be -viewed with @code{xdvi}. The DVI uses a lot of PostScript specials, -which do not show up in the magnifying glass. The specials also mean -that the DVI file cannot be processed with @code{dvilj}. Use -@code{dvips} for printing. +The result is the file @file{test.pdf}.@footnote{For @TeX{} +afficionados, there is also a @file{test.dvi} file. It can be viewed +with @code{xdvi}. The DVI uses a lot of PostScript specials, which do +not show up in the magnifying glass. The specials also mean that the +DVI file cannot be processed with @code{dvilj}. Use @code{dvips} for +printing. @cindex dvips @cindex dvilj @cindex DVI driver @@ -1194,10 +1184,9 @@ example, @cindex bibliographic information @cindex titles @cindex composer -@cindex ly2dvi -When the file is processed by @code{ly2dvi}, the title and composer +When the file is processed by @code{lilypond}, the title and composer specified are printed above the music. The `tagline' is a short line printed at bottom of the last page, which normally says ``Engraved by LilyPond, version @dots{}''. In the example above, it is replaced by the @@ -1229,7 +1218,7 @@ will be printed before each movement: @} @end example -More information on titling can be found in @ref{Invoking ly2dvi}. +More information on titling can be found in @ref{Invoking lilypond}. @node Single staff polyphony diff --git a/scripts/lilypond.py b/scripts/lilypond.py index 116c216c20..22c65e2e72 100644 --- a/scripts/lilypond.py +++ b/scripts/lilypond.py @@ -140,8 +140,8 @@ option_definitions = [ _ ("set the resolution of the preview to RES")), ('', 'P', 'postscript', _ ("generate PostScript output")), ('', '', 'png', _("generate PNG page images")), - ('', '', 'psgz', _("generate PS.GZ")), - ('', 'p', 'pdf', _ ("generate PDF output")), + ('', '', 'psgz', _("generate PS.GZ")), + # separate options for PDF / PS / DVI ? ('', '', 'pdftex', _ ("use pdflatex to generate a PDF output")), # FIXME: preview, picture; to indicate creation of a PNG? ('', '', 'preview', _ ("make a picture of the first system")), @@ -208,7 +208,7 @@ paper_p = 1 output_name = '' # Output formats that ly2dvi should create -targets = ['DVI', 'LATEX', 'MIDI', 'TEX'] +targets = ['DVI', 'LATEX', 'MIDI', 'TEX', 'PDF', 'PS'] track_dependencies_p = 0 dependency_files = [] @@ -698,9 +698,9 @@ for opt in options: include_path.append (a) elif o == '--postscript' or o == '-P': targets.append ('PS') - elif o == '--pdf' or o == '-p': - targets.append ('PS') - targets.append ('PDF') + elif o == '--no-ps': + targets.remove ('PS') + targets.remove ('PDF') elif o == '--keep' or o == '-k': keep_temp_dir_p = 1 elif o == '--debug':