Manual Pages for UNIX Darwin command on man pic
MyWebUniversity

Manual Pages for UNIX Darwin command on man pic

PIC(1) PIC(1)

NAME

pic - compile pictures for troff or TeX

SYNOPSIS

ppiicc [ -nnvvCCSSUU ] [ filename ... ]

ppiicc -tt [ -ccvvzzCCSSUU ] [ filename ... ]

DESCRIPTION

This manual page describes the GNU version of ppiicc, which is part of the

groff document formatting system. ppiicc compiles descriptions of pic-

tures embedded within ttrrooffff or TeX input files into commands that are

understood by TeX or ttrrooffff. Each picture starts with a line beginning

with ..PPSS and ends with a line beginning with ..PPEE. Anything outside of ..PPSS and ..PPEE is passed through without change. It is the user's responsibility to provide appropriate definitions of

the PPSS and PPEE macros. When the macro package being used does not sup-

ply such definitions (for example, old versions of -ms), appropriate

definitions can be obtained with -mmppiicc: These will center each picture.

OOPPTTIIOONNSS

Options that do not take arguments may be grouped behind a single -.

The special option -- can be used to mark the end of the options. A

filename of - refers to the standard input.

-CC Recognize ..PPSS and ..PPEE even when followed by a character other

than space or newline.

-SS Safer mode; do not execute sshh commands. This can be useful when

operating on untrustworthy input. (enabled by default)

-UU Unsafe mode; revert the default option -SS.

-nn Don't use the groff extensions to the troff drawing commands.

You should use this if you are using a postprocessor that doesn't support these extensions. The extensions are described

in ggrrooffffoouutt(5). The -nn option also causes ppiicc not to use zero-

length lines to draw dots in troff mode.

-tt TeX mode.

-cc Be more compatible with ttppiicc. Implies -tt. Lines beginning with

\\ are not passed through transparently. Lines beginning with .. are passed through with the initial .. changed to \\. A line beginning with ..ppss is given special treatment: it takes an optional integer argument specifying the line thickness (pen size) in milliinches; a missing argument restores the previous line thickness; the default line thickness is 8 milliinches.

The line thickness thus specified takes effect only when a non-

negative line thickness has not been specified by use of the tthhiicckknneessss attribute or by setting the lliinneetthhiicckk variable.

-vv Print the version number.

-zz In TeX mode draw dots using zero-length lines.

The following options supported by other versions of ppiicc are ignored:

-DD Draw all lines using the \D escape sequence. ppiicc always does

this.

-TT dev Generate output for the ttrrooffff device dev. This is unnecessary

because the ttrrooffff output generated by ppiicc is device-independent.

UUSSAAGGEE This section describes only the differences between GNU ppiicc and the original version of ppiicc. Many of these differences also apply to newer versions of Unix ppiicc. A complete documentation is available in the file //uussrr//sshhaarree//ddoocc//ggrrooffff//11..1199..11//ppiicc..mmss TTeeXX mmooddee

TeX mode is enabled by the -tt option. In TeX mode, ppiicc will define a

vbox called \\ggrraapphh for each picture. Use the ffiiggnnaammee command to change

the name of the vbox. You must yourself print that vbox using, for example, the command \\cceenntteerrlliinnee{{\\bbooxx\\ggrraapphh}} Actually, since the vbox has a height of zero (it is defined with

\vtop) this will produce slightly more vertical space above the picture

than below it; \\cceenntteerrlliinnee{{\\rraaiissee 11eemm\\bbooxx\\ggrraapphh}} would avoid this. To make the vbox having a positive height and a depth of zero (as used

e.g. by LaTeX's ggrraapphhiiccss..ssttyy), define the following macro in your docu-

ment:

\\ddeeff\\ggppiiccbbooxx##11{{%%

\\vvbbooxx{{\\uunnvvbbooxx\\ccssnnaammee ##11\\eennddccssnnaammee\\kkeerrnn 00pptt}}}}

Now you can simply say \\ggppiiccbbooxx{{ggrraapphh}} instead of \box\graph. You must use a TeX driver that supports the ttppiicc 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 \\bbaasseelliinneesskkiipp. Anything else may well produce undesirable results; use at your own

risk. Lines beginning with a period are not given any special treat-

ment. CCoommmmaannddss ffoorr variable == expr1 ttoo expr2 [bbyy [**]expr3] ddoo X body X Set variable to expr1. While the value of variable is less than or equal to expr2, do body and increment variable by expr3; if bbyy is not given, increment variable by 1. If expr3 is prefixed by ** then variable will instead be multiplied by expr3. X can be any character not occurring in body.

iiff expr tthheenn X if-true X [eellssee Y if-false Y]

Evaluate expr; if it is non-zero then do if-true, otherwise do

if-false. X can be any character not occurring in if-true. Y

can be any character not occurring in if-false.

pprriinntt arg... Concatenate the arguments and print as a line on stderr. Each arg must be an expression, a position, or text. This is useful for debugging. ccoommmmaanndd arg... Concatenate the arguments and pass them through as a line to troff or TeX. Each arg must be an expression, a position, or text. This has a similar effect to a line beginning with .. or \\, but allows the values of variables to be passed through. sshh X command X Pass command to a shell. X can be any character not occurring in command. ccooppyy ""filename"" Include filename at this point in the file. ccooppyy [""filename""] tthhrruu X body X [uunnttiill ""word""] ccooppyy [""filename""] tthhrruu macro [uunnttiill ""word""] This construct does body once for each line of filename; the

line is split into blank-delimited words, and occurrences of $$i

in body, for i between 1 and 9, are replaced by the i-th word of

the line. If filename is not given, lines are taken from the current input up to ..PPEE. If an uunnttiill clause is specified, lines will be read only until a line the first word of which is word; that line will then be discarded. X can be any character not occurring in body. For example, ..PPSS

ccooppyy tthhrruu %% cciirrccllee aatt (($$11,,$$22)) %% uunnttiill ""EENNDD""

11 22 33 44 55 66 EENNDD bbooxx ..PPEE is equivalent to ..PPSS cciirrccllee aatt ((11,,22)) cciirrccllee aatt ((33,,44)) cciirrccllee aatt ((55,,66)) bbooxx ..PPEE The commands to be performed for each line can also be taken from a macro defined earlier by giving the name of the macro as the argument to tthhrruu. rreesseett rreesseett variable1[,,] variable2 ...

Reset pre-defined variables variable1, variable2 ... to their

default values. If no arguments are given, reset all pre-

defined variables to their default values. Note that assigning

a value to ssccaallee also causes all pre-defined variables that con-

trol dimensions to be reset to their default values times the new value of scale. pplloott expr [""text""] This is a text object which is constructed by using text as a format string for sprintf with an argument of expr. If text is

omitted a format string of ""%%gg"" is used. Attributes can be

specified in the same way as for a normal text object. Be very careful that you specify an appropriate format string; ppiicc does only very limited checking of the string. This is deprecated in favour of sspprriinnttff. variable ::== expr This is similar to == except variable must already be defined,

and expr will be assigned to variable without creating a vari-

able local to the current block. (By contrast, == defines the variable in the current block if it is not already defined there, and then changes the value in the current block only.) For example, the following: ..PPSS xx == 33 yy == 33 [[ xx ::== 55 yy == 55 ]] pprriinntt xx "" "" yy ..PPEE prints 55 33. Arguments of the form X anything X are also allowed to be of the form {{ anything }} In this case anything can contain balanced occurrences of {{ and }}. Strings may contain X or imbalanced occurrences of {{ and }}. EExxpprreessssiioonnss The syntax for expressions has been significantly extended: x ^^ y (exponentiation) ssiinn((x)) ccooss((x)) aattaann22((y,, x)) lloogg((x)) (base 10) eexxpp((x)) (base 10, ie 10^x) ssqqrrtt((x)) iinntt((x)) rraanndd(()) (return a random number between 0 and 1) rraanndd((x)) (return a random number between 1 and x; deprecated) ssrraanndd((x)) (set the random number seed) mmaaxx((e1,, e2)) mmiinn((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. OOtthheerr CChhaannggeess

A bare expression, expr, is acceptable as an attribute; it is equiva-

lent to dir expr, where dir is the current direction. For example lliinnee 22ii means draw a line 2 inches long in the current direction. The `i' (or `I') character is ignored; to use another measurement unit, set the scale variable to an appropriate value.

The maximum width and height of the picture are taken from the vari-

ables mmaaxxppsswwiidd and mmaaxxppsshhtt. Initially these have values 8.5 and 11. Scientific notation is allowed for numbers. For example

xx == 55ee-22

Text attributes can be compounded. For example, ""ffoooo"" aabboovvee lljjuusstt is legal. There is no limit to the depth to which blocks can be examined. For example, [[AA:: [[BB:: [[CC:: bbooxx ]]]]]] wwiitthh ..AA..BB..CC..ssww aatt 11,,22 cciirrccllee aatt llaasstt [[]]..AA..BB..CC is acceptable. Arcs now have compass points determined by the circle of which the arc is a part. Circles, ellipses, and arcs can be dotted or dashed. In TeX mode splines can be dotted or dashed also. Boxes can have rounded corners. The rraadd attribute specifies the radius

of the quarter-circles at each corner. If no rraadd or ddiiaamm attribute is

given, a radius of bbooxxrraadd is used. Initially, bbooxxrraadd has a value of 0. A box with rounded corners can be dotted or dashed. The ..PPSS line can have a second argument specifying a maximum height for

the picture. If the width of zero is specified the width will be

ignored in computing the scaling factor for the picture. Note that GNU

ppiicc will always scale a picture by the same amount vertically as well

as horizontally. This is different from the DWB 2.0 ppiicc which may

scale a picture by a different amount vertically than horizontally if a

height is specified. Each text object has an invisible box associated with it. The compass points of a text object are determined by this box. The implicit motion associated with the object is also determined by this box. The dimensions of this box are taken from the width and height attributes; if the width attribute is not supplied then the width will be taken to be tteexxttwwiidd; if the height attribute is not supplied then the height will be taken to be the number of text strings associated with the object times tteexxtthhtt. Initially tteexxttwwiidd and tteexxtthhtt have a value of 0. In (almost all) places where a quoted text string can be used, an expression of the form sspprriinnttff((""format"",, arg,,...)) can also be used; this will produce the arguments formatted according

to format, which should be a string as described in pprriinnttff(3) appropri-

ate for the number of arguments supplied. The thickness of the lines used to draw objects is controlled by the lliinneetthhiicckk variable. This gives the thickness of lines in points. A negative value means use the default thickness: in TeX output mode, this means use a thickness of 8 milliinches; in TeX output mode with

the -cc option, this means use the line thickness specified by ..ppss

lines; in troff output mode, this means use a thickness proportional to

the pointsize. A zero value means draw the thinnest possible line sup-

ported by the output device. Initially it has a value of -1. There is

also a tthhiicckk[nneessss] attribute. For example, cciirrccllee tthhiicckknneessss 11..55 would draw a circle using a line with a thickness of 1.5 points. The thickness of lines is not affected by the value of the ssccaallee variable, nor by the width or height given in the ..PPSS line. Boxes (including boxes with rounded corners), circles and ellipses can be filled by giving them an attribute of ffiillll[eedd]. This takes an optional argument of an expression with a value between 0 and 1; 0 will

fill it with white, 1 with black, values in between with a proportion-

ally gray shade. A value greater than 1 can also be used: this means fill with the shade of gray that is currently being used for text and lines. Normally this will be black, but output devices may provide a mechanism for changing this. Without an argument, then the value of the variable ffiillllvvaall will be used. Initially this has a value of 0.5. The invisible attribute does not affect the filling of objects. Any text associated with a filled object will be added after the object has been filled, so that the text will not be obscured by the filling. Three additional modifiers are available to specify colored objects: oouuttlliinnee[dd] sets the color of the outline, sshhaaddeedd the fill color, and ccoolloo[uu]rr[eedd] sets both. All three keywords expect a suffix specifying the color, for example cciirrccllee sshhaaddeedd ""ggrreeeenn"" oouuttlliinnee ""bbllaacckk"" Currently, color support isn't available in TeX mode. Predefined color names for ggrrooffff are in the device macro files, for example ppss..ttmmaacc; additional colors can be defined with the ..ddeeffccoolloorr request (see the manual page of ttrrooffff(1) for more details).

To change the name of the vbox in TeX mode, set the pseudo-variable

ffiiggnnaammee (which is actually a specially parsed command) within a pic-

ture. Example: ..PPSS ffiiggnnaammee == ffoooobbaarr;; ...... ..PPEE

The picture is then available in the box \\ffoooobbaarr.

ppiicc assumes that at the beginning of a picture both glyph and fill

color are set to the default value. Arrow heads will be drawn as solid triangles if the variable aarrrroowwhheeaadd

is non-zero and either TeX mode is enabled or the -nn option has not

been given. Initially aarrrroowwhheeaadd has a value of 1. Note that solid arrow heads are always filled with the current outline color.

The troff output of ppiicc is device-independent. The -TT option is there-

fore redundant. All numbers are taken to be in inches; numbers are never interpreted to be in troff machine units. Objects can have an aalliiggnneedd attribute. This will only work if the postprocessor is ggrrooppss. Any text associated with an object having the aalliiggnneedd attribute will be rotated about the center of the object so that it is aligned in the direction from the start point to the end point of the object. Note that this attribute will have no effect for objects whose start and end points are coincident. In places where ntthh is allowed ``expr''tthh is also allowed. Note that ''tthh is a single token: no space is allowed between the '' and the tthh. For example, ffoorr ii == 11 ttoo 44 ddoo {{ lliinnee ffrroomm ``ii''tthh bbooxx..nnww ttoo ``ii++11''tthh bbooxx..ssee }} CCOONNVVEERRSSIIOONN

To obtain a stand-alone picture from a ppiicc file, enclose your ppiicc code

with ..PPSS and ..PPEE requests; rrooffff configuration commands may be added at the beginning of the file, but no rrooffff text. It is necessary to feed this file into ggrrooffff without adding any page information, so you must check which ..PPSS and ..PPEE requests are actually called. For example, the mm macro package adds a page number, which is very annoying. At the moment, calling standard ggrrooffff without any macro package works. Alternatively, you can define your own requests, e.g. to do nothing: ..ddee PPSS .... ..ddee PPEE .... ggrrooffff itself does not provide direct conversion into other graphics

file formats. But there are lots of possibilities if you first trans-

form your picture into PostScript(R) format using the ggrrooffff option

-TTppss. 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 ppss22other or ppssttooother or the like. Moreover, the Post-

Script interpreter gghhoossttssccrriipptt (ggss) has built-in graphics conversion

devices that are called with the option

ggss -ssDDEEVVIICCEE==

Call

ggss --hheellpp

for a list of the available devices. As the Encapsulated PostScript File Format EEPPSS 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 ppss22eeppss which does the right job. It is much better than the tool ppss22eeppssii packaged with ggss. For bitmapped graphic formats, you should use ppssttooppnnmm; the resulting (intermediate) PPNNMM file can be then converted to virtually any graphics format using the tools of the nneettppbbmm package . FILES //uussrr//sshhaarree//ggrrooffff//11..1199..11//ttmmaacc//ppiicc..ttmmaacc Example definitions of the PPSS and PPEE macros.

SEE ALSO

ttrrooffff(1), ggrrooffffoouutt(5), tteexx(1), ggss(1), ppss22eeppss(1), ppssttooppnnmm(1), ppss22eeppssii(1), ppnnmm(5)

Tpic: Pic for TeX

Brian W. Kernighan, PIC - A Graphics Language for Typesetting (User

Manual). AT&T Bell Laboratories, Computing Science Technical Report

No. 116 (revised May,

1991). ppss22eeppss is available from CTAN mirrors, e.g.

W. Richard Stevens - Turning PIC Into HTML

W. Richard Stevens - Examples of picMacros

BUGS

Input characters that are invalid for ggrrooffff (ie those with ASCII code 0, or 013 octal, or between 015 and 037 octal, or between 0200 and 0237 octal) are rejected even in TeX mode.

The interpretation of ffiillllvvaall is incompatible with the pic in 10th edi-

tion Unix, which interprets 0 as black and 1 as white. PostScript(R) is a registered trademark of Adobe Systems Incorporation. Groff Version 1.19.1 9 July 2003 PIC(1)




Contact us      |      About us      |      Term of use      |       Copyright © 2000-2019 MyWebUniversity.com ™