pic - 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 .


Tpic: Pic for 


Brian W. Kernighan,
PIC — A Graphics Language for Typesetting (User Manual).
AT&T Bell Laboratories, Computing Science Technical Report No. 116
<http://cm.bell-labs.com/cm/cs/cstr/116.ps.gz>
(revised May, 1991).


ps2eps is available from CTAN mirrors, e.g.

<ftp://ftp.dante.de/tex-archive/support/ps2eps/>


W. Richard Stevens - Turning PIC Into HTML

<http://www.kohala.com/start/troff/pic2html.html>


W. Richard Stevens - Examples of picMacros

<http://www.kohala.com/start/troff/pic.examples.ps>


The interpretation of
fillval is incompatible with the pic in 10th edition Unix,
which interprets 0 as black and 1 as white.


PostScript® is a registered trademark of Adobe Systems Incorporation.











Advertisements


    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