groff
[Top][All Lists]
Advanced

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

RE: [Groff] Re: gpic question?


From: Ted Harding
Subject: RE: [Groff] Re: gpic question?
Date: Wed, 02 Feb 2005 12:11:00 -0000 (GMT)

On 02-Feb-05 address@hidden wrote:
> gpic and pic are fine programs, but what if one needs to
> draw a circuit schematic? xcircuit you say? I find even
> xcircuit lacking as regards the built-in set of symbols.
> So what is necessary? A portable gpic frontend to ease
> some burden of our shoulders, supporting a truck-load of
> symbols maybe...

Well, in principle the resources are indefinitely extensible.
I'm reminded of a time years ago when I used to use AutoCAD,
and remember that there was a facility for pulling in items
from a database (along with costs etc.). This seems similar
to what you are asking about.

As far as using pre-constructed entities is concerned,
[g]pic has the

  copy filename

mechanism, which causes the contents of "filename" to be
inserted in the pic code at that point (any ".PS" and ".PE"
in the file being ignored). So you could set up a series of
files, each of which contains pic definitions of one or
several entities, and just bring them in as needed. For full
flexibility, these definitions would usually need to be
parametrised macros so that they can be tailored to the
context. Don't forget that pic "remembers" anything which
has been defined or given a value in a preceding

  .PS
    ...
  .PE

section. So you could have an initial "read in what I want"
section, and refer to it in later sections where you are
drawing several different diagrams.

Since pic also includes a capable numerical-computation
engine, you could at the same time read in any "extraneous"
numeric attributes (such as cost, weight, etc.), and use
pic to maintain running totals of these as variables in pic.[1]
Then, at suitable points, you can communicate these values
to troff on the lines of

  command ".nr wt " itemweight
  command ".nr cumwt " totalweight

which can then be referenced in the troff document  as

  \n[wt]
  \n[cumwt]

etc. (If you want to tabulate these in the document, you
will need to write out to a temp file, from troff, the
table definition, then run tbl on this file from within
troff saving the output to another temp file, and then
read the latter back in to troff: the initial pre-processor
invocation of tbl would not know about this stuff at the
time).

[1] Of course you can also read in text attributes such
as name, function, etc. and use these to annotate the
item in the pic drawing.

Best wishes,
Ted.


--------------------------------------------------------------------
E-Mail: (Ted Harding) <address@hidden>
Fax-to-email: +44 (0)870 094 0861  [NB: New number!]
Date: 02-Feb-05                                       Time: 12:11:00
------------------------------ XFMail ------------------------------




reply via email to

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