groff
[Top][All Lists]
Advanced

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

Re: [Groff] Graph in a man page


From: Clemens Ladisch
Subject: Re: [Groff] Graph in a man page
Date: Fri, 20 Aug 2010 11:09:45 +0200
User-agent: Thunderbird 2.0.0.24 (Windows/20100228)

Andre Majorel wrote:
> On 2010-08-20 09:37 +0200, Werner LEMBERG wrote:
> > > I'd like to include a simple diagram in a man page, something
> > > like this :
> > >
> > >            _____       _____        _____
> > >           |     |  A  |     |   C  |     |
> > >           |  X  |---->|  Y  |----->|  Z  |
> > >           |     |<----|     |<-----|     |
> > >           |_____|  B  |_____|   D  |_____|
> > >
> > > I suppose I could use tbl or switch to a fixed-spacing font and
> > > use .nf. What would you recommend ?
> > 
> > The advantage of tbl is that you get a real graphics with non-TTy
> > output devices.
> 
> But for the boxes, not for the arrows, if I'm not mistaken.
> 
> > > It must work both in print and in a terminal and not depend on
> > > Groff.
> > 
> > `Must not depend on groff'?  What does this mean?
> 
> Simply that it must work with any nroff & troff, not just Groff.

Runing "man -p p ./testfile" on this file:

.TH a b c d e
.PS
box "X"
arrow "A" ""
box "Y"
arrow "B" ""
box "Z"
.PE

results in this output, which is better than nothing:

a(b)                             e                            a(b)

+------+     +------+    +------+
|      +-A-+-|      +-B-++      |
|  X   |     |  Y   |    |  Z   |
+------+     +------+    +------+

d                                c                            a(b)

I don't know how portable pic is (especially with its output shown as
text); this depends on what your target machines are.

If you want to avoid the "-p p" parameter for man, you'd have to set
MANROFFSEQ instead.


Regards,
Clemens



reply via email to

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