texi2html-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Texi2html-bug] @multitable inside @smallexample


From: Reinhold Kainhofer
Subject: Re: [Texi2html-bug] @multitable inside @smallexample
Date: Tue, 16 Sep 2008 23:25:53 +0300
User-agent: KMail/1.9.10

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Monday 15 September 2008 17:23:33 Patrice Dumas wrote:
> On Sun, Sep 14, 2008 at 08:45:05PM +0200, Reinhold Kainhofer wrote:
> > Hi Patrick!
> > We ran into another formatting problem: We have some multi-column
> > tables inside a @smallexample section, e.g.
[...]
> > makeinfo --html in contrast converts it to one <pre..> around the
> > whole table and removes leading/trailing whitespace/linebreaks:
> >
> > <pre class="smallexample">
> >      <p><table summary=""><tr align="left"><th valign="top">Language
> >        </th><th valign="top">Note names
> >        </th><th valign="top">sharp
> >      <br></th></tr><tr align="left"><td valign="top">nederlands.ly
> >        </td><td valign="top">c d e f g a bes b
> >        </td><td valign="top">-is
> >      <br></td></tr></table>
> > </pre>
>
> It preserves spaces and linebreaks exactly like texi2html. The only
> difference is the pre within or without. 

Nope, there is another difference: The necessary space before and after @item 
is removed in makeinfo, while texi2html also writes out that space 
inside the <pre>, so all table cells will always start and end with a space.

While you are right in principle, that the HTML code doesn't look too 
different, its display in the browser is VERY different. Compare the
(good-looking) output of makeinfo:
http://lilypond.org/doc/v2.11/Documentation/user/lilypond/Note-names-in-other-languages#Note-names-in-other-languages

to the output of texi2html, where the cells look very misaligned due 
to the line breaks:
http://kainhofer.com/~lilypond/Documentation/user/lilypond/Writing-pitches.html#Note-names-in-other-languages

> I guess that what you want to write, in fact, is something along:
>
> @smallexample
> @multitable {Header1} {Length of second col} {third col}
> @headitem Language @tab Note names   @tab sharp
> @item nederlands.ly  @tab c d e f g a bes b  @tab -is
> @end multitable
> @end smallexample

First, this is still converted to 
[...]<pre class="smallexample"> Language </pre></th><th><pre 
class="smallexample"> Note names </pre>[..]

In particular, notice the spaces at the beginning and end of each cell.

The other thing is that this is a very stripped-down example of our real 
table. With your suggestion it would look like:

@smallexample
@multitable {nederlands.ly} {do re mi fa sol la sib si} {-iss/-is} {-ess/-es} 
{-ss/-x/-sharpsharp} {-essess/-eses}
@headitem Language @tab Note names @tab sharp @tab flat @tab double sharp @tab 
double flat
@item nederlands.ly @tab c d e f g a bes b @tab -is @tab -es @tab -isis @tab 
-eses
@item arabic.ly @tab do re mi fa sol la sib si @tab -d @tab -b @tab -dd @tab -bb
@item catalan.ly @tab do re mi fa sol la sib si @tab -d/-s @tab -b @tab -dd/-ss 
@tab -bb
@item deutsch.ly @tab c d e f g a b h @tab -is @tab -es @tab -isis @tab -eses
@item english.ly @tab c d e f g a bf b @tab -s/-sharp @tab -f/-flat @tab 
-ss/-x/-sharpsharp @tab -ff/-flatflat
@item espanol.ly @tab do re mi fa sol la sib si @tab -s @tab -b @tab -ss @tab 
-bb
@item italiano.ly @tab do re mi fa sol la sib si @tab -d @tab -b @tab -dd @tab 
-bb
@item norsk.ly @tab c d e f g a b h @tab -iss/-is @tab -ess/-es @tab 
-ississ/-isis @tab -essess/-eses
@item portugues.ly @tab do re mi fa sol la sib si @tab -s @tab -b @tab -ss @tab 
-bb
@item suomi.ly @tab c d e f g a b h @tab -is @tab -es @tab -isis @tab -eses
@item svenska.ly @tab c d e f g a b h @tab -iss @tab -ess @tab -ississ @tab 
-essess
@item vlaams.ly @tab do re mi fa sol la sib si @tab -k @tab -b @tab -kk @tab -bb
@end multitable
@end smallexample

As you can see the lines are quite long, so to make them easier 
comprehensible to documentation editors and translators, I'd really 
like to be able to insert some line breaks to bring some structure 
into the entries. In particular:
@item english.ly
  @tab c d e f g a bf b
  @tab -s/-sharp @tab -f/-flat @tab -ss/-x/-sharpsharp
    @tab -ff/-flatflat

is much easier to parse visually and change than:
@item english.ly @tab c d e f g a bf b @tab -s/-sharp @tab -f/-flat @tab 
-ss/-x/-sharpsharp @tab -ff/-flatflat

The other issue is that some text editors don't like long lines 
in text files too much and automatically insert line breaks, so 
these editors could not be used any more :(

> Outside of @format, @*example... it doesn't matter if you add
> linebreaks or not in tables because they don't change the html
> formatting anyway, but in preformatted environment, my assumption is
> that you should write your text the way you want it to appear, with
> @-commands removed.

The real question is: How shall leading/trailing whitespace of @item 
contens of a @multitable inside a @smallexample environment be 
interpreted? 
makeinfo --html does not convert leading/trailing spaces, 
but converts line breaks verbatim (albeit in a way so that they 
don't show up in the browser either). makeinfo (.info output) completely 
removes leading/trailing spaces and newlines. At least the output 
of makeinfo --html, makeinfo and texi2pdf (which also does not print the
spaces and linebreaks!) look consistent, so one can argue that 
they should not really belong to the table cell contents.... 

Cheers,
Reinhold
- -- 
- ------------------------------------------------------------------
Reinhold Kainhofer, Vienna University of Technology, Austria
email: address@hidden, 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/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFI0BZVTqjEwhXvPN0RAuzGAJ9A7ZNL6qUzg++WHpfVeB48O+Nd+QCeN4+Q
79mTUjFryzKBSpdnmDcxLD8=
=iO64
-----END PGP SIGNATURE-----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]