Save the code above to a file called @file{lilybook.lytex}, then in a
terminal run
+@c keep space after @version{} so TeX doesn't choke
@example
lilypond-book --output=out --pdf lilybook.lytex
-@emph{lilypond-book (GNU LilyPond) 2.11.37}
+@emph{lilypond-book (GNU LilyPond) @version{} }
@emph{Reading lilybook.lytex...}
@emph{..lots of stuff deleted..}
@emph{Compiling lilybook.tex...}
@documentencoding UTF-8
@documentlanguage en
+@include macros.itexi
+
@iftex
@afourpaper
@c don't replace quotes with directed quotes
@vskip 20pt
-@lilypond[ragged-right]
-\score {
- \context Lyrics {
- \override Score.RehearsalMark #'self-alignment-X = #LEFT
- \override Score.RehearsalMark #'font-size = #-2
- \mark #(ly:export (string-append
- "(For LilyPond version " (lilypond-version) ")"))
- s2
- }
- \layout {
- indent = 0.0\pt
- }
-}
-@end lilypond
-
+For LilyPond version @version{}
@end titlepage
@copying
@ifnottex
@node Top
@top GNU LilyPond --- learning manual
-@c HJJ: Info needs `@top', which is a synonym for `@unnumbered' in TeX.
-This is the learning manual for GNU LilyPond 2.11.x series.
-@ifhtml
-(See the bottom of this page for the exact version number).
-@end ifhtml
+This is the learning manual for GNU LilyPond version @version{}.
@cindex web site
@cindex URL
@contents
-@include macros.itexi
-
@include preface.itely
@include introduction.itely
@include tutorial.itely
@documentencoding UTF-8
@documentlanguage en
+@include macros.itexi
+
@iftex
@afourpaper
@c don't replace quotes with directed quotes
@vskip 20pt
-@lilypond[ragged-right]
-\score {
- \context Lyrics {
- \override Score.RehearsalMark #'self-alignment-X = #LEFT
- \override Score.RehearsalMark #'font-size = #-2
- \mark #(ly:export (string-append
- "(For LilyPond version " (lilypond-version) ")"))
- s2
- }
- \layout {
- indent = 0.0\pt
- }
-}
-@end lilypond
-
+For LilyPond version @version{}
@end titlepage
@copying
@top GNU LilyPond --- program usage
@c HJJ: Info needs `@top', which is a synonym for `@unnumbered' in TeX.
-This is the program usage manual for GNU LilyPond 2.11.x series.
-@ifhtml
-(See the bottom of this page for the exact version number).
-@end ifhtml
+This is the program usage manual for GNU LilyPond version @version{}.
@cindex web site
@cindex URL
@contents
-@include macros.itexi
-
@include install.itely
@include setup.itely
@include running.itely
@documentencoding UTF-8
@documentlanguage en
+@include macros.itexi
+
@iftex
@afourpaper
@c don't replace quotes with directed quotes
@vskip 20pt
-@lilypond[ragged-right]
-\score {
- \context Lyrics {
- \override Score.RehearsalMark #'self-alignment-X = #LEFT
- \override Score.RehearsalMark #'font-size = #-2
- \mark #(ly:export (string-append
- "(For LilyPond version " (lilypond-version) ")"))
- s2
- }
- \layout {
- indent = 0.0\pt
- }
-}
-@end lilypond
-
+For LilyPond version @version{}
@end titlepage
@copying
@top GNU LilyPond --- The music typesetter
@c HJJ: Info needs `@top', which is a synonym for `@unnumbered' in TeX.
-This is the user manual for GNU LilyPond 2.11.x series.
-@ifhtml
-(See the bottom of this page for the exact version number).
-@end ifhtml
+This is the user manual for GNU LilyPond version @version{}.
@cindex web site
@cindex URL
@contents
-@include macros.itexi
-
@include notation.itely
@include specialist.itely
highly recommend that you always include the @code{\version}, no matter
how small your file is. Speaking from personal experience, it's
quite frustrating to try to remember which version of LilyPond you were
-using a few years ago. @code{convert-ly} requires you to declare
+using a few years ago. @command{convert-ly} requires you to declare
which version of LilyPond you used.
@item @strong{Include checks}: @ruser{Bar and barnumber checks},
Do not use @itemize @bullet.
+* To get LilyPond version, use @version{} (this does not work inside
+ LilyPond snippets). If you write "@version{}" (enclosed with
+ quotes), or generally if @version{} is not followed by a space,
+ enclose it with
+
+ @w{ ... }
+
+ e.g.
+
+ @w{"@version{}"}
+
+ to prevent an ugly line break in PDF output.
+
%%%%% SYNTAX SURVEY
OUTTXT_FILES += $(addprefix $(outdir)/,$(TEXI_FILES:.texi=.txt))
+TEXI2PDF_FLAGS += --command '@set version $(TOPLEVEL_VERSION)'
GENERATE_OMF = $(PYTHON) $(buildscript-dir)/texi2omf.py --format $(1) --location $(webdir)/$(tree-dir)/out-www/$(notdir $(basename $@)) --version $(TOPLEVEL_VERSION) $< > $@
TEXINFO_PAPERSIZE_OPTION= $(if $(findstring $(PAPERSIZE),a4),,-t @afourpaper)
-MAKEINFO_FLAGS = --enable-encoding
+MAKEINFO_FLAGS = --enable-encoding -D 'version $(TOPLEVEL_VERSION)'
MAKEINFO = LANG= $(MAKEINFO_PROGRAM) $(MAKEINFO_FLAGS)