We're running into one more problem in our texinfo use in LilyPond, this time
it also affects the output that our users produce:
Inside a @quotation environment, makeinfo --html adds 5 additional spaces of
indentation, although the indentation is already done in HTML by the
<blockquote>. In particular, look at the following two self-explaining
examples:
@quotation
@example
Test for indentation: This text is indented with spaces twice (10 spaces: 5
from @@quotation and 5 from @@example), but should only be once (5 from
@@example), because the indentation of @@quotation is already done by
<blockquote>...
@end example
@end quotation
@quotation
@verbatim
Similarly, text in @verbatim environments inside @quotation IS indented by 5
spaces...
@end verbatim
@end quotation
An example file with the .html output is attached (generated by makeinfo
4.11).
Looking at makeinfo/insertion.c, in begin_insertion the current_indent is
unconditionally incremented by the default indent, although the HTML output
should not get an additional indent:
case quotation:
/* @quotation does filling (@display doesn't). */
if (html)
add_html_block_elt ("<blockquote>\n");
else
{...}
current_indent += default_indentation_increment;
The apparent fix is of course to move that increment into the else block (and
also prevent the resetting in end_insertion. This makes the examples work as
intended (but, of course, I don't know the internals of texinfo / makeinfo
well enough to judge possible side-effects).
A patch to fix this is attached. It is against 4.11, but I suppose it should
also work with the CVS version, which hasn't changed in this regard.
Cheers,
Reinhold
--
------------------------------------------------------------------
Reinhold Kainhofer, Vienna University of Technology, Austria
email: [EMAIL PROTECTED], http://reinhold.kainhofer.com/
* Financial and Actuarial Mathematics, TU Wien, http://www.fam.tuwien.ac.at/
* K Desktop Environment, http://www.kde.org, KOrganizer maintainer
* Chorvereinigung "Jung-Wien", http://www.jung-wien.at/
diff -r -u texinfo-4.11.orig/makeinfo/insertion.c texinfo-4.11/makeinfo/insertion.c
--- texinfo-4.11.orig/makeinfo/insertion.c 2007-07-01 23:20:32.000000000 +0200
+++ texinfo-4.11/makeinfo/insertion.c 2008-03-30 00:22:41.000000000 +0100
@@ -557,8 +557,8 @@
last_char_was_newline = no_indent = 0;
indented_fill = filling_enabled = 1;
inhibit_paragraph_indentation = 1;
+ current_indent += default_indentation_increment;
}
- current_indent += default_indentation_increment;
if (xml)
xml_insert_quotation (insertion_stack->item_function, START);
else if (strlen(insertion_stack->item_function))
@@ -1217,7 +1217,7 @@
without a change in indentation. */
if (type != format && type != smallformat && type != quotation)
current_indent -= example_indentation_increment;
- else if (type == quotation)
+ else if (type == quotation && !html)
current_indent -= default_indentation_increment;
if (html)
Nur in texinfo-4.11/makeinfo: insertion.c~.
Nur in texinfo-4.11/makeinfo: quotation-sets-indentation-for-html-plus-blockquote1.html.
Nur in texinfo-4.11/makeinfo: quotation-sets-indentation-for-html-plus-blockquote.html.
Nur in texinfo-4.11/makeinfo: quotation-sets-indentation-for-html-plus-blockquote.info.
Nur in texinfo-4.11/makeinfo: quotation-sets-indentation-for-html-plus-blockquote.texi.
Title: Example inside quotation is doubly indented
Example inside quotation is doubly indented in HTML (not counting the blockquote)
Test for indentation: This text is indented with spaces twice (10 spaces: 5 from @quotation
and 5 from @example), but should only be once (5 from @example), because the
indentation of @quotation is already done by <blockquote>...
Similarly, text in @verbatim environments inside @quotation IS indented by 5 spaces...
\input texinfo @c -*-texinfo-*-
@c %**start of header
@setfilename quotation-sets-indentation-for-html-plus-blockquote.info
@settitle Example inside quotation is doubly indented
@c %**end of header
@node Top
@top Example inside quotation is doubly indented in HTML (not counting the
blockquote)
@quotation
@example
Test for indentation: This text is indented with spaces twice (10 spaces: 5
from @@quotation
and 5 from @@example), but should only be once (5 from @@example), because the
indentation of @@quotation is already done by <blockquote>...
@end example
@end quotation
@quotation
@verbatim
Similarly, text in @verbatim environments inside @quotation IS indented by 5
spaces...
@end verbatim
@end quotation
@bye