From: Han-Wen Nienhuys Date: Sun, 22 Aug 2004 08:31:26 +0000 (+0000) Subject: * lily/staff-symbol.cc (print): subtract thickness from staff line X-Git-Tag: release/2.3.13~54 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=76aabf32978316085cd8f1fca85533a084d88d8e;p=lilypond.git * lily/staff-symbol.cc (print): subtract thickness from staff line length * lily/parser.yy (book_body): disallow { ..music.. } inside \book --- diff --git a/ChangeLog b/ChangeLog index 780ce39b11..af3e183366 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2004-08-22 Han-Wen Nienhuys + + * lily/staff-symbol.cc (print): subtract thickness from staff line + length + + * lily/parser.yy (book_body): disallow { ..music.. } inside \book + 2004-08-21 Carl Sorensen * scm/stencil.scm: remove fontify-text and fontify-text-white diff --git a/Documentation/user/lilypond-book.itely b/Documentation/user/lilypond-book.itely index 18ccc8a7d4..578eaa6474 100644 --- a/Documentation/user/lilypond-book.itely +++ b/Documentation/user/lilypond-book.itely @@ -45,6 +45,111 @@ Short Introduction to LaTeX} provides a introduction to using La@TeX{}. + +@node An example of a musicological document +@section An example of a musicological document + +@cindex musicology +@cindex La@TeX{}, music in +@cindex HTML, music in +@cindex Texinfo, music in +Some texts contain music examples. These texts are musicological +treatises, songbooks or manuals like this. Such texts can be made by +hand, simply by importing a PostScript figure into the word processor. +However, there is an automated procedure to reduce the amount of work +involved HTML, La@TeX{}, and Texinfo documents. + +A script called @code{lilypond-book} will extract the music fragments, +run format them, and put back the resulting notation. This program is +fully described in @ref{lilypond-book manual}. Here we show a small +example. The example also contains explanatory text, so we will not +comment on it further + +@example +\documentclass[a4paper]@{article@} +\begin@{document@} + +Documents for lilypond-book may freely mix music and text. For +example, + +\begin@{lilypond@} + @{ \relative c' @{ + c2 g'2 \times 2/3 @{ f8 e d @} c'2 g4 + @} +\end@{lilypond@} + +Options are put in brackets. + +\begin[fragment,quote,staffsize=26,verbatim]@{lilypond@} + c'4 f16 +\end@{lilypond@} + +Larger examples can be put in a separate file, and introduced with +\verb+\lilypondfile+. + +\lilypondfile[quote,noindent]@{screech-boink.ly@} + +\end@{document@} +@end example + +Under Unix, you can view the results as follows + +@example +$ cd input/tutorial +$ mkdir -p out/ +$ lilypond-book --output=out/ lilybook.tex +lilypond-book (GNU LilyPond) 2.1.19 +Reading `input/tutorial/lilybook.tex' +Reading `input/screech-boink.ly' +@var{lots of stuff deleted} +Writing `out/lilybook.tex' +$ cd out +$ latex lilybook +@var{lots of stuff deleted} +$ xdvi lilybook +@end example + +To convert the file into a nice PDF document, run the following +commands + +@example +$ dvips -Ppdf -u+lilypond -u+ec-mftrace lilybook +$ ps2pdf lilybook.ps +@end example + +Running lilypond-book and running latex creates a lot of temporary +files, which would clutter up the working directory. To remedy this, +use the @code{--output=@var{dir}} option. It will create the files in +a separate subdirectory @file{dir}. + +Finally the result of the La@TeX{} example shown above.@footnote{ This +tutorial is processed with Texinfo, so the example is as well. This +gives slightly different results in layout.} This finishes the +tutorial section. + +@page + +Documents for lilypond-book may freely mix music and text. For +example, + +@lilypond +\relative c' { + c2 g'2 \times 2/3 { f8 e d } c'2 g4 +} +@end lilypond + +Options are put in brackets. + +@lilypond[fragment,quote,staffsize=26,verbatim] +c'4 f16 +@end lilypond + +Larger examples can be put in a separate file, and introduced with +@code{\lilypondfile}. + +@lilypondfile[quote,noindent]{screech-boink.ly} + + @cindex texinfo @cindex latex @cindex texinfo diff --git a/Documentation/user/tutorial.itely b/Documentation/user/tutorial.itely index b207c4c51b..8110d78a40 100644 --- a/Documentation/user/tutorial.itely +++ b/Documentation/user/tutorial.itely @@ -1140,10 +1140,10 @@ voices with @code{\\} { r4 g4 f2 f4 } >> @end lilypond -For polyphonic music typesetting, spacer rests can also be convenient; these -are rests that do not print. It is useful for filling up voices that -temporarily do not play. Here is the same example with a spacer rest -instead of a normal rest---just use @samp{s} instead of @samp{r} +For polyphonic music typesetting, spacer rests can also be convenient; +these are rests that do not print. They are useful for filling up +voices that temporarily do not play. Here is the same example with a +spacer rest (@code{s}) instead of a normal rest (@code{r}), @lilypond[quote,verbatim,relative=2,fragment] << { a4 g2 f4~ f4 } \\ @@ -1193,7 +1193,7 @@ but now this entire expression must be interpreted as a \new PianoStaff << \new Staff @dots{} >> @end example -Here is a full-fledged example +Here is a small example @lilypond[quote,verbatim,relative=1,fragment] \new PianoStaff << @@ -1233,8 +1233,8 @@ seufzer = { { \seufzer \seufzer } @end lilypond -The name of an identifier should have alphabetic characters only; -no numbers, underscores or dashes. The assignment should be outside of +The name of an identifier should have alphabetic characters only; no +numbers, underscores or dashes. The assignment should be outside of running music. It is possible to use variables for many other types of objects in the @@ -1258,14 +1258,15 @@ places. The following example uses the above variables @end example More information on the possible uses of identifiers is in the -technical manual, in TODO. +technical manual, in @ref{Input variables and Scheme}. +@c fixme: the ref is too technical. @node An orchestral part @section An orchestral part -In orchestral music, all notes are printed twice; in a part for -the musicians, and in a full score for the conductor. Identifiers can +In orchestral music, all notes are printed twice. Once in a part for +the musicians, and once in a full score for the conductor. Identifiers can be used to avoid double work. The music is entered once, and stored in a variable. The contents of that variable is then used to generate both the part and the score. @@ -1384,108 +1385,10 @@ leading to More in-depth information on preparing parts and scores can be found in the notation manual; see @ref{Orchestral music}. -Setting run-time variables (`properties') is discussed in ref-TODO. +Setting run-time variables (`properties') is discussed in +@ref{Changing context properties on the fly}. +@node Conclusion of the tutorial +@section Conclusion of the tutorial -@node Musicological essays -@section Musicological essays -@cindex musicology -@cindex La@TeX{}, music in -@cindex HTML, music in -@cindex Texinfo, music in -Some texts contain music examples. These texts are musicological -treatises, songbooks or manuals like this. Such texts can be made by -hand, simply by importing a PostScript figure into the word processor. -However, there is an automated procedure to reduce the amount of work -involved HTML, La@TeX{}, and Texinfo documents. - -A script called @code{lilypond-book} will extract the music fragments, -run format them, and put back the resulting notation. This program is -fully described in @ref{lilypond-book manual}. Here we show a small -example. The example also contains explanatory text, so we will not -comment on it further - -@example -\documentclass[a4paper]@{article@} -\begin@{document@} - -Documents for lilypond-book may freely mix music and text. For -example, - -\begin@{lilypond@} - @{ \relative c' @{ - c2 g'2 \times 2/3 @{ f8 e d @} c'2 g4 - @} -\end@{lilypond@} - -Options are put in brackets. - -\begin[fragment,quote,staffsize=26,verbatim]@{lilypond@} - c'4 f16 -\end@{lilypond@} - -Larger examples can be put in a separate file, and introduced with -\verb+\lilypondfile+. - -\lilypondfile[quote,noindent]@{screech-boink.ly@} - -\end@{document@} -@end example - -Under Unix, you can view the results as follows - -@example -$ cd input/tutorial -$ mkdir -p out/ -$ lilypond-book --output=out/ lilybook.tex -lilypond-book (GNU LilyPond) 2.1.19 -Reading `input/tutorial/lilybook.tex' -Reading `input/screech-boink.ly' -@var{lots of stuff deleted} -Writing `out/lilybook.tex' -$ cd out -$ latex lilybook -@var{lots of stuff deleted} -$ xdvi lilybook -@end example - -To convert the file into a nice PDF document, run the following -commands - -@example -$ dvips -Ppdf -u+lilypond -u+ec-mftrace lilybook -$ ps2pdf lilybook.ps -@end example - -Running lilypond-book and running latex creates a lot of temporary -files, which would clutter up the working directory. To remedy this, -use the @code{--output=@var{dir}} option. It will create the files in -a separate subdirectory @file{dir}. - -Finally the result of the La@TeX{} example shown above.@footnote{ This -tutorial is processed with Texinfo, so the example is as well. This -gives slightly different results in layout.} This finishes the -tutorial section. - -@page - -Documents for lilypond-book may freely mix music and text. For -example, - -@lilypond -\relative c' { - c2 g'2 \times 2/3 { f8 e d } c'2 g4 -} -@end lilypond - -Options are put in brackets. - -@lilypond[fragment,quote,staffsize=26,verbatim] -c'4 f16 -@end lilypond - -Larger examples can be put in a separate file, and introduced with -@code{\lilypondfile}. - -@lilypondfile[quote,noindent]{screech-boink.ly} diff --git a/input/regression/new-slur.ly b/input/regression/new-slur.ly index 9f7fd0daa5..fa26940ab7 100644 --- a/input/regression/new-slur.ly +++ b/input/regression/new-slur.ly @@ -19,7 +19,7 @@ << {c=''8.([ es16] bes4~bes )} \\ {r8 r r } - >> + >> s4 g='8[( a b b! ] c4 bes) @@ -48,7 +48,8 @@ | << { b='8[( c]) } \\ { b='8[( c]) }>> - - + s2.| + e4( dis4) + e4( dis4) } diff --git a/lily/parser.yy b/lily/parser.yy index 0d8f000b12..ea56d48e60 100644 --- a/lily/parser.yy +++ b/lily/parser.yy @@ -649,13 +649,6 @@ book_body: $$->scores_.push (score); scm_gc_unprotect_object (score->self_scm ()); } - | book_body Composite_music { - Music *music = $2; - Score *score - = unsmob_score (ly_music_scorify (music->self_scm ())); - $$->scores_.push (score); - scm_gc_unprotect_object (music->self_scm ()); - } | book_body lilypond_header { $$->header_ = $2; } diff --git a/lily/staff-symbol.cc b/lily/staff-symbol.cc index 691f86a577..34941c84b6 100644 --- a/lily/staff-symbol.cc +++ b/lily/staff-symbol.cc @@ -38,6 +38,9 @@ Staff_symbol::print (SCM smob) --hwn. */ + Real t = me->get_paper ()->get_dimension (ly_symbol2scm ("linethickness")); + t *= robust_scm2double (me->get_property ("thickness"), 1.0); + Direction d = LEFT; do { @@ -60,13 +63,12 @@ Staff_symbol::print (SCM smob) && !x->extent (x, X_AXIS).is_empty ()) span_points[d] += x->extent (x, X_AXIS)[d]; } + + span_points[d] -= d* t/2; } while (flip (&d) !=LEFT); - Real t = me->get_paper ()->get_dimension (ly_symbol2scm ("linethickness")); - t *= robust_scm2double (me->get_property ("thickness"), 1.0); - int l = Staff_symbol::line_count (me); Real height = (l-1) * staff_space (me) /2; diff --git a/scm/define-grobs.scm b/scm/define-grobs.scm index fddebf771c..25a8aa15cf 100644 --- a/scm/define-grobs.scm +++ b/scm/define-grobs.scm @@ -408,8 +408,9 @@ (padding . 0.6) (minimum-space . 1.2) (direction . -1) - (meta . ((interfaces . (dynamic-interface axis-group-interface side-position-interface spanner-interface)))) - )) + + (meta . ((interfaces . (dynamic-interface axis-group-interface + side-position-interface spanner-interface)))) )) (LeftEdge . ( @@ -532,7 +533,9 @@ (break-align-symbol . key-signature) (break-visibility . ,begin-of-line-visible) (breakable . #t) - (meta . ((interfaces . (key-signature-interface font-interface break-aligned-interface item-interface )))) + + (meta . ((interfaces . (key-signature-interface font-interface + break-aligned-interface item-interface )))) )) (LedgerLineSpanner . ( @@ -613,7 +616,9 @@ (baseline-skip . 2) (break-visibility . ,end-of-line-invisible) (padding . 0.8) - (meta . ((interfaces . (text-interface side-position-interface font-interface mark-interface self-alignment-interface item-interface )))) + (meta . ((interfaces . (text-interface + side-position-interface font-interface mark-interface + self-alignment-interface item-interface )))) )) (MetronomeMark . ( @@ -621,7 +626,9 @@ (Y-offset-callbacks . (,Side_position_interface::aligned_side)) (direction . 1) (padding . 0.8) - (meta . ((interfaces . (text-interface side-position-interface font-interface metronome-mark-interface item-interface)))) + (meta . ((interfaces . (text-interface + side-position-interface font-interface + metronome-mark-interface item-interface)))) )) (MeasureGrouping . ( @@ -698,7 +705,9 @@ (Y-extent-callback . ,Note_head::extent) (Y-offset-callbacks . (,Staff_symbol_referencer::callback)) (stem-attachment-function . ,note-head-style->attachment-coordinates) - (meta . ((interfaces . (rhythmic-grob-interface rhythmic-head-interface font-interface note-head-interface staff-symbol-referencer-interface item-interface )))) + (meta . ((interfaces . (rhythmic-grob-interface + rhythmic-head-interface font-interface note-head-interface + staff-symbol-referencer-interface item-interface )))) )) (NoteSpacing @@ -890,7 +899,6 @@ (grace-space-factor . 0.6) (shortest-duration-space . 2.0) (spacing-increment . 1.2) -; (base-shortest-duration . ,(ly:make-moment 1 8 3 2)) (base-shortest-duration . ,(ly:make-moment 1 8)) (meta . ((interfaces . (spacing-interface spacing-spanner-interface spanner-interface)))) ))