groff
[Top][All Lists]
Advanced

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

[Groff] Question on Using pic for Entity Relationship Diagrams.


From: Ralph Corderoy
Subject: [Groff] Question on Using pic for Entity Relationship Diagrams.
Date: Thu, 02 Nov 2000 22:46:29 +0000

Hi,

I'm trying to use pic for the first time.  I've got Kernighan's paper
on it and Eric Raymond's later paper on groff's pic.  If the
information I'm missing is in one of these feel free to refer me.

The pic input is below.  I want to position the USERPREFS entity
relative to SECURITY's position.  But it seems that En_security isn't
where I think it should be, hence the XXX and crossed lines in the
middle of nowhere.

What am I missing?

Any other comments on the style of the pic code welcome.  I'd also be
interested in hearing of anyone else using pic for ERDs;  perhaps you
have some handy macros already available?

Many thanks,


Ralph.


.\" groff -mm -p erd.tr >erd.ps
.PS

define entity_box
{
    box wid $1 ht (($2) + 1) * 0.15
}

define crowsfoot
{
    {
        line from $1 - (0.05, 0) to $1 + (0, 0.1)
        line to $1 + (0.05, 0)
        line from $1 + (0, 0.1) to $1
    }
}

down

En_security: [
    entity_box(1, 3)
    "SECURITY" ljust at last box .w + (0.1, 0) \
        "* id" ljust \
        "description" ljust
]

L: line dashed
{ "assigned to" at last line .n - (0.05, 0.1) rjust }
L: line
crowsfoot(L.s)
{ "limited by" at L.s + (0.05, 0.1) ljust }

En_users: [
    entity_box(2, 4)
    "USERS \fIUSER\fP" ljust at last box .w  + (0.1, 0) \
        "* id" ljust \
        "name" ljust \
        "email" ljust
    "" ljust at last box .c  + (0.1, 0) \
        "blurb" ljust \
        "more blurb" ljust \
        "finale" ljust
]

L: line

En_userprefs: [
    line from En_security .w to En_security .e
    line from En_security .n to En_security .s
    move to En_security .e + (1, 0)
    entity_box(1.5, 5)
    "XXX" at En_security .c
    "USERPREFS \fImerge\fP" ljust at last box .w  + (0.1, 0) \
        "* id" ljust \
        "artnum" ljust \
        "sig" ljust \
        "viewmode" ljust
]

.PE

reply via email to

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