[Top][All Lists]

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

Re: TAB character in groff output

From: Ingo Schwarze
Subject: Re: TAB character in groff output
Date: Tue, 2 Aug 2022 15:44:21 +0200

Hi Alejandro,

Alejandro Colomar wrote on Tue, Aug 02, 2022 at 02:14:58PM +0200:

> I'd like to be able to produce ASCII HT ('\t' - horizontal tab) in man 
> pages output.  I don't want to align things; I do want a tab character. 
> Rationale: examples in fstab(5).

I don't understand.  On Debian, fstab(5) is part of the "mount"
package - which seems very reasonable to me - and it says:

  Fields on each line are separated by tabs or spaces.

What's wrong with using spaces?

Wanting to show literal tab characters to users in a manual page
seems a dubious goal to me for two reasons:

 * They are visually indistinguishable from spaces, so if the
   distinction really matters, confusion is almost guaranteed to ensue.

 * Some users may use pagers that convert tabs to spaces or vice
   versa, so even if you hope for pastability, you still need
   luck for it to work as intended.

> Is that possible?  I didn't find anything in groff_char(7).

In groff, this works for me:

 $ printf "a\\\\N'9'b" | groff -T ascii | hexdump -C | head -n 1
00000000  61 09 62 0a 0a 0a 0a 0a  0a 0a 0a 0a 0a 0a 0a 0a  |a.b.............|

Mandoc behaves differently and treats \N'9' exactly like a literal HT:

 $ printf "a\\\\N'9'b" | mandoc | hexdump -C | grep 61
00000050  61 20 20 20 20 62 0a 0a  20 20 20 20 20 20 20 20  |a    b..        |

In general, mandoc lets fewer control characters sneak through into
output than groff because i worry that control characters in output
might occasionally cause reliability or security issues.


reply via email to

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