+2004-10-31 Werner Lemberg <wl@gnu.org>
+
+ Resetting @exampleindent to `5' gives ugly results with texinfo's
+ DVI output. Use `@format @exampleindent 0 ... @end format' instead
+ (if not quoting) to change @exampleindent only locally.
+
+ * scripts/lilypond-book.py (NOQUOTE): New variable.
+ (output) [LATEX]: Remove AFTER and BEFORE.
+ [TEXINFO]: Remove AFTER and BEFORE.
+ Fix QUOTE and VERBATIM pattern.
+ Add NOQUOTE pattern.
+ (Lilypond_snippet) [output_info, output_latex]: Don't handle AFTER
+ and BEFORE.
+ [output_texinfo]: Use NOQUOTE.
+
2004-10-31 Graham Percival <gperlist@shaw.ca>
* Documentation/user/changing-defaults.itely: clarify paper
* scm/lily.scm (ly:system): new function. Catches uninstalled
ps2png.
->>>>>>> 1.2778
2004-10-29 Han-Wen Nienhuys <hanwen@xs4all.nl>
* Documentation/user/notation.itely: remove
(ly_options): Remove NOINDENT and EXAMPLEINDENT patterns.
(compose_ly): Use `no_options' and `simple_options'.
Fix logic of option handling.
+ Handle `linewidth' option without parameter.
2004-10-29 Han-Wen Nienhuys <hanwen@xs4all.nl>
LINEWIDTH = 'linewidth'
NOFRAGMENT = 'nofragment'
NOINDENT = 'noindent'
+NOQUOTE = 'noquote'
NOTES = 'body'
NOTIME = 'notime'
OUTPUT = 'output'
TEXINFO = 'texinfo'
VERBATIM = 'verbatim'
-# NOTIME has no opposite so it isn't part of this dictionary
+# NOTIME has no opposite so it isn't part of this dictionary.
+# NOQUOTE is used internally only.
no_options = {
NOFRAGMENT: FRAGMENT,
NOINDENT: INDENT,
%(str)s
</blockquote>
''',
+
VERBATIM: r'''<pre>
%(verb)s</pre>''',
},
##
LATEX: {
- AFTER: '',
-
- BEFORE: '',
-
OUTPUT: r'''{%%
\parindent 0pt
\catcode`\@=12
%(code)s
@lilypond''',
- AFTER: '',
-
- BEFORE: '',
-
OUTPUT: r'''@noindent
@image{%(base)s,,,[image of music],%(ext)s}''',
''',
QUOTE: r'''@quotation
-%(str)s
-@end quotation
+%(str)s@end quotation
+''',
+
+ NOQUOTE: r'''@format
+%(str)s@end format
''',
- # FIXME: @exampleindent 5 is the default...
VERBATIM: r'''@exampleindent 0
@example
%(verb)s@end example
-@exampleindent 5
''',
},
}
# defaults
relative = 1
override = {}
- # FIXME: Where to get sane value for exampleindent?
- # In texinfo.tex, its maximum value is 0.4in, so we use that.
+ # The concept of the `exampleindent' option is broken. It is not
+ # possible to get a sane value for @exampleindent at all without
+ # processing the document itself. Saying
+ #
+ # @exampleindent 0
+ # @example
+ # ...
+ # @end example
+ # @exampleindent 5
+ #
+ # causes ugly results with the DVI backend of texinfo since the
+ # default value for @exampleindent isn't 5em but 0.4in (or a smaller
+ # value). Executing the above code changes the environment
+ # indentation to an unknown value because we don't know the amount
+ # of 1em in advance since it is font-dependent. Modifying
+ # @exampleindent in the middle of a document is simply not
+ # supported within texinfo.
+ #
+ # To set @exampleindent locally to zero, we use the @format
+ # environment for non-quoted snippets.
override[EXAMPLEINDENT] = r'0.4\in'
override[LINEWIDTH] = None
override.update (default_ly_options)
def output_info (self):
str = self.output_print_filename (HTML)
- str = output[TEXINFO][BEFORE] % vars ()
for image in self.get_images ():
(base, ext) = os.path.splitext (image)
- # URG, makeinfo implicitely prepends dot to ext
+ # URG, makeinfo implicitly prepends dot to ext
# specifying no extension is most robust
ext = ''
str += output[TEXINFO][OUTPUT] % vars ()
- str += output[TEXINFO][AFTER] % vars ()
return str
def output_latex (self):
if QUOTE in self.options:
str = output[LATEX][QUOTE] % vars ()
- str += (output[LATEX][BEFORE]
- + (output[LATEX][OUTPUT] % vars ())
- + output[LATEX][AFTER])
+ str += (output[LATEX][OUTPUT] % vars ())
return str
def output_print_filename (self,format):
if VERBATIM in self.options:
verb = verbatim_texinfo (self.substring ('code'))
str += (output[TEXINFO][VERBATIM] % vars ())
+ if not QUOTE in self.options:
+ str = output[TEXINFO][NOQUOTE] % vars()
str += ('@ifinfo\n' + self.output_info () + '\n@end ifinfo\n')
str += ('@tex\n' + self.output_latex () + '\n@end tex\n')