From: Jan Nieuwenhuizen Date: Mon, 21 Oct 2002 13:24:27 +0000 (+0000) Subject: * Merge from stable: X-Git-Tag: release/1.7.5~13 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=f8d1bb34b7c5f7deafa32be53f540f3102e82f3a;p=lilypond.git * Merge from stable: cvs update -jlilypond_1_6_5 -jlilypond_1_6_6 --- diff --git a/ChangeLog b/ChangeLog index c355b0c501..194da13497 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2002-10-21 Jan Nieuwenhuizen + + * Merge from stable: + + cvs update -jlilypond_1_6_5 -jlilypond_1_6_6 + 2002-10-21 Han-Wen Nienhuys * scm/generate-documentation.scm (string-append): add macro @@ -9,7 +15,8 @@ * lily/multi-measure-rest-engraver.cc: make separate MultiMeasureRestNumber grob. Introduce restNumberThreshold. - * lily/multi-measure-rest.cc: remove text handling. Remove number-threshold. + * lily/multi-measure-rest.cc: remove text handling. Remove + number-threshold. 2002-10-20 Han-Wen Nienhuys @@ -247,26 +254,85 @@ (schedule_lilypond_block): Implement `noquote' option for LaTeX mode. -2002-10-04 Jan Nieuwenhuizen +2002-10-21 Jan Nieuwenhuizen - * scm/grob-description.scm (minimum-beam-collision-distance): 0.75 - staff-space. Previous 1.5 was probably meant as half-spaces. - (cautionary-style): parentheses (was: smaller). This is what doco - says, and it seems more logical. + * Documentation/topdocs/INSTALL.texi: Add note about using ksh for + as workaround for /bin/sh problems on Solaris7. - * Documentation/user/refman.itely (Chromatic alterations): Bugfix - for 2nd sentence. +2002-10-19 Werner Lemberg -2002-10-04 Han-Wen Nienhuys + * GNUmakefile.in (web-doc): Fix typos. + * tex/lilyponddefs.tex (\lilypondspecial): Don't scan + `music-drawing-routines.ps' but emit \special{header=...} once. + * scm/tex.scm (header-end): Updated. - * make/lilypond.redhat.spec.in: various fixes for RedHat 8.0 +2002-10-19 Han-Wen Nienhuys -2002-10-03 Jan Nieuwenhuizen + * lily/stem-engraver.cc (acknowledge_grob): don't crash on + undefined tremolo. - * lily/beam.cc (rest_collision_callback): Fixed: partial rewrite. +2002-10-15 Werner Lemberg + + * scripts/lilypond-book.py (g_make_html): New global variable. + (schedule_lilypond_block): Don't compute EPS and PNG for `texi' + if `g_make_html' isn't set. + [main]: Add format `texi-html'. + (option_definitions): Updated. + * Documentation/user/lilypond-book.itely: Updated. + + * make/lilypond-vars.make (LILYPOND_BOOK_FORMAT): New variable. + * make/ly-rules.make (%.texi, %.nexi): Use it. + * stepmake/stepmake/www-targets.make (web): Pass `tex-html' as + format to lilypond-book. + * GNUmakefile.in (web-doc): Ditto. + +2002-10-14 Werner Lemberg + + Further improve TeX output. The produced files are about 40% + smaller. `lilyponddefs.tex' is now read only once. + + * tex/lilyponddefs.tex: Remove footer stuff. + (\ifundefined): Renamed to... + (\lilypondundefined): This. Use LaTeX's definition to + make it nestable and make it global. + (\lilypondstart, \lilypondend): New macro to initialize LilyPond + output. + (\lilypondspecial): New macro to read `music-drawing-routines.ps'. + (\fetasixteen, \fetafont, \fetachar, \botalign, \leftalign): Make + them global. + (\placebox): Renamed to... + (\lyitem): This. + Make it global and call \outputscale by itself. + (\lybox, \lyvrule): New macros to reduce input data. + (\lilypondfirst, \lilypondsecond, \lilypondloop, \lilyponditerate): + New auxiliary macros. + (\SkipLilydefs, \EndLilyPondOutput): Removed. + * tex/lily-pdf-defs.tex, tex/lily-ps-defs.tex (\lilySpace): Renamed + to... + (\lilypondspace): This and made it global. + (\turnOnPostScript): Renamed to... + (\lilypondpostscript): This and made it global. + (\turnOnExperimentalFeatures): Renamed to... + (\lilypondexperimentalfeatures): This and made it global. + * tex/lily-ps-defs.tex (\PSsetTeXdimen): Renamed to... + (\lilypondsetdimen): This and made it global. + * tex/lilypond-latex.tex, tex/lilypond-plaintex.tex: Removed. + * tex/GNUmakefile (TEX_FILES): Add `music-drawing-routines.ps' + (all, $(outdir)/music-drawing-routines.ps): New rules. + * buildscripts/mf-to-table.py (write_tex_defs): Use \gdef. + * scm/pdftex.scm, scm/tex.scm (end-output, header-end, placebox, + start-system, stop-system, stop-last-system, filledbox): Updated to + use the changed macros from lilyponddefs.tex. + * scripts/lilypond-book.ly (output_dict) : Ditto. + +2002-10-07 Jan Nieuwenhuizen + + * Documentation/windows/installing.texi: Update. 2002-09-30 Han-Wen Nienhuys + * VERSION: 1.6.5 released + * scripts/lilypond-book.py (make_pixmap): don't produce empty pages. 2002-09-28 Han-Wen Nienhuys diff --git a/Documentation/topdocs/INSTALL.texi b/Documentation/topdocs/INSTALL.texi index 1420bfee6e..c96536c400 100644 --- a/Documentation/topdocs/INSTALL.texi +++ b/Documentation/topdocs/INSTALL.texi @@ -721,9 +721,22 @@ CFLAGS='-I /usr/pkg/include' LDFLAGS='-L/usr/pkg/lib' ./configure @end itemize -@unnumberedsubsec Solaris: +@unnumberedsubsec Solaris @itemize @bullet +@item Solaris7, ./configure + +@file{./configure} needs a POSIX compliant shell. On Solaris7, +@file{/bin/sh} is not yet POSIX compliant, but @file{/bin/ksh} or bash +is. Please run configure like: +@example + /bin/ksh -c ./configure +@end example +or +@example + bash -c ./configure +@end example + @item Sparc64/Solaris 2.6, GNU make-3.77 GNU make-3.77 is buggy on this platform, upgrade to 3.78.1 or newer. diff --git a/Documentation/topdocs/index.tely b/Documentation/topdocs/index.tely index c65f5a0b26..afe2db533c 100644 --- a/Documentation/topdocs/index.tely +++ b/Documentation/topdocs/index.tely @@ -68,6 +68,17 @@ and are essentially bug-free. If you're not a developer, you probably want to visit the @uref{http://lilypond.org/stable, latest stable website}. +@c development: +@ignore +LilyPond has a development version and a stable version. This webpage +is for the @b{development} version. The development releases contain +experimental and often buggy code, so you should use this only if you +need any special new features. The stable releases don't change much, +and are essentially bug-free. If you're not a developer, you probably +want to visit the @uref{http://lilypond.org/stable, latest stable +website}. +@end ignore + @unnumberedsec Want to know more? If you want to know more, visit the diff --git a/Documentation/user/lilypond-book.itely b/Documentation/user/lilypond-book.itely index 5023fc7f15..1b23cbd4a2 100644 --- a/Documentation/user/lilypond-book.itely +++ b/Documentation/user/lilypond-book.itely @@ -361,6 +361,11 @@ Specify the document type to process: @code{html}, @code{latex} or @code{texi} (the default). @command{lilypond-book} usually figures this out automatically. +Note that the @code{texi} document type produces a DVI file; to +convert a texinfo document to @code{html}, you should use the additional +format @code{texi-html} instead of @code{texi} to convert lilypond +fragments to PNG images. + @item @option{--default-music-fontsize=@var{sz}pt} Set the fontsize to use for LilyPond if no fontsize is given as option. diff --git a/Documentation/windows/installing.texi b/Documentation/windows/installing.texi index d2c14b5b69..9f7c4c9b08 100644 --- a/Documentation/windows/installing.texi +++ b/Documentation/windows/installing.texi @@ -145,8 +145,17 @@ PDF output to `foo.pdf'... @end example If you install the Cygwin's XFree86 X11 window system, tetex-x11 and -ghostscript-x11 packages too, you can view the @code{dvi} output doing -@code{xdvi test.dvi}. If you have installed a PostScript/PDF viewer, +ghostscript-x11 packages too, you can view the @code{dvi} output +@c copied from tutorial, where xdvi command has been explained above +@c doing @code{xdvi test.dvi}. +doing: + +@example +startx +xdvi test.dvi +@end example + +If you have installed a PostScript/PDF viewer, such as @code{GSView} from @uref{http://www.cs.wisc.edu/~ghost}, viewing the PS file can be done with: diff --git a/GNUmakefile.in b/GNUmakefile.in index 3aa2b41d3e..568118f0a9 100644 --- a/GNUmakefile.in +++ b/GNUmakefile.in @@ -44,10 +44,10 @@ doc: run-reqs $(MAKE) -C Documentation web-doc: web-reqs - $(MAKE) out=www -C input/regression/ WWW - $(MAKE) out=www -C input/template/ WWW - $(MAKE) out=www -C input/test/ WWW - $(MAKE) out=www -C Documentation WWW + $(MAKE) out=www LILYPOND_BOOK_FORMAT=texi-html -C input/regression/ WWW + $(MAKE) out=www LILYPOND_BOOK_FORMAT=texi-html -C input/template/ WWW + $(MAKE) out=www LILYPOND_BOOK_FORMAT=texi-html -C input/test/ WWW + $(MAKE) out=www LILYPOND_BOOK_FORMAT=texi-html -C Documentation WWW $(MAKE) footify pfa-fonts: diff --git a/aclocal.m4 b/aclocal.m4 index 400f64a6bf..2dc4f8afe7 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1,6 +1,6 @@ dnl aclocal.m4 -*-shell-script-*- dnl WARNING WARNING WARNING -dnl do not edit! this is aclocal.m4, generated from /users/hanwen/usr/src/lilypond/stepmake/aclocal.m4 +dnl do not edit! this is aclocal.m4, generated from /home/fred/lily/stepmake/aclocal.m4 dnl aclocal.m4 -*-shell-script-*- dnl StepMake subroutines for configure.in @@ -477,7 +477,9 @@ AC_DEFUN(STEPMAKE_INIT, [ AC_MSG_RESULT(Stepmake package!) AC_MSG_CHECKING(builddir) + builddir="`pwd`" + if test "$srcdir" = "."; then srcdir_build=yes else diff --git a/buildscripts/mf-to-table.py b/buildscripts/mf-to-table.py index 7564737dd5..298311a059 100644 --- a/buildscripts/mf-to-table.py +++ b/buildscripts/mf-to-table.py @@ -132,7 +132,7 @@ def write_tex_defs (file, global_info, charmetrics): ##nm = global_info['FontFamily'] nm = font_family for m in charmetrics: - file.write (r'''\def\%s%s{\char%d}%%%s''' % (nm, m['tex'], m['code'],'\n')) + file.write (r'''\gdef\%s%s{\char%d}%%%s''' % (nm, m['tex'], m['code'],'\n')) file.write ('\\endinput\n') def write_ps_encoding (file, global_info, charmetrics): diff --git a/cygwin/changelog b/cygwin/changelog index bdd38dabaf..69c69fb66b 100644 --- a/cygwin/changelog +++ b/cygwin/changelog @@ -1,3 +1,9 @@ +lilypond (1.6.5-1) unstable; urgency=low + + * New upstream release. + + -- Jan Nieuwenhuizen Mon, 7 Oct 2002 14:54:12 +0200 + lilypond (1.6.4-1) stable; urgency=low * New upstream release. diff --git a/input/GNUmakefile b/input/GNUmakefile index 5ed0316b64..4961aa6666 100644 --- a/input/GNUmakefile +++ b/input/GNUmakefile @@ -1,6 +1,6 @@ depth = .. -SUBDIRS=test regression tutorial no-notation ascii-art template mutopia sondag-morgen +SUBDIRS=test regression tutorial no-notation ascii-art template mutopia # nereides is tweaked a lot, can't do (read webpage) examples= size11 size26 diff --git a/make/lilypond-vars.make b/make/lilypond-vars.make index 7d0d40cd6f..cdb4b61466 100644 --- a/make/lilypond-vars.make +++ b/make/lilypond-vars.make @@ -44,6 +44,7 @@ CONVERT_LY = $(script-dir)/convert-ly.py LILYPOND = $(builddir)/lily/$(outconfbase)/lilypond LILYPOND_BOOK = $(script-dir)/lilypond-book.py LILYPOND_BOOK_INCLUDES = -I $(pwd) -I $(outdir) -I$(input-dir) -I $(input-dir)/tricks/ -I $(input-dir)/regression/ -I $(input-dir)/test/ -I $(input-dir)/tutorial/ -I $(builddir)/mf/$(outconfbase)/ -I $(builddir)/mf/out/ +LILYPOND_BOOK_FORMAT = texi LY2DVI = $(script-dir)/ly2dvi.py LYS_TO_TELY = $(buildscript-dir)/lys-to-tely.py @@ -57,6 +58,7 @@ CONVERT_LY = $(shell $(SHELL) -c 'type -p convert-ly') LILYPOND = $(shell $(SHELL) -c 'type -p lilypond') LILYPOND_BOOK = $(shell $(SHELL) -c 'type -p lilypond-book') LILYPOND_BOOK_INCLUDES = -I. -I.. -I$(outdir) +LILYPOND_BOOK_FORMAT = texi LY2DVI = $(shell $(SHELL) -c 'type -p ly2dvi') LYS_TO_TELY = $(shell $(SHELL) -c 'type -p lys-to-tely') diff --git a/make/ly-rules.make b/make/ly-rules.make index dd3f297c4f..4876e5bb9b 100644 --- a/make/ly-rules.make +++ b/make/ly-rules.make @@ -5,8 +5,7 @@ $(outdir)/%.latex: %.doc -chmod a+w $@ - $(PYTHON) $(LILYPOND_BOOK) $(LILYPOND_BOOK_INCLUDES)\ -$(LILYPOND_BOOK_FLAGS) --verbose --dependencies --outdir=$(outdir) $< + $(PYTHON) $(LILYPOND_BOOK) $(LILYPOND_BOOK_INCLUDES) $(LILYPOND_BOOK_FLAGS) --verbose --dependencies --outdir=$(outdir) $< chmod -w $@ # don't do ``cd $(outdir)'', and assume that $(outdir)/.. is the src dir. @@ -14,14 +13,14 @@ $(LILYPOND_BOOK_FLAGS) --verbose --dependencies --outdir=$(outdir) $< $(outdir)/%.texi: %.tely -chmod a+w $@ set|egrep '(TEX|LILY)' # ugh, what's this? - $(PYTHON) $(LILYPOND_BOOK) $(LILYPOND_BOOK_INCLUDES) --dependencies --outdir=$(outdir) --format=texi --verbose $(LILYPOND_BOOK_FLAGS) $< + $(PYTHON) $(LILYPOND_BOOK) $(LILYPOND_BOOK_INCLUDES) --dependencies --outdir=$(outdir) --format=$(LILYPOND_BOOK_FORMAT) --verbose $(LILYPOND_BOOK_FLAGS) $< chmod -w $@ $(outdir)/%.texi: $(outdir)/%.tely -chmod a+w $@ # debugging: # set|egrep '(TEX|LILY)' - $(PYTHON) $(LILYPOND_BOOK) $(LILYPOND_BOOK_INCLUDES) --dependencies --outdir=$(outdir) --format=texi --verbose $(LILYPOND_BOOK_FLAGS) $< + $(PYTHON) $(LILYPOND_BOOK) $(LILYPOND_BOOK_INCLUDES) --dependencies --outdir=$(outdir) --format=$(LILYPOND_BOOK_FORMAT) --verbose $(LILYPOND_BOOK_FLAGS) $< # # DON'T REMOVE SOURCE FILES, otherwise the .TEXI ALWAYS OUT OF DATE. # rm -f $< @@ -31,7 +30,7 @@ $(outdir)/%.texi: $(outdir)/%.tely # for plain info doco: don't run lily $(outdir)/%.nexi: %.tely -chmod a+w $@ - $(PYTHON) $(LILYPOND_BOOK) $(LILYPOND_BOOK_INCLUDES) --dependencies --outdir=$(outdir) --format=texi --no-lily $(LILYPOND_BOOK_FLAGS) $< + $(PYTHON) $(LILYPOND_BOOK) $(LILYPOND_BOOK_INCLUDES) --dependencies --outdir=$(outdir) --format=$(LILYPOND_BOOK_FORMAT) --no-lily $(LILYPOND_BOOK_FLAGS) $< mv $(@D)/$(*F).texi $@ chmod -w $@ diff --git a/scm/chord-name.scm b/scm/chord-name.scm index 1cb89d89a2..99e8c226bd 100644 --- a/scm/chord-name.scm +++ b/scm/chord-name.scm @@ -410,7 +410,7 @@ ;; chord to be name-calculated. ;; ;; CHORD: (pitches (bass . inversion)) -(define (default-chord-name-function style chord) +(define-public (default-chord-name-function style chord) (let* ((pitches (map c++-pitch->scm (car chord))) (modifiers (cdr chord)) (bass-and-inversion (if (pair? modifiers) @@ -422,7 +422,11 @@ (pitch::transpose x diff)) (cdr pitches)) '()))) - (chord::name->text style (car pitches) steps bass-and-inversion))) +; (display (chord::name->text style (car pitches) steps bass-and-inversion)) + (chord::name->text style (car pitches) steps bass-and-inversion) + + + )) ;;; ;;; American style diff --git a/scm/pdftex.scm b/scm/pdftex.scm index 779cb016dc..3724dfbda1 100644 --- a/scm/pdftex.scm +++ b/scm/pdftex.scm @@ -114,7 +114,7 @@ (begin ; uncomment for some stats about lily memory ; (display (gc-stats)) - (string-append "%\n\\EndLilyPondOutput\n" + (string-append "%\n\\lilypondend\n" ; Put GC stats here. ))) @@ -165,9 +165,11 @@ (else (error "unknown unit" (ly:unit))) )) "}%\n" - "\\input lilyponddefs\n" + "\\ifx\\lilypondstart\\undefined\n" + " \\input lilyponddefs\n" + "\\fi\n" "\\outputscale=\\lilypondpaperoutputscale \\lilypondpaperunit\n" - "\\turnOnPostScript\n" + "\\lilypondpostscript\n" "\\pdfcompresslevel=0")) ;; Note: this string must match the string in ly2dvi.py!!! @@ -204,9 +206,10 @@ (ly:number->string x) " \\outputscale ")) (define (placebox x y s) - (string-append - "\\placebox{" - (number->dim y) "}{" (number->dim x) "}{" s "}%\n")) + (string-append "\\lyitem{" + (ly-number->string y) "}{" + (ly-number->string x) "}{" + s "}%\n")) (define (bezier-bow l thick) (embedded-pdf (list 'bezier-bow `(quote ,l) thick))) @@ -217,24 +220,24 @@ (define (start-system wd ht) (string-append "\\leavevmode\n" "\\scoreshift = " (number->dim (* ht 0.5)) "\n" - "\\ifundefined{lilypondscoreshift}%\n" - "\\else\n" - " \\advance\\scoreshift by -\\lilypondscoreshift\n" - "\\fi\n" - "\\hbox to " (number->dim wd) "{%\n" - "\\lower\\scoreshift\n" - "\\vbox to " (number->dim ht) "{\\hbox{%\n")) + "\\lilypondifundefined{lilypondscoreshift}%\n" + " {}%\n" + " {\\advance\\scoreshift by -\\lilypondscoreshift}%\n" + "\\lybox{" + (ly-number->string wd) "}{" + (ly-number->string ht) "{%\n")) (define (stop-system) - "}\\vss}\\hss}\\interscoreline\n") + "}%\n%\n\\interscoreline\n%\n") (define (stop-last-system) - "}\\vss}\\hss}") + "}%\n") + (define (filledbox breapth width depth height) - (string-append - "\\kern" (number->dim (- breapth)) - "\\vrule width " (number->dim (+ breapth width)) - "depth " (number->dim depth) - "height " (number->dim height) " ")) + (string-append "\\lyvrule{" + (ly-number->string (- breapth)) "}{" + (ly-number->string (+ breapth width)) "}{" + (ly-number->string depth) "}{" + (ly-number->string height) "}")) (define (roundfilledbox x y width height blotdiam) (embedded-pdf (list 'roundfilledbox x y width height blotdiam))) diff --git a/scm/tex.scm b/scm/tex.scm index c9a32a5f65..4026ec1789 100644 --- a/scm/tex.scm +++ b/scm/tex.scm @@ -151,18 +151,7 @@ ; uncomment for some stats about lily memory ; (display (gc-stats)) (string-append - "%\n" - "\\EndLilyPondOutput\n" - "\\begingroup\n" - "\\ifx\\LilyPondDocument\\undefined\n" - " \\def\\x{\\endgroup}%\n" - "\\else\n" - " \\def\\x{%\n" - " \\endgroup\n" - " \\enddocument\n" - " }\n" - "\\fi\n" - "\\x\n" + "\\lilypondend\n" ; Put GC stats here. ))) @@ -180,39 +169,14 @@ ((equal? (ly:unit) "pt") (/ 72.0 72.27)) (else (error "unknown unit" (ly:unit))) )) - " mul }%\n" - "\\special{\\string! " - - ;; URG: ly:gulp-file: now we can't use scm output without Lily - (regexp-substitute/global - #f "\n" - (ly:gulp-file "music-drawing-routines.ps") 'pre " %\n" 'post) - ;; (if (defined? 'ps-testing) "/testing true def%\n" "") - "}%\n" - "\\begingroup\n" - "\\catcode `\\@=11\n" - "\\expandafter\\ifx\\csname @nodocument\\endcsname \\relax\n" - " \\def\\x{\\endgroup}%\n" - "\\else\n" - " \\def\\x{%\n" - " \\endgroup\n" - " \\def\\LilyPondDocument{}\n" - " \\documentclass{article}\n" - " \\pagestyle{empty}\n" - ;; argh, we can't say \begin{document} because \begin is defined as - ;; \outer in texinfo - " \\begingroup\n" - " \\document\n" - " \\ifdim\\lilypondpaperlinewidth\\lilypondpaperunit > 0pt\n" - " \\hsize\\lilypondpaperlinewidth\\lilypondpaperunit\n" - " \\fi\n" - " \\parindent 0pt\n" - " }\n" + " mul }%\n" + "\\ifx\\lilypondstart\\undefined\n" + " \\input lilyponddefs\n" "\\fi\n" - "\\x\n" - "\\input lilyponddefs\n" - "\\outputscale=\\lilypondpaperoutputscale \\lilypondpaperunit\n" - "\\turnOnPostScript\n")) + "\\outputscale = \\lilypondpaperoutputscale\\lilypondpaperunit\n" + "\\lilypondstart\n" + "\\lilypondspecial\n" + "\\lilypondpostscript\n")) ;; Note: this string must match the string in ly2dvi.py!!! (define (header creator generate) @@ -247,9 +211,10 @@ (ly:number->string x) " \\outputscale ")) (define (placebox x y s) - (string-append - "\\placebox{" - (number->dim y) "}{" (number->dim x) "}{" s "}%\n")) + (string-append "\\lyitem{" + (ly:number->string y) "}{" + (ly:number->string x) "}{" + s "}%\n")) (define (bezier-bow l thick) (embedded-ps (list 'bezier-bow `(quote ,l) thick))) @@ -260,29 +225,28 @@ (define (start-system wd ht) (string-append "\\leavevmode\n" "\\scoreshift = " (number->dim (* ht 0.5)) "\n" - "\\ifundefined{lilypondscoreshift}%\n" - "\\else\n" - " \\advance\\scoreshift by -\\lilypondscoreshift\n" - "\\fi\n" - "\\hbox to " (number->dim wd) "{%\n" - "\\lower\\scoreshift\n" - "\\vbox to " (number->dim ht) "{\\hbox{%\n")) + "\\lilypondifundefined{lilypondscoreshift}%\n" + " {}%\n" + " {\\advance\\scoreshift by -\\lilypondscoreshift}%\n" + "\\lybox{" + (ly:number->string wd) "}{" + (ly:number->string ht) "}{%\n")) (define (stop-system) - "}\\vss}\\hss}\\interscoreline\n") + "}%\n%\n\\interscoreline\n%\n") (define (stop-last-system) - "}\\vss}\\hss}") + "}%\n") (define (filledbox breapth width depth height) (if (and #f (defined? 'ps-testing)) (embedded-ps (string-append (numbers->string (list breapth width depth height)) " draw_box" )) - (string-append - "\\kern" (number->dim (- breapth)) - "\\vrule width " (number->dim (+ breapth width)) - "depth " (number->dim depth) - "height " (number->dim height) " "))) + (string-append "\\lyvrule{" + (ly:number->string (- breapth)) "}{" + (ly:number->string (+ breapth width)) "}{" + (ly:number->string depth) "}{" + (ly:number->string height) "}"))) (define (roundfilledbox x y width height blotdiam) (embedded-ps (list 'roundfilledbox x y width height blotdiam))) diff --git a/scripts/lilypond-book.py b/scripts/lilypond-book.py index 77870ede96..68ff22873f 100644 --- a/scripts/lilypond-book.py +++ b/scripts/lilypond-book.py @@ -4,7 +4,6 @@ # * junk --outdir for --output # * Figure out clean set of options. # * -# * EndLilyPondOutput is def'd as vfil. Causes large white gaps. # * texinfo: add support for @pagesize # todo: dimension handling (all the x2y) is clumsy. (tca: Thats @@ -170,6 +169,7 @@ g_force_music_fontsize = 0 g_read_lys = 0 g_do_pictures = 1 g_do_music = 1 +g_make_html = 0 format = '' g_run_lilypond = 1 @@ -330,7 +330,7 @@ html_linewidths = { 'letterpaper': {12: in2pt(6)}} option_definitions = [ - ('EXT', 'f', 'format', 'use output format EXT (texi [default], latex, html)'), + ('EXT', 'f', 'format', 'use output format EXT (texi [default], texi-html, latex, html)'), ('DIM', '', 'default-music-fontsize', 'default fontsize for music. DIM is assumed to be in points'), ('DIM', '', 'default-lilypond-fontsize', 'deprecated, use --default-music-fontsize'), ('OPT', '', 'extra-options' , 'pass OPT quoted to the lilypond command line'), @@ -462,16 +462,12 @@ output_dict= { %s@end example ''', # do some tweaking: @ is needed in some ps stuff. - # override EndLilyPondOutput, since @tex is done - # in a sandbox, you can't do \input lilyponddefs at the - # top of the document. # # ugh, the

below breaks inline images... 'output-texi-noquote': r'''@tex \catcode`\@=12 \parindent 0pt -\input lilyponddefs -\def\EndLilyPondOutput{} +\def\lilypondbook{} \input %(fn)s.tex \catcode`\@=0 @end tex @@ -484,8 +480,7 @@ output_dict= { 'output-texi-quoted': r'''@quotation @tex \catcode`\@=12 -\input lilyponddefs -\def\EndLilyPondOutput{} +\def\lilypondbook{} \input %(fn)s.tex \catcode`\@=0 @end tex @@ -1045,7 +1040,7 @@ def schedule_lilypond_block (chunk): update_file(file_body, os.path.join(g_outdir, basename) + '.ly') needed_filetypes = ['tex'] - if format == 'html' or format == 'texi': + if format == 'html' or g_make_html: needed_filetypes.append ('eps') needed_filetypes.append ('png') if 'eps' in opts and not ('eps' in needed_filetypes): @@ -1503,6 +1498,9 @@ for opt in options: __main__.verbose_p = 1 elif o == '--format' or o == '-f': __main__.format = a + if a == 'texi-html': + __main__.format = 'texi' + g_make_html = 1 elif o == '--outname' or o == '-o': if len(files) > 1: #HACK diff --git a/stepmake/aclocal.m4 b/stepmake/aclocal.m4 index be1dcab893..3a3257072d 100644 --- a/stepmake/aclocal.m4 +++ b/stepmake/aclocal.m4 @@ -474,7 +474,9 @@ AC_DEFUN(STEPMAKE_INIT, [ AC_MSG_RESULT(Stepmake package!) AC_MSG_CHECKING(builddir) + builddir="`pwd`" + if test "$srcdir" = "."; then srcdir_build=yes else diff --git a/stepmake/stepmake/www-targets.make b/stepmake/stepmake/www-targets.make index 58f2d4ed6a..259d06fe85 100644 --- a/stepmake/stepmake/www-targets.make +++ b/stepmake/stepmake/www-targets.make @@ -9,11 +9,12 @@ WWW-clean: local-WWW-clean $(LOOP) endif +#ugh, this is (but whole make web/www/WWW is) lilypond specific local-web: - $(MAKE) out=www local-WWW + $(MAKE) out=www LILYPOND_BOOK_FORMAT=texi-html local-WWW web: - $(MAKE) out=www WWW + $(MAKE) out=www LILYPOND_BOOK_FORMAT=texi-html WWW local-WWW-clean: rm -f $(outdir)/* diff --git a/tex/GNUmakefile b/tex/GNUmakefile index c9f4c4b19b..b58a7e55ce 100644 --- a/tex/GNUmakefile +++ b/tex/GNUmakefile @@ -1,6 +1,6 @@ depth = .. -TEX_FILES = $(wildcard *.tex) +TEX_FILES = $(wildcard *.tex) $(outdir)/music-drawing-routines.ps EXTRA_DIST_FILES = $(TEX_FILES) STEPMAKE_TEMPLATES=install @@ -10,3 +10,7 @@ INSTALLATION_FILES=$(TEX_FILES) include $(depth)/make/stepmake.make +$(outdir)/music-drawing-routines.ps: $(depth)/ps/music-drawing-routines.ps + -cp $< $@ + +all: $(INSTALLATION_FILES) diff --git a/tex/lily-pdf-defs.tex b/tex/lily-pdf-defs.tex index f85aa5b1e8..69af9f0465 100644 --- a/tex/lily-pdf-defs.tex +++ b/tex/lily-pdf-defs.tex @@ -5,23 +5,23 @@ \edef\lilypdfdefsELC{\the\endlinechar}% \endlinechar -1\relax -\def\lilySpace{ } +\gdef\lilypondspace{ } -\def\turnOnPostScript{ +\gdef\lilypondpostscript{ % This sets CTM so that you get to the currentpoint % by executing a 0 0 moveto \def\embeddedpdf##1{ \pdfliteral{ - q \lilypondpaperoutputscale\lilySpace 0 0 % - \lilypondpaperoutputscale\lilySpace 0 0 cm % - \lilyoutputscalefactor\lilySpace 0 0 % - \lilyoutputscalefactor\lilySpace 0 0 cm % + q \lilypondpaperoutputscale\lilypondspace 0 0 % + \lilypondpaperoutputscale\lilypondspace 0 0 cm % + \lilyoutputscalefactor\lilypondspace 0 0 % + \lilyoutputscalefactor\lilypondspace 0 0 cm % ##1 Q } } } -\def\turnOnExperimentalFeatures{} +\gdef\lilypondexperimentalfeatures{} \endlinechar \lilypdfdefsELC \endinput diff --git a/tex/lily-ps-defs.tex b/tex/lily-ps-defs.tex index 4efc3c418c..71e31e8aab 100644 --- a/tex/lily-ps-defs.tex +++ b/tex/lily-ps-defs.tex @@ -9,30 +9,30 @@ % Escape the colon with \string to avoid problems with French while using % the Babel package. -\def\PSsetTeXdimen#1{ +\gdef\lilypondsetdimen#1{ \expandafter\special{ ! /#1 (\csname #1\endcsname) set_tex_dimen } } -\def\lilySpace{ } +\gdef\lilypondspace{ } -\def\turnOnPostScript{ +\gdef\lilypondpostscript{ % This sets CTM so that you get to the currentpoint % by executing a 0 0 moveto \def\embeddedps##1{ \special{ ps\string: @beginspecial @setspecial % - \lilypondpaperoutputscale\lilySpace\scaletounit % - \lilypondpaperoutputscale\lilySpace\scaletounit % + \lilypondpaperoutputscale\lilypondspace\scaletounit % + \lilypondpaperoutputscale\lilypondspace\scaletounit % % FUCKING REDHAT XDVI -- ARG! skeel ##1 @endspecial } } - \PSsetTeXdimen{lilypondpaperblotdiameter} + \lilypondsetdimen{lilypondpaperblotdiameter} } -\def\turnOnExperimentalFeatures{} +\gdef\lilypondexperimentalfeatures{} \endlinechar \lilypsdefsELC \endinput diff --git a/tex/lilypond-latex.tex b/tex/lilypond-latex.tex deleted file mode 100644 index e139af70cb..0000000000 --- a/tex/lilypond-latex.tex +++ /dev/null @@ -1,46 +0,0 @@ -% lilypond-latex.tex -% -\edef\lilypondlatexELC{\the\endlinechar}% -\endlinechar -1\relax - -\message{LaTeX definitions} - -\def\texsuffix{LaTeX} - -\def\lilyfooterLaTeX{ - \let\nopagenumbers\relax - - %% FIXME - \def\ps@plain{ - \renewcommand{\@oddhead}{} - \renewcommand{\@evenfoot}{} - \renewcommand{\@evenhead}{} - \renewcommand{\@oddfoot}{ - \ifnum\thepage = 1\relax - {\hfil \lilypondtagline} - \else - {foo\hfil \the\pageno \hfil} - \fi - } - } - - \def\ps@empty{ - \renewcommand{\@oddhead}{} - \renewcommand{\@evenfoot}{} - \renewcommand{\@evenhead}{} - \renewcommand{\@oddfoot}{ - \ifnum\thepage = 1\relax - {\hfil \lilypondtagline} - \else - {foo\hfil \the\pageno \hfil} - \fi - } - } - - \nopagenumbers -} - -\def\nolilyfooterLaTeX{} - -\endlinechar \lilypondlatexELC -\endinput diff --git a/tex/lilypond-plaintex.tex b/tex/lilypond-plaintex.tex deleted file mode 100644 index b269993355..0000000000 --- a/tex/lilypond-plaintex.tex +++ /dev/null @@ -1,38 +0,0 @@ -% lilypond-plaintex.tex -% -\edef\lilypondplaintexELC{\the\endlinechar}% -\endlinechar -1\relax - -\message{LilyPond Plain TeX settings} - -\def\texsuffix{PlainTeX} - -\def\lilyfooterPlainTeX{ - \footline = { - \ifnum\pageno = 1\relax - \smalltextfont\lilypondcopyright\hfil \lilypondtagline - \else - \hfil \the\pageno \hfil - \fi - } -} - - -%% make plain work ok Out Of The Box - -\ifundefined{lilypondpaperunit} -\def\lhsize{\hsize} -\else -\def\lhsize{\lilypondpaperlinewidth\lilypondpaperunit} -\fi - -\ifdim0pt<\lhsize -\hsize=\lhsize -\fi - -\advance\hoffset by -.6in - -\def\nolilyfooterPlainTeX{\nopagenumbers} - -\endlinechar \lilypondplaintexELC -\endinput diff --git a/tex/lilyponddefs.tex b/tex/lilyponddefs.tex index acacba8e3d..8f6bae4167 100644 --- a/tex/lilyponddefs.tex +++ b/tex/lilyponddefs.tex @@ -2,130 +2,203 @@ % % Include file for LilyPond. % -% This file defines various macros to accomodate lilypond output. +% This file defines various macros to acommodate lilypond output. +% +% It should run with plain TeX, LaTeX, pdftex, and texinfo. +% +% To avoid interferences, lilyponddefs.tex should be loaded within a group. +% To load it only once, most of the definitions must be global. +% +% The overall structure of a file created by LilyPond is as follows: +% +% +% \ifx\lilypondstart \undefined +% \input lilyponddefs +% \fi +% \lilypondstart +% +% \lilypondend +% +% No footers and headers are provided for the stand-alone run (i.e., for +% directly saying `latex '. +% % % Avoid \par while reading this file. \edef\lilyponddefsELC{\the\endlinechar}% \endlinechar -1\relax -% TeXbook ex 7.7 -\def\ifundefined#1{ +% the next three macros are taken from LaTeX +\long\gdef\lilypondfirst#1#2{#1} + +\long\gdef\lilypondsecond#1#2{#2} + +\gdef\lilypondifundefined#1{ \expandafter\ifx\csname#1\endcsname\relax + \expandafter\lilypondfirst + \else + \expandafter\lilypondsecond + \fi } -% If we must make titles, do so, before we're skipped. - -\ifx\mustmakelilypondtitle\undefined -\else - \makelilypondtitle -\fi +\gdef\lilypondstart{ + \begingroup + \catcode `\@=11\relax + % \@nodocument is defined as \relax after `\begin{document}' + \lilypondifundefined{@nodocument} + { + % either plain TeX or texinfo or not at the beginning of LaTeX input + \def\x{\endgroup} + } + { + % provide a proper LaTeX preamble (for A4 paper format) + \def\x{ + \endgroup + \def\lilyponddocument{} + \documentclass[a4paper]{article} + \pagestyle{empty} + % \begin is defined as \outer in texinfo, thus we use \csname + \csname begin\endcsname{document} + % center staves horizontally on page + \ifdim\lilypondpaperlinewidth\lilypondpaperunit > 0pt + \hsize\lilypondpaperlinewidth\lilypondpaperunit + % we abuse \scoreshift temporarily + \scoreshift \paperwidth + \advance\scoreshift -\the\hsize + \scoreshift 0.5\scoreshift + \advance\scoreshift -1in + \oddsidemargin \scoreshift + \evensidemargin \scoreshift + \fi + \parindent 0pt + } + } + + \x + + \lilypondifundefined{mustmakelilypondtitle} + {} + {\makelilypondtitle} + + \lilypondifundefined{mustmakelilypondpiecetitle} + {} + {\makelilypondpiecetitle} +} -\ifx\mustmakelilypondpiecetitle\undefined -\else - \makelilypondpiecetitle -\fi +\gdef\lilypondend{ + \lilypondifundefined{lilypondbook} + {\lilypondifundefined{lilypondpaperlastpagefill} + {\vskip 0pt plus \lilypondpaperinterscorelinefill00 fill} + {} + } + {} + + \begingroup + \lilypondifundefined{lilyponddocument} + { + \def\x{\endgroup} + } + { + \def\x{ + \endgroup + \csname end\endcsname{document} + } + } + + \x +} -% skip if included already +% this is an inversed \loop ... \repeat macro +\def\lilypondloop#1\lilypondrepeat{ + \def\lilypondbody{#1} + \lilyponditerate +} -\def\SkipLilydefs{ - \endlinechar \lilyponddefsELC - \endinput} -\ifundefined{EndLilyPondOutput} - \def\EndLilyPondOutput{\csname bye\endcsname} - \def\SkipLilydefs{} -\fi -\SkipLilydefs +\def\lilyponditerate{ + % \if ... + \lilypondbody + \let\lilypondnext \relax + \else + \let\lilypondnext \lilyponditerate + \fi + \lilypondnext +} -% need to do some stuff to turn page numbering off +\newread\lilypondinput -\ifundefined{documentclass} - \input lilypond-plaintex -\else - \input lilypond-latex -\fi +% the following macro is executed only once +\gdef\lilypondspecial{ + \special{header=music-drawing-routines.ps} + \gdef\lilypondspecial{} +} -% The feta characters +% the feta characters \input feta20 -\font\fetasixteen = feta16 -\def\fetafont{\fetasixteen} -\def\fetachar#1{\hbox{\fetasixteen#1}} +\global\font\fetasixteen = feta16 +\gdef\fetafont{\fetasixteen} +\gdef\fetachar#1{\hbox{\fetasixteen#1}} -\def\botalign#1{ +\gdef\botalign#1{ \vbox to 0pt{\vss #1} } -\def\leftalign#1{ +\gdef\leftalign#1{ \hbox to 0pt{#1\hss} } -% Attempt to keep lilypiecetitle together with the piece: +\gdef\lyitem#1#2#3{ + \botalign{ + \hbox{\raise #1\outputscale + \leftalign{\kern #2\outputscale #3}} + } +} -% -% TODO: figure this out. -% +\gdef\lybox#1#2#3{ + \hbox to #1\outputscale { + \lower\scoreshift \vbox to #2\outputscale { + \hbox{#3} + \vss + } + \hss + } +} -\def\myfilbreak{}%\par\vfil\penalty200\vfilneg} +\gdef\lyvrule#1#2#3#4{ + \kern #1\outputscale + \vrule width #2\outputscale depth #3\outputscale height #4\outputscale +} +% Attempt to keep lilypiecetitle together with the piece: +% +% TODO: figure this out. +\gdef\myfilbreak{}%\par\vfil\penalty200\vfilneg} -\ifundefined{lilypondpaperinterscorelinefill} - \def\lilypondpaperinterscorelinefill{0} -\else - \def\lilypondpaperinterscorelinefill{1} -\fi +\lilypondifundefined{lilypondpaperinterscorelinefill} + {\gdef\lilypondpaperinterscorelinefill{0}} + {\gdef\lilypondpaperinterscorelinefill{1}} -\def\interscoreline{ +\gdef\interscoreline{ \vskip \lilypondpaperinterscoreline \lilypondpaperunit plus \lilypondpaperinterscorelinefill fill } -\def\placebox#1#2#3{ - \botalign{ - \hbox{\raise #1\leftalign{\kern #2{}#3}} - } -} - % Are we using PDFTeX? If so, use pdf definitions. -% MiKTeX checks \pdfoutput the wrong way; this makes our -% check more complicated. -\ifx\pdfoutput\undefined - \input lily-ps-defs -\else - \ifx\pdfoutput\relax - \input lily-ps-defs - \else - \pdfoutput = 1 - \input lily-pdf-defs - \fi -\fi - -\def\EndLilyPondOutput{ - \ifundefined{lilypondpaperlastpagefill} - \vskip 0pt plus \lilypondpaperinterscorelinefill00 fill - \fi - \csname bye\endcsname -} +% MiKTeX checks \pdfoutput the wrong way, thus we use \csname. +\lilypondifundefined{lilypondpostscript} + { + \lilypondifundefined{pdfoutput} + {\input lily-ps-defs } + { + \pdfoutput = 1 + \input lily-pdf-defs + } + } + {} -% Need to do some stuff to turn page numbering off; -% they seriously mess up your fragments. - -\ifx\csname nolilyfooter\endcsname\relax - \message{[footer defined]} - \csname lilyfooter\texsuffix\endcsname -\else - \message{[footer empty]} - \csname nolilyfooter\texsuffix\endcsname -\fi - -% It is very bad that lilyponddefs.tex gets included in every lilypond -% output snippet. This is necessary because these output snippets -% often get encapsulated, eg by texinfo. This should be fixed by -% putting the variable parts in this file into a macro so that loading -% the file multiple times can be avoided. -\ifx\outputscale\undefined - \csname global\endcsname\csname newdimen\endcsname\outputscale - \csname global\endcsname\csname newdimen\endcsname\scoreshift -\fi +\newdimen\outputscale +\newdimen\scoreshift % Restore newline functionality (disabled to avoid \par). \endlinechar \lilyponddefsELC \endinput + +% EOF