The result is a text document with formatted music integrated.
@command{lilypond-book} will do its best to try to align the music to
-the left and right margins. Currently the most used papersizes and
-one- and twocolumn mode is supported. But if you use some more
-advances features, like the geometry-package or change the margins in
-La@TeX{} or use @code{@@pagesize} in texinfo, will break.
+the left and right margins. Currently all papersizes, one- and
+twocolumn mode and the @code{geometry} package is supported.
+The TeXinfo command @code{pagesize} is on the TODO list for Lilypond 1.4.
+But changing the linewidth in other ways will not give you a straight
+right margin.
This document assumes you have basic knowledge of GNU LilyPond and
La@TeX{} or texinfo.
These commands should be in the beginning of the document:
@itemize @bullet
@item @code{@@afourpaper}
+@item @code{@@afourlatex}
@item @code{@@afourwide}
@item @code{@@smallbook}
@end itemize
-@code{@@pagesizes} are not supported.
+@code{@@pagesizes} are not yet supported.
@subsection Examples
\lilypond@{ YOUR LILYPOND CODE @}
@end example
-The 'geometry' package is is not supported. The most popular
-papersizes should work.
-
Lilypond-book know about the @code{\onecolumn} and
-@code{\twocolumn} commands.
+@code{\twocolumn} commands, the @code{geometry} package and
+all the standard paper sizes.
The music will be surrounded by @code{\preLilypondExample} and
@code{\postLilypondExample}. The variables are
@strong{[UGH: THIS DOES NOT HAPPEN WHEN
YOU USE THE SHORT FORM, \LILYPOND@{ ... @}, CHECK OUT WHY]}
-@subsection @code{landscape} package
-There is some simple support for landscape paper format, and this
-can be combined with the @code{\twocolumn} command. Only a4 and
-letter paper is supported, more to come...
-
-A more complete
-support, maybe also supporting the geometry package is planned, but
-there are more work that has to be done on @command{lilypond-book}
-first.
-
-This should work:
-@example
-\documentclass@{article@}
-\usepackage@{landscape@}
-\begin@{document@}
-\twocolumn
-BLA BLA BLA
-\end@{document@}
-@end example
-
@subsection Examples
@example
If you use @code{--outdir}, you should also @code{cd} to that directory
before running LaTeX or makeinfo.
-@strong{[UGH: IS THIS THE BEST WAY TO DO IT. MAYBE ADD A COMMENT LINE TO THE
+@strong{[UGH: IS THIS THE BEST WAY TO DO IT? MAYBE ADD A COMMENT LINE TO THE
GENERATED FILE, SO LILYPOND-BOOK CAN TEST IF THE FILE IT IS TO OVERWRITE
IS GENERATED.]}
# * Figure out clean set of options. Hmm, isn't it pretty ok now?
# * add support for .lilyrc
# * EndLilyPondOutput is def'd as vfil. Causes large white gaps.
+# * texinfo: add support for @pagesize
-# todo: dimension handling (all the x2y) is clumsy.
+# todo: dimension handling (all the x2y) is clumsy. (tca: Thats
+# because the values are taken directly from texinfo.tex,
+# geometry.sty and article.cls. Give me a hint, and I'll
+# fix it.)
# This is was the idea for handling of comments:
# Multiline comments, @ignore .. @end ignore is scanned for
program_version = '@TOPLEVEL_VERSION@'
if program_version == '@' + 'TOPLEVEL_VERSION' + '@':
- program_version = '1.3.106'
+ program_version = '1.3.113'
include_path = [os.getcwd()]
class TexiPaper:
def __init__(self):
- self.m_papersize = 'a4'
+ self.m_papersize = 'letterpaper'
self.m_fontsize = 12
def get_linewidth(self):
return texi_linewidths[self.m_papersize][self.m_fontsize]
'executivepaper':{10: 345, 11: 360, 12: 379}}
texi_linewidths = {
- 'a4': {12: 455},
- 'a4wide': {12: 470},
- 'smallbook': {12: 361},
- 'texidefault': {12: 433}}
+ 'afourpaper': {12: mm2pt(160)},
+ 'afourwide': {12: in2pt(6.5)},
+ 'afourlatex': {12: mm2pt(150)},
+ 'smallbook': {12: in2pt(5)},
+ 'letterpaper': {12: in2pt(6)}}
option_definitions = [
('EXT', 'f', 'format', 'set format. EXT is one of texi and latex.'),
return re_dict[format][name]
def bounding_box_dimensions(fname):
+ if g_outdir:
+ fname = os.path.join(g_outdir, fname)
try:
fd = open(fname)
except IOError:
idx = 0
while 1:
if chunks[idx][0] == 'input':
- if string.find(chunks[idx][1], "@afourpaper") != -1:
- paperguru.m_papersize = 'a4'
- elif string.find(chunks[idx][1], "@afourwide") != -1:
- paperguru.m_papersize = 'a4wide'
- elif string.find(chunks[idx][1], "@smallbook") != -1:
- paperguru.m_papersize = 'smallbook'
+ for s in ('afourpaper', 'afourwide', 'letterpaper',
+ 'afourlatex', 'smallbook'):
+ if string.find(chunks[idx][1], "@%s" % s) != -1:
+ paperguru.m_papersize = s
idx = idx + 1
if idx == 10 or idx == len(chunks):
break