⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pic.man

📁 早期freebsd实现
💻 MAN
字号:
.\" -*- nroff -*-.\" Like TP, but if specified indent is more than half.\" the current line-length - indent, use the default indent..de Tp.ie \\n(.$=0:((0\\$1)*2u>(\\n(.lu-\\n(.iu)) .TP.el .TP "\\$1"...ie t .ds tx T\h'-.1667m'\v'.224m'E\v'-.224m'\h'-.125m'X.el .ds tx TeX.ie \n(.g .ds ic \/.el .ds ic \^.\" The BSD man macros can't handle " in arguments to font change macros,.\" so use \(ts instead of "..tr \(ts".TH @G@PIC @MAN1EXT@ "@MDATE@" "Groff Version @VERSION@".SH NAME@g@pic \- compile pictures for troff or TeX.SH SYNOPSIS.B @g@pic[.B \-nvC][.I filename\&.\|.\|.].br.B @g@pic.B \-t[.B \-cvzC][.I filename\&.\|.\|.].SH DESCRIPTION.LPThis manual page descibes the GNU version of.BR pic ,which is part of the groff document formatting system..B piccompiles descriptions of pictures embedded within.B troffor \*(tx input files into commands that are understood by \*(tx or.BR troff .Each picture starts with a line beginning with.B .PSand ends with a line beginning with.BR .PE .Anything outside of.B .PSand.B .PEis passed through without change..LPIt is the user's responsibility to provide appropriate definitions of the.B PSand.B PEmacros.When the macro package being used does not supply such definitions(for example, old versions of \-ms),appropriate definitions can be obtained with.BR \-mpic :these will center each picture..SH OPTIONS.LPOptions that do not take arguments may be grouped behind a single.BR \- .The special option.B \-\^\-can be used to mark the end of the options.A filename of.B \-refers to the standard input..TP.B \-CRecognize.B .PSand.B .PEeven when followed by a character other than space or newline..TP.B \-nDon't use the groff extensions to the troff drawing commands.You should use this if you are using a postprocessor that doesn't supportthese extensions.The extensions are described in.BR groff_out (@MAN5EXT@).The.B \-noption also causes picnot to use zero-length lines to draw dots in troff mode..TP.B \-t\*(tx mode..TP.B \-cBe more compatible with.BR tpic .Implies.BR \-t .Lines beginning with.B \eare not passed through transparently.Lines beginning with.B .are passed through with the initial.B .changed to.BR \e .A line beginning with.B .psis given special treatment:it takes an optional integer argument specifyingthe 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 onlywhen a non-negative line thickness has not beenspecified by use of the.B thicknessattribute or by setting the.B linethickvariable..TP.B \-vPrint the version number..TP.B \-zIn \*(tx mode draw dots using zero-length lines..LPThe following options supported by other versions of.B picare ignored:.TP.B \-DDraw all lines using the \eD escape sequence..B picalways does this..TP.BI \-T \ devGenerate output for the.B troffdevice.IR dev .This is unnecessary because the.B troffoutput generated by.B picis device-independent..SH USAGEThis section describes only the differences between GNU pic and the originalversion of pic.Many of these differences also apply to newer versions of Unix pic..SS \*(tx mode.LP\*(tx mode is enabled by the.B \-toption.In \*(tx mode, pic will define a vbox called.B \egraphfor each picture.You must yourself print that vbox using, for example, the command.RS.LP.B\ecenterline{\ebox\egraph}.RE.LPActually, since the vbox has a height of zero this will produceslightly more vertical space above the picture than below it;.RS.LP.B\ecenterline{\eraise 1em\ebox\egraph}.RE.LPwould avoid this..LPYou must use a \*(tx driver that supports the.B tpicspecials, version 2..LPLines beginning with.B \eare passed through transparently; a.B %is added to the end of the line to avoid unwanted spaces.You can safely use this feature to change fonts or tochange the value of.BR \ebaselineskip .Anything else may well produce undesirable results; use at your own risk.Lines beginning with a period are not given any special treatment..SS Commands.TP\fBfor\fR \fIvariable\fR \fB=\fR \fIexpr1\fR \fBto\fR \fIexpr2\fR \[\fBby\fR [\fB*\fR]\fIexpr3\fR] \fBdo\fR \fIX\fR \fIbody\fR \fIX\fRSet.I variableto.IR expr1 .While the value of.I variableis less than or equal to.IR expr2 ,do.I bodyand increment.I variableby.IR expr3 ;if.B byis not given, increment.I variableby 1.If.I expr3is prefixed by.B *then.I variablewill instead be multiplied by.IR expr3 ..I Xcan be any character not occurring in.IR body ..TP\fBif\fR \fIexpr\fR \fBthen\fR \fIX\fR \fIif-true\fR \fIX\fR \[\fBelse\fR \fIY\fR \fIif-false\fR \fIY\fR]Evaluate.IR expr ;if it is non-zero then do.IR if-true ,otherwise do.IR if-false ..I Xcan be any character not occurring in.IR if-true ..I Ycan be any character not occurring in.IR if-false ..TP\fBprint\fR \fIarg\fR\|.\|.\|.Concatenate the arguments and print as a line on stderr.Each.I argmust be an expression, a position, or text.This is useful for debugging..TP\fBcommand\fR \fIarg\fR\|.\|.\|.Concatenate the argumentsand pass them through as a line to troff or\*(tx.Each.I argmust be an expression, a position, or text.This has a similar effect to a line beginning with.B .or.BR \e ,but allows the values of variables to be passed through..TP\fBsh\fR \fIX\fR \fIcommand\fR \fIX\fRPass.I commandto a shell..I Xcan be any character not occurring in.IR command ..TP\fBcopy\fR \fB"\fIfilename\fB"\fRInclude.I filenameat this point in the file..TP\fBcopy\fR [\fB"\fIfilename\fB"\fR] \fBthru\fR \fIX\fR \fIbody\fR \fIX\fR \[\fBuntil\fR \fB"\fIword\*(ic\fB"\fR].ns.TP\fBcopy\fR [\fB"\fIfilename\fB"\fR] \fBthru\fR \fImacro\fR \[\fBuntil\fR \fB"\fIword\*(ic\fB"\fR]This construct does.I bodyonce for each line of.IR filename ;the line is split into blank-delimited words,and occurrences of.BI $ iin.IR body ,for.I ibetween 1 and 9,are replaced by the.IR i -thword of the line.If.I filenameis not given, lines are taken from the current input up to.BR .PE .If an.B untilclause is specified,lines will be read only until a line the first word of which is.IR word ;that line will then be discarded..I Xcan be any character not occurring in.IR body .For example,.RS.IP.ft B.nf\&.PScopy thru % circle at ($1,$2) % until "END"1 23 45 6ENDbox\&.PE.ft.fi.RE.IPis equivalent to.RS.IP.ft B.nf\&.PScircle at (1,2)circle at (3,4)circle at (5,6)box\&.PE.ft.fi.RE.IPThe commands to be performed for each line can also be takenfrom a macro defined earlier by giving the name of the macroas the argument to.BR thru ..LP.B reset.br.ns.TP\fBreset\fI variable1\fB,\fI variable2 .\^.\^.Reset pre-defined variables.IR variable1 ,.I variable2\&.\^.\^. to their default values.If no arguments are given, reset all pre-defined variablesto their default values.Note that assigning a value to.B scalealso causes all pre-defined variables that control dimensionsto be reset to their default values times the new value of scale..TP\fBplot\fR \fIexpr\fR [\fB"\fItext\*(ic\fB"\fR]This is a text object which is constructed by using.I textas a format string for sprintfwith an argument of.IR expr .If.I textis omitted a format string of.B "\(ts%g\(ts"is used.Attributes can be specified in the same way as for a normal textobject.Be very careful that you specify an appropriate format string;pic does only very limited checking of the string.This is deprecated in favour of.BR sprintf ..TP.IB variable := exprThis is similar to.B =except.I variablemust already be defined,and the value of.I variablewill be changed only in the innermost block in which it is defined.(By contrast,.B =defines the variable in the current block if it is not already defined there,and then changes the value in the current block.).LPArguments of the form.IP.IR X\  anything\  X.LPare also allowed to be of the form.IP.BI {\  anything\  }.LPIn this case.I anythingcan contain balanced occurrences of.B {and.BR } .Strings may contain.I Xor imbalanced occurrences of.B {and.BR } ..SS ExpressionsThe syntax for expressions has been significantly extended:.LP.IB  x\  ^\  y(exponentiation).br.BI sin( x ).br.BI cos( x ).br.BI atan2( y , \ x ).br.BI log( x )(base 10).br.BI exp( x )(base 10, ie 10\v'-.4m'\fIx\*(ic\fR\v'.4m').br.BI sqrt( x ).br.BI int( x ).br.B rand()(return a random number between 0 and 1).br.BI rand( x )(return a random number between 1 and.IR x ;deprecated).br.BI max( e1 , \ e2 ).br.BI min( e1 , \ e2 ).br.BI ! e.br\fIe1\fB && \fIe2\fR.br\fIe1\fB || \fIe2\fR.br\fIe1\fB == \fIe2\fR.br\fIe1\fB != \fIe2\fR.br\fIe1\fB >= \fIe2\fR.br\fIe1\fB > \fIe2\fR.br\fIe1\fB <= \fIe2\fR.br\fIe1\fB < \fIe2\fR.br\fB"\fIstr1\*(ic\fB" == "\fIstr2\*(ic\fB"\fR.br\fB"\fIstr1\*(ic\fB" != "\fIstr2\*(ic\fB"\fR.br.LPString comparison expressions must be parenthesised in some contextsto avoid ambiguity..SS Other Changes.LPA bare expression,.IR expr ,is acceptable as an attribute;it is equivalent to.IR dir\ expr ,where.I diris the current direction.For example.IP.B line 2i.LPmeans draw a line 2 inches long in the current direction..LPThe maximum width and height of the picture are taken from the variables.B maxpswidand.BR maxpsht .Initially these have values 8.5 and 11..LPScientific notation is allowed for numbers.For example.RS.Bx = 5e\-2.RE.LPText attributes can be compounded.For example,.RS.B"foo" above ljust.REis legal..LPThere is no limit to the depth to which blocks can be examined.For example,.RS.B[A: [B: [C: box ]]] with .A.B.C.sw at 1,2.br.Bcircle at last [\^].A.B.C.REis acceptable..LPArcs now have compass pointsdetermined by the circle of which the arc is a part..LPCircles and arcs can be dotted or dashed.In \*(tx mode splines can be dotted or dashed..LPBoxes can have rounded corners.The.B radattribute specifies the radius of the quarter-circles at each corner.If no.B rador.B diamattribute is given, a radius of.B boxradis used.Initially,.B boxradhas a value of 0.A box with rounded corners can be dotted or dashed..LPThe.B .PSline can have a second argument specifying a maximum height forthe picture.If the width of zero is specified the width will be ignored in computingthe scaling factor for the picture.Note that GNU pic will always scale a picture by the same amountvertically as horizontally.This is different from the.SM DWB2.0 pic which may scale a picture by adifferent amount vertically than horizontally if a height isspecified..LPEach 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 determinedby 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.BR textwid ;if the height attribute is not supplied then the height will be taken to bethe number of text strings associated with the objecttimes.BR textht .Initially.B textwidand.B texththave a value of 0..LPIn places where a quoted text string can be used,an expression of the form.IP.BI sprintf(\(ts format \(ts,\  arg ,\fR.\|.\|.\fB).LPcan also be used;this will produce the arguments formatted according to.IR format ,which should be a string as described in.BR printf (3)appropriate for the number of arguments supplied,using only the.BR e ,.BR f ,.B gor.B %format characters..LPThe thickness of the lines used to draw objects is controlled by the.B linethickvariable.This gives the thickness of lines in points.A negative value means use the default thickness:in \*(tx output mode, this means use a thickness of 8 milliinches;in \*(tx output mode with the.B -coption, this means use the line thickness specified by.B .pslines;in troff output mode, this means use a thickness proportionalto the pointsize.A zero value means draw the thinnest possible line supported bythe output device.Initially it has a value of -1.There is also a.BR thick [ ness ]attribute.For example,.RS.LP.B circle thickness 1.5.RE.LPwould draw a circle using a line with a thickness of 1.5 points.The thickness of lines is not affected by thevalue of the.B scalevariable, nor by the width or height given in the.B .PSline..LPBoxes (including boxes with rounded corners),circles and ellipses can be filled by giving then an attribute of.BR fill [ ed ].This takes an optional argument of an expression with a value between0 and 1; 0 will fill it with white, 1 with black, values in betweenwith a proportionally gray shade.A value greater than 1 can also be used:this means fill with theshade of gray that is currently being used for text and lines.Normally this will be black, but output devices may providea mechanism for changing this.Without an argument, then the value of the variable.B fillvalwill 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 theobject has been filled, so that the text will not be obscuredby the filling..LPArrow heads will be drawn as solid triangles if the variable.B arrowheadis non-zero and either \*(tx mode is enabled orthe.B \-xoption has been given.Initially.B arrowheadhas a value of 1..LPThe troff output of pic is device-independent.The.B \-Toption is therefore redundant.All numbers are taken to be in inches; numbers are never interpretedto be in troff machine units..LPObjects can have an.B alignedattribute.This will only work when the postprocessor is.BR grops .Any text associated with an object having the.B alignedattribute will be rotated about the center of the objectso that it is aligned in the direction from the start pointto the end point of the object.Note that this attribute will have no effect for objects whose start andend points are coincident..LPIn places where.IB n this allowed.BI ` expr 'this also allowed.Note that.B 'this a single token: no space is allowed between the.B 'and the.BR th .For example,.IP.B.nffor i = 1 to 4 do {   line from `i'th box.nw to `i+1'th box.se}.fi.SH FILES.Tp \w'\fB@MACRODIR@/tmac.pic'u+3n.B@MACRODIR@/tmac.picExample definitions of the.B PSand.B PEmacros..SH "SEE ALSO".BR @g@troff (@MAN1EXT@),.BR groff_out (@MAN5EXT@),.BR tex (1).brTpic: Pic for \*(tx.brAT&T Bell Laboratories, Computing Science Technical Report No.\ 116,PIC \(em A Graphics Language for Typesetting.(This can be obtained by sending a mail message to netlib@research.att.comwith a body of `send\ 116\ from\ research/cstr'.).SH BUGS.LPInput characters that are illegal for.B groff(ie those with.SM ASCIIcode 0 or between 013 and 037 octal or between 0200 and 0237 octal)are rejected even in \*(tx mode..LPThe interpretation of.B fillvalis incompatible with the pic in 10th edition Unix,which interprets 0 as black and 1 as white.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -