gpic - Unix, Linux Command

It is the user’s responsibility to provide appropriate definitions of the
PS and
PE macros.
When the macro package being used does not supply such definitions
(for example, old versions of -ms),
appropriate definitions can be obtained with
-mpic: these will center each picture.


/usr/share/doc/groff/1.18.1.1/pic.ms 

 \centerline{\box\graph}


Actually, since the vbox has a height of zero this will produce
slightly more vertical space above the picture than below it;


 \centerline{\raise 1em\box\graph}


would avoid this.


You must use a  driver that supports the
tpic specials, version 2.


Lines beginning with
\ are passed through transparently; a
% is added to the end of the line to avoid unwanted spaces.
You can safely use this feature to change fonts or to
change the value of
\baselineskip. Anything else may well produce undesirable results; use at your own risk.
Lines beginning with a period are not given any special treatment.

.PS
copy thru % circle at ($1,$2) % until "END"
1 2
3 4
5 6
END
box
.PE

.PS
circle at (1,2)
circle at (3,4)
circle at (5,6)
box
.PE

.PS
x = 3
y = 3
[
  x := 5
  y = 5
]
print x " " y
.PE


x ^ y (exponentiation)

sin(x) 
cos(x) 
atan2(y, x) 
log(x) (base 10)

exp(x) (base 10, ie


  10^x)

sqrt(x) 
int(x) 
rand() (return a random number between 0 and 1)

rand(x) (return a random number between 1 and
x; deprecated)

srand(x) (set the random number seed)

max(e1, e2) 
min(e1, e2) 
!e 
e1 && e2

e1 || e2

e1 == e2

e1 != e2

e1 >= e2

e1 > e2

e1 <= e2

e1 < e2

"str1" == "str2"

"str1" != "str2"


String comparison expressions must be parenthesised in some contexts
to avoid ambiguity.


circle thickness 1.5 

circle shaded  green  outline  black  
for i = 1 to 4 do {
   line from ‘i’th box.nw to ‘i+1’th box.se
}


It is necessary to feed this file into
groff without adding any page information, so you must check which
.PS and
.PE requests are actually called.
For example, the mm macro package adds a page number, which is very
annoying.
At the moment, calling standard
groff without any macro package works.
Alternatively, you can define your own requests, e.g. to do nothing:



.de PS
..
.de PE
..


groff itself does not provide direct conversion into other graphics file
formats.
But there are lots of possibilities if you first transform your picture
into PostScript® format using the
groff option
-Tps. Since this
ps-file lacks BoundingBox information it is not very useful by itself, but it
may be fed into other conversion programs, usually named
ps2other or
pstoother or the like.
Moreover, the PostScript interpreter
ghostscript (gs) has built-in graphics conversion devices that are called with the option


gs -sDEVICE=<devname> 

Call
gs --help 

for a list of the available devices.


As the Encapsulated PostScript File Format
EPS is getting more and more important, and the conversion wasn’t regarded
trivial in the past you might be interested to know that there is a
conversion tool named
ps2eps which does the right job.
It is much better than the tool
ps2epsi packaged with
gs. 

For bitmapped graphic formats, you should use
pstopnm; the resulting (intermediate)
PNM file can be then converted to virtually any graphics format using the tools
of the
netpbm package .

$ cat sample.pic
.PS
ellipse "GPIC TEST";
.PE

$ gpic sample.pic
.lf 1 sample.pic
.lf 1
.PS 0.500i 0.750i
.\" 0 -0.25 0.75 0.25
.\" 0.000i 0.500i 0.750i 0.000i
.nr 00 \n(.u
.nf
.nr 0x 1
\h'0.750i'
.sp -1
\D't -1.000p'\h'1.000p'
.sp -1
\h'0.000i'\v'0.250i'\D'e0.750i 0.500i'
.sp -1
.lf 2
\h'0.375i-(\w'GPIC TEST'u/2u)'\v'0.250i-(0v/2u)+0v+0.22m'GPIC TEST
.sp -1
.sp 0.500i+1
.if \n(00 .fi
.br
.nr 0x 0
.lf 3
.PE
.lf 4


    129 Lectures 
     23 hours 

 Eduonix Learning Solutions

    5 Lectures 
     4.5 hours 

 Frahaan Hussain

    35 Lectures 
     2 hours 

 Pradeep D

    41 Lectures 
     2.5 hours 

 Musab Zayadneh

    46 Lectures 
     4 hours 

 GUHARAJANM

    6 Lectures 
     4 hours 

 Uplatz
 Print
 Add Notes
 Bookmark this page