Re: tabs in `@example`

Gavin Smith <[email protected]>
Newsgroups gmane.comp.tex.texinfo.bugs
Message-ID <abVA2XHqyEBVla_q@orangestar>
On Sat, Mar 14, 2026 at 06:02:16AM +0000, Werner LEMBERG wrote:
> 
> > At the start of a line, a tab character is treated the same as a
> > space character, i.e. it is ignored.
> 
> But a space character at the beginning of a line is not ignored in an
> `@example` environment!
> 
> Attached is a file that shows various combinations, together with an
> image of it.  For me it's strange that a leading tab gets ignored
> while a tab in any other situation is treated the same as a space (all
> within an `@example` environment).
> 
> 
>     Werner

Yes, I see that in an @example environment, the category code of space
is changed so that spaces are all printed, with no skipping spaces
at the beginning of a line or treating multiple spaces as a single space.
Nothing is done with tab characters, though - they are still treated
as spaces are treated by default.

I do not see a big problem here as the manual tells you not to use tab
characters anyway.

I have changed the text to the following:

  Do not use tabs in the lines of an example!  (Or anywhere else in
  Texinfo, except in verbatim environments.)  @TeX{} treats a tab as a
  single space character, so any text following a tab on a line will not
  be aligned as expected.

I feel it's better not to go into any more detail as it's possible that
there will be some even more obscure case where a tab character does not
behave exactly as described.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.