bug-texinfo
[Top][All Lists]
Advanced

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

Re: @verbatiminclude inside @smallformat


From: Stepan Kasal
Subject: Re: @verbatiminclude inside @smallformat
Date: Thu, 30 Jun 2005 17:57:11 +0200
User-agent: Mutt/1.4.1i

Hi Karl and Jan,
  I hope you don't mind if I cc this to the bug-texinfo list.

On Sat, Jun 11, 2005 at 08:06:03PM -0400, Karl Berry wrote:
> I wanted to get a small verbatim environment, as Jan wrote about back in
> July 2002.  It occurred to me that this might work, and be simpler than
> a new @smallverbatiminclude command:
> 
> @smallformat
> @verbatiminclude somefile.tex
> @end smallformat
> 
> It almost does, but the lines are actually exdented into the left
> margin, and the reason is not immediately apparent to me.
...
> I think all the other environments indent the text (by design), e.g.,
> @example
> @verbatiminclude somefile.tex
> @end smallexample
> has everything pushed over.

And that was the reason: all environments call \nonfillstart, which, among
other things, increases \leftindent.  If the environment doesn't want to
increase \leftindent, it does \let\nonarrowing = t.

Actually, here is a first bug: \nonarrowing stays set for embedded
environments; so an @example inside @format is not narrowed.
Perhaps \nonfillstart should reset \nonarrowing.

But the situation is complicated by @cartouche, which
        "defines \nonarrowing to inhibit narrowing at next level down."
My knowledge of English betrays me here.  "next level down" means
"the next level", or "all levels below?"

If it means "all levels below", then we should set it to "p" (stays for
permanent) and then \nonfillstart (and \quotation) would do:

  \ifx\nonarrowing\relax
    \advance\leftskip by ...
  \else
    \if t\nonarowing
      \let\nonarrowing = \relax
    \fi
  \fi

And now to the original problem: \setupverbatim called \nonfillstart
and then did
                  \advance\leftskip by -\defbodyindent
to restore the original margin.  This was obviously wrong, it should
have set \nonarrowing.

Attached please find texinfo-20050630-setupverbatim.patch, which fixes
the problem described by Karl.  I committed this patch.
Then there is a test file.

And the third attachment, texinfo-20050630-nonarrowing.patch, re-defined
\nonarrowing as explained above.
Not committed yet (and not tested either); I don't know whether I guessed
correctly what should @cartouche do.

Attachment: texinfo-20050630-setupverbatim.patch
Description: Text document

Attachment: smallverbatim.texi
Description: TeXInfo document

Attachment: texinfo-20050630-nonarrowing.patch
Description: Text document


reply via email to

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