an.tmac, .TH: shows the same text twice in the header! Why necessary?

2023-07-22 Thread Bjarni Ingi Gislason
Example from "sensible-terminal(1)":

.\" -*- nroff -*-
.TH SENSIBLE-TERMINAL-EMULATOR 1 "28 Aug 2022" "Debian"
.SH NAME
sensible-terminal-emulator \- sensible terminal emulator

-.-.

With "/usr/bin/man --version": man 2.11.2

Output from "env MANWIDTH=80 /usr/bin/man -l example":

grotty::():9: warning: unrecognized X command 
'sgr 0' ignored
SENSIBLE-TERMINAL-EMULATOR(1General Commands ManuSENSIBLE-TERMINAL-EMULATOR(1)

NAME
   sensible-terminal-emulator - sensible terminal emulator

Debian28 Aug 2022SENSIBLE-TERMINAL-EMULATOR(1)

-.-.

  The text "SENSIBLE-TERMINAL-EMULATOR" is output twice in the header,
is once not enough and why?  (Is this necessary(?))



Re: an.tmac, .TH: shows the same text twice in the header! Why necessary?

2023-07-22 Thread Dave Kemper
On 7/22/23, Bjarni Ingi Gislason  wrote:
>   The text "SENSIBLE-TERMINAL-EMULATOR" is output twice in the header,

You've been seeing this for decades and have never noticed it, because
most Unix commands are short and the repetition is unobtrusive.  Try
"man ls", "man grep", "man ssh", "man ascii", "man troff", or any
other common command.  Each man page name gets placed on the top left
and top right of the page.

I agree, for a galumphing command name like
"sensible-terminal-emulator" the repetition is not only overkill but
detrimental, as it overwrites other header fields.

> is once not enough and why?  (Is this necessary(?))

I don't know why other than extremely longstanding tradition.  (Man
pages have been formatted like this for at least 30 years on many
flavors of Unix.)  It doesn't seem necessary, but you'll have to
convince the that's-the-way-it's-always-been brigade.



Re: graphical manuals

2023-07-22 Thread James K. Lowden
On Fri, 21 Jul 2023 22:33:09 -0500
Nate Bargmann  wrote:

> Looking at the railroad diagram, I wonder if there are enough drawing
> characters in UTF-8 that they could be used for the diagrams rather
> than generating image files that would likely not be useful for
> terminal output.  

Thanks for reminding me, Nate.  Here's a current result: 

$ groff -T utf8  -mandoc -pet ./gcobol-start.3c
GCOBOL-START(3c)   GCC COBOL
GCOBOL-START(3c)

NAME
 START  position file for reading

SYNOPSIS
   ?
  ??START??filename?
   
 ???FIRST???
  
  ???LAST?? ??
  ?? KEY  ???compare?? name ??
??? operator? ???
   ?? IS   ??
 ???
 ???
   ???? ?LENGTHexpr???
   ??WITH  ??


 ???
   ???
INVALIDerror-statements
?  KEY  ?
 
 
   ?? NOT  ?
INVALIDvalid-statements?END-START??
?  KEY  ?
 

 I haven't tried to understand exactly what's going on with that.  pic
is emitting troff input, and troff, I expect, is emitting drawing
instructions in ditroff, which grotty renders.  Something is evidently
lost in translation.  

The grotty manual mentions, under BUGS: 

"There is no support for \D commands other than horizontal and
 vertical lines."

Given that constraint, a useful rendering might be possible if the pic
input took care to align the boxes and lines consistent with grotty's
character matrix.  

But, how?  An xterm determines its own font; it doesn't not
respond to in-band font requests. And there is no way afaik for a troff
drawing instruction to say "line right 7 characters; line down 3
lines", using whatever sizes the terminal decided on.  

That leaves us standing before my favorite hobbyhorse.  The demise of
Display Postscript doomed the possibility of a Unix graphical
terminal.  We had X, so applications could draw, but nothing like
"printing to the screen", where a data stream could control a graphical
terminal akin to how a data stream controls a graphical printer.
Instead, we got HTML, and thence epub.  

What would you use your MacArthur grant for?  I know what I would do: I
would create VT-roff, an xterm that, instead of recognizing VT-100
control codes, would recognize ditroff(5) output.  Then we could have
manpages "in the terminal" as good as on paper, or a PDF.  

--jkl





Re: an.tmac, .TH: shows the same text twice in the header! Why necessary?

2023-07-22 Thread G. Branden Robinson
At 2023-07-22T19:21:39+, Bjarni Ingi Gislason wrote:
>   The text "SENSIBLE-TERMINAL-EMULATOR" is output twice in the header,
> is once not enough and why?  (Is this necessary(?))

It's tradition.  See attachment.

Also see groff's PROBLEMS file.

  * I don't like the page headers and footers produced by groff -man.

  There seem to be many different styles of page header and footer
  produced by different versions of the -man macros.  You need to put
  modified macros from tmac/an.tmac into man.local.  More information is
  available in groff_man(7).

Regards,
Branden


signature.asc
Description: PGP signature