Re: tabs in `@example`

Gavin Smith <[email protected]>
Newsgroups gmane.comp.tex.texinfo.bugs
Message-ID <abSENVnSW8bZjZ-l@orangestar>
On Fri, Mar 13, 2026 at 07:16:01AM +0000, Werner LEMBERG wrote:
> 
> In the info file I read the following about `@example`.
> 
>      Caution: Do not use tabs in the lines of an example!  (Or
>      anywhere else in Texinfo, except in verbatim environments.)  TeX
>      treats tabs as single spaces, and that is not what they look
>      like.
> 
> However, this is not fully correct.  Consider the following input
> file.
> 
> ```
> \input texinfo
> 
> @example
> no leading space
> 	leading tab	another tab
>         eight leading spaces
> @end example
> 
> @bye
> ```
> 
> If processed with `texi2pdf`, the leading tab vanishes completely (as
> shown in the image); it is not treated as a single space.

This part of the manual is correct:

"TeX treats tabs as single spaces"

This part is confusing:

"and that is not what they look like"

This is confusing because this conflates a space character (hex 0x20)
with a space - a physical space between words.  It is not true that
a space character input to TeX always has the same appearance in the
output.

At the start of a line, a tab character is treated the same as a space
character, i.e. it is ignored.
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.