bug-texinfo
[Top][All Lists]
Advanced

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

Re: Problematic indentation in HTML output of makeinfo


From: Thomas Keller
Subject: Re: Problematic indentation in HTML output of makeinfo
Date: Fri, 20 Nov 2009 07:59:41 +0100
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; de; rv:1.9.1.4pre) Gecko/20090915 Lightning/1.0pre Thunderbird/3.0b4

Hi Karl!

Am 20.11.09 01:30, schrieb Karl Berry:
> The normal way to use @example is without leading whitespace, since it
> inserts indentation itself.  And you can control how much that
> indentation is with @exampleindent, if you feel the need.
> 
> If you put your own physical whitespace characters in, then I don't see
> how we have any alternative but to honor them.
> 
> Since the general goal of Texinfo is to produce the "same" output in
> different formats, I don't think it would be a good default not to
> indent in HTML.
> 
> But anyway, maybe texi2html has some other css or other viable options
> to do what you want to do.  For example, it occurs to me that if you
> reliably use the same amount of physical whitespace, you could use css
> to shift the [small]example envs to the left by that amount.

Maybe you got me wrong. Consider the attached texi file, which makeinfo
converts to the attached HTML file.

If you apply the following CSS to the HTML file

<style type="text/css">
pre.smallexample {
  border: 1px solid red;
  padding: 0;
}
</style>

you see what I mean. Even though the container gets a padding of 0, the
text still does not start on the very left of the container. This is
because the preformatted text is rendered as

<pre class="smallexample">     This is
         a small
     example
</pre>

where

<pre class="smallexample">This is
    a small
example
</pre>

would be correct, since I have no way of removing the additional
whitespace with CSS foo. The problem gets uglier, if @example and
@smallexample are used deeper down the document tree, because additional
"prefix" whitespaces are then added.

However, I've looked into the manual of @exampleindent and this does
what I want, obviously [0] states

        "@exampleindent is ignored for HTML output."

which apparently is no longer true for at least version 4.13. So putting

@ifhtml
@exampleindent 0
@end ifhtml

in the header fixes my problem.

Thanks for your help!
Thomas.

[0] http://www.gnu.org/software/hello/manual/texinfo/exampleindent.html
-- 
GPG-Key 0x160D1092 | address@hidden | http://thomaskeller.biz
Please note that according to the EU law on data retention, information
on every electronic information exchange might be retained for a period
of six months or longer: http://www.vorratsdatenspeicherung.de/?lang=en

Attachment: test.texi
Description: Text document


Up: (dir)

Top

This is
    a small
example

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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