usage: pic [ -nvC ] [ filename ... ] pic -t [ -cvzC ] [ filename ... ]
usage: pic [ -nvC ] [ filename ... ] pic -t [ -cvzC ] [ filename ... ]
PIC(1) PIC(1)
名称
pic - troff と TeX で用いるピクチャコンパイラ
書式
pic [ -nvCSU ] [ filename ... ]
pic -t [ -cvzCSU ] [ filename ... ]
解説
本 マ ニ ュアルでは、groff ドキュメントフォーマットシステムの一部である
GNU バージョンの pic について記述します。 pic は、 troff か TeX の入 力
フ ァイルに埋め込まれたピクチャの記述を troff か TeX が解釈できるコマン
ドに変換します。ピクチャは .PS で始まる行から開始され、 .PE で始まる 行
で 終了します。 .PS と .PE に狭まれた領域以外は、変更せずに素通しします
。
.PS と .PE マクロの適切な定義はユーザに任されています。使用しているマク
ロ パ ッ ケージが適当な定義を提供しない場合 (たとえば、古いバージョンの
-ms マクロの場合)、 -mpic マクロから取り出すことができます。 -mpic マク
ロではピクチャは中央寄せになります。
オプション
引数を伴わないオプションは - のあとにまとめて続けることができます。特別
なオプション -- は、オプションの最後を意味します。ファイル名のかわり に
用いられる - は、標準入力を意味します。
-C .PS や .PE のあとに空白や改行以外の文字がきても、それを .PS や
.PE であると解釈します。
-S より安全なモード; sh コマンドを実行しません。信用できない入力 を
処理する場合に便利です。 (デフォルトで有効です)
-U 安全でないモード; デフォルトオプション -S を打ち消します。
-n groff の troff に対する独自拡張を用いません。後処理に独自拡張を
解釈できないものを用いるときに、このオプションを指定します。拡張
については、 groff_out(5) に記述されています。 -n オプションはま
た、troff モードにおいて、点を打つために pic が長さ 0 の直線を使
わないようにします。
-t TeX モードです。
-c より tpic との互換性が高い処理を行います。本オプションは自動的に
-t オプションも設定します。 \ で始まる行が透過的に出力されること
が なくなります。 . で始まる行は先頭の . を \ に置き換えます。
.ps で始まる行は、特別な扱いを受けます。すなわち、整数のオプショ
ンを続けることができ、それは直線の太さ (ペンのサイズ) を 1000 分
の 1 インチで示します。オプションが省略された場合は、直前の直 線
の 太さに戻します。直線の太さの初期値は 1000 分の 8 インチです。
このように指定された直線の太さは、 thickness 属性 、 ま た は 、
linethick 変数によって負でない値が設定されていない場合にのみ有効
です。
-v バージョン番号を表示します。
-z TeX モードにおいて、長さ 0 の直線を用いて点を描画します。
他のバージョンの pic でサポートされている以下のオプションは無視されます
。
-D すべての直線を \D エスケープシーケンスにより描画します。 pic は
、つねにこの動作を行います。
-T dev troff のデバイス dev のための出力を行います。 pic が troff に 出
力する内容はデバイス非依存なので、本オプションは不要です。
使用法
本 節では GNU pic とオリジナルバージョンの pic との違いのみを説明します
。これらの違いの多くは新しいバージョンの Unix pic にもあてはまります。
TeX モード
TeX モードは -t オプションにて有効になります。 TeX モードでは、各ピクチ
ャのために \graph から呼び出される vbox を、 pic は定義します。例えば以
下のようにして、自分自身で vbox を表示する必要が有ります。
\centerline{\box\graph}
実際、vbox は高さが 0 ですから、この表現ではピクチャの上の空間がピク チ
ャの下の空間よりも若干大きくなります。
\centerline{\raise 1em\box\graph}
はこの問題を避けます。
TeX ドライバで tpic スペシャルバージョン 2 をサポートするものを使用する
必要が有ります。
\ で始まる行は透過的に通されます; 単一の % が行末に追加され、望まれない
空 白が出るのを防ぎます。この機能を使用して、安全にフォントを変更したり
\baselineskip の値を変更できます。この方法以外で実行すると、望ましく な
い 結果となるでしょう; 各自のリスクで実行して下さい。ピリオドで始まる行
は特別には扱われません。
コマンド
for variable = expr1 to expr2 [by [*]expr3] do X body X
variable を expr1 に設定します。 variable の値が expr2 以下の 間
、 body を実行して variable を expr3 だけ増加させます; もし by
が指定されない場合、 variable の増分は 1 です。もし expr3 の前に
* が指定された場合、 variable には expr3 が掛けられます。 X は
body に存在しない任意の文字を使用して構いません。
if expr then X if-true X [else Y if-false Y]
expr を評価します; もし非 0 ならば、 if-true を実行します、そ う
でないなら if-false を実行します。 X は if-true に存在しない任意
の文字であり、 Y は if-false に存在しない任意の文字です。
print arg...
引数を結合し、標準エラー出力に 1 行で出力します。各 arg は式、位
置、テキストのいずれかである必要が有ります。デバッグに有効です。
command arg...
引数を結合し、troff または TeX に 1 行として渡します。各 arg は
式、位置、テキストのいずれかである必要が有ります。これは . や \
で始まる行と同様の効果が有りますが、値や変数をそのまま通します。
sh X command X
command をシェルに渡します。 X は command 中に存在しない任意の文
字です。
copy "filename"
filename をファイルのこの位置に埋め込みます。
copy ["filename"] thru X body X [until "word"]
copy ["filename"] thru macro [until "word"]
この構造は body を filename の各行に対して 1 度づつ実行します 。
行は空白で区切られた語に分割され、 body 中の $i ただし i は 1 か
ら 9 までは、行の i 番目の語に置換されます。 filename が指定され
ない場合、行は現在の行から .PE の行までが使用されます。 until 節
が指定されると、行の最初の語が word の行までが読み込まれます; そ
の 行は捨てられます。 X は body に含まれない任意の文字です。例え
ば
.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
各行に対して実行されるコマンドは、 thru の引数としてマクロ名を与
えることで、すでに定義されているマクロをとりうる。
reset
reset variable1, variable2 ...
既定義の変数 variable1, variable2 ... をデフォルト値にリセットし
ます。引数が指定されない場合、すべての既定義の変数はデフォルト値
に リセットされます。また scale に値を定義すると、寸法を管理する
全ての既定義の変数は、それらのデフォルト値に新しい scale を掛 け
たものになります。
plot expr ["text"]
こ れ は テ キストオブジェクトであり、 text をフォーマットとして
expr を引数として sprintf を用いて構成します。 text が省略された
場合にはフォーマット文字列 "%g" が使用されます。通常のテキストオ
ブジェクトと同様属性を指定できます。適切なフォーマット文字列を指
定するように非常に気を付ける必要が有ります; pic は文字列に関して
非常に限られたチェックしか行いません。この仕様は、 sprintf の こ
とを考慮して批判されています。
variable:=expr
こ れは = と同じですが、 variable が既に定義されていなければなら
ず、 variable が変更される場合は、これが定義された最内側ブロック
でなければなりません。 (これに対して = は、variable がまだ定義さ
れていない場合には現在のブロックにおいて定義し、現在のブロックに
置いて値を変更します。)
X anything X
という形式に対しては
{ anything }
も 許されます。この場合、 anything には { と } がバランスして登場する必
要が有ります。文字列に X が含まれる場合、 { と } のバランスが悪い場合に
対応します。
式
式の文法が少し拡張されました:
x ^ y (指数)
sin(x)
cos(x)
atan2(y, x)
log(x) (base 10)
exp(x) (base 10, ie 10x)
sqrt(x)
int(x)
rand() (0 から 1 までの乱数を返す)
rand(x) (1 から x までの乱数を返す; 勧められません)
srand(x) (乱数の種を設定する)
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"
曖 昧さを避けるために、文字列の比較式はあるコンテキストにおいては括弧で
括られる必要が有ります
その他の変更
単なる式 expr は属性として受理可能です; これは dir expr と同じであり 、
dir は現在の方向です。例えば
line 2i
は 2 インチの長さの線を現在の方向へ描きます。
ピクチャの最大の幅と高さは変数 maxpswid, maxpsht により指定されます。初
期値は 8.5 および 11 です。
数を表すのに科学技術的表記が可能です。例えば
x = 5e-2
テキストの属性は組み合わせることが可能です。例えば
"foo" above ljust
は正しいです。
ブロックが検査される深さには制限は有りません。例えば
[A: [B: [C: box ]]] with .A.B.C.sw at 1,2
circle at last [].A.B.C
は受理可能です。
円弧はコンパスポイントを持ち、円弧が部分となるような円から決定されま す
。
円と円弧は点線や破線で書くことが出来ます。 TeX モードではスプラインを点
線や破線で書くことが出来ます。
ボックスの角を丸くできます。 rad 属性は、角を構成する 1/4 円の半径を 指
定します。 rad, diam 属性が与えられない場合、 boxrad が半径として使用さ
れます。初期値では boxrad は値 0 です。角の丸いボックスは点線や破線で書
くことが出来ます。
.PS 行は 2 番目の引数としてピクチャの最大の高さを指定できます。幅として
0 が指定された場合には、ピクチャのスケーリングファクタの計算において は
幅は無視されます。 GNU pic は常に水平方向と垂直方向ともに同じ縮尺でスケ
ーリングしていることに注意して下さい。これは高さが指定された場合に水 平
方向と垂直方向を同じ縮尺でスケーリングしない DWB 2.0 pic と異なります。
テキストオブジェクトはそれぞれに関連づけられた見えないボックスを持っ て
い ます。テキストオブジェクトのコンパスポイントはこのボックスによって決
定されます。オブジェクトに関連づけられた暗示的な動きもこのボックスに よ
っ て 決定されます。このボックスの寸法は width, height 属性から定まりま
す; もし width 属性が与えられていない場合は幅は textwid となります; も
し height 属性が与えられていない場合は高さは textht となります。初期値
では textwid, textht は値 0 です。
クオートされされたテキストが使用される場合、
sprintf("format", arg,...)
という形式の式を使用可能です; これは引数を format に従い整形したもの を
出力します。 format は printf(3) に記述されている文字列であり、与えられ
る数及び引数に適切なものである必要が有ります。 e, f, g, % フォーマッ ト
文字のみ使用可能です。
オブジェクトを描画する時に使用する線の太さは linethick 変数で制御可能で
す。これは線の太さをポイントで指定します。負の値はデフォルトの太さを 使
用 することを意味します: TeX 出力モードでは、8 ミリインチを使用すること
を意味します; TeX 出力モードで -c オプション使用時には、線の太 さ に は
.ps 行で指定されるものを使用ことを意味します; troff 出力モードでは、ポ
イントサイズに比例する太さを使用することを意味します。値 0 ではデバイス
が サ ポ ー ト するもっとも細い線で描画します。初期値は -1 です。また、
thick[ness] 属性が有ります。例えば
circle thickness 1.5
は 1.5 ポイントの太さの円を描画します。線の太さは scale 変数の値の影 響
も .PS 行における高さの影響も受けません。
ボックス (角の丸いボックスを含みます)、円、楕円は塗りつぶすことが可能で
あり、属性 fill[ed] で指定します。これは値が 0 から 1 の式をオプショ ン
で 引数として取ります; 0 は白で塗りつぶし、1 は黒で塗りつぶし、その間の
値では適切な灰色で塗りつぶします。 1 より大きい値も使用可能です: この場
合 、現在のテキスト及び線に使用している灰色で塗りつぶします。通常これは
黒ですが、出力デバイスが変更する機構を持っているかも知れません。引数 を
取 ら な い場合、 fillval 変数の値が使用されます。初期値では 0.5 です。
invisible 属性はオブジェクトの塗りつぶしには影響しません。塗りつぶさ れ
た オブジェクトに関連づけられたテキストは、塗りつぶし後に追加されます。
このため、塗りつぶしによってテキストが隠されることは有りません。
変数 arrowhead が非 0 でありかつ TeX モードが有効もしくは -x オプション
が 与えられている場合には、矢印の頭を実線の三角形で描画します。初期値で
は arrowhead は 1 です。
pic の troff 出力はデバイス独立です。それゆえ -T オプションは冗長です。
全ての数値はインチとして扱われます; 数値は troff マシン単位としては解釈
されません。
オブジェクトは aligned 属性を取りえます。これは後処理が grops で実行 さ
れ る場合のみ機能します。オブジェクトに関連づけられたテキストで aligned
属性を持つものは全てオブジェクトの中央において回転されます。それゆえ 、
オ ブジェクトの始点から終点への方向にあわせられます。この属性は始点と終
点が同じオブジェクトに関しては効果が有りません。
nth と言う表現が許されている場所では ‘expr’th という表現も許されます 。
’th は単一のトークンであることに注意して下さい: ’ と th の間には空白を
入れてはなりません。使用例は以下です。
for i = 1 to 4 do {
line from ‘i’th box.nw to ‘i+1’th box.se
}
変換
スタンドアロンのピクチャを pic ファイルから得るには、 pic コードを .PS
と .PE のリクエストで囲みます。 roff 設定コマンドをファイルの先頭に追加
しても良いですが、 roff テキストは追加しません。
ページ情報をなにも加えずに、このファイルを groff に喰わせることが必要で
す 。どの .PS と .PE のリクエストが実際に呼ばれたのかを確認してください
。例えば、mm マクロパッケージはページ番号を追加しますが、これは非常に迷
惑です。当面、標準の groff を、どのマクロパッケージも働かないようにして
呼び出します。または、独自のリクエストを定義します。例えば、なにもし な
いようにするには次のようにします:
.de PS
..
.de PE
..
groff 自身は、他のグラフィックスファイル書式への直接変換はできません。
しかし、 groff オプション -Tps の使用によ り 、 ピ ク チ ャ を 最 初 に
PostScript® 書式へ変換すれば、多くの可能性があります。この ps ファイル
は、BoundingBox 情報が無いので、それ自身は非常に使用し易いというもの で
はないので、他の変換プログラム、通常は ps2other や pstoother といった名
前のものに喰わせます。さらに、PostScript インタプリタ ghostscript (gs)
は 、次のオプションで呼び出し可能な組み込みのグラフィックス変換デバイス
を持ちます:
gs -sDEVICE=
PIC(1) PIC(1)
NAME
pic - compile pictures for troff or TeX
SYNOPSIS
pic [ -nvCSU ] [ filename ... ]
pic -t [ -cvzCSU ] [ filename ... ]
DESCRIPTION
This manual page describes the GNU version of pic, which is part of the
groff document formatting system. pic compiles descriptions of pic-
tures embedded within troff or TeX input files into commands that are
understood by TeX or troff. Each picture starts with a line beginning
with .PS and ends with a line beginning with .PE. Anything outside of
.PS and .PE is passed through without change.
It is the user’s responsibility to provide appropriate definitions of
the PS and PE 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 -mpic: these will center each picture.
OPTIONS
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.
-C Recognize .PS and .PE even when followed by a character other
than space or newline.
-S Safer mode; do not execute sh commands. This can be useful when
operating on untrustworthy input. (enabled by default)
-U Unsafe mode; revert the default option -S.
-n 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 groff_out(5). The -n option also causes pic not to use zero-
length lines to draw dots in troff mode.
-t TeX mode.
-c Be more compatible with tpic. Implies -t. Lines beginning with
\ are not passed through transparently. Lines beginning with .
are passed through with the initial . changed to \. A line
beginning with .ps 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
thickness attribute or by setting the linethick variable.
-v Print the version number.
-z In TeX mode draw dots using zero-length lines.
The following options supported by other versions of pic are ignored:
-D Draw all lines using the \D escape sequence. pic always does
this.
-T dev Generate output for the troff device dev. This is unnecessary
because the troff output generated by pic is device-independent.
USAGE
This section describes only the differences between GNU pic and the
original version of pic. Many of these differences also apply to newer
versions of Unix pic. A complete documentation is available in the
file
/usr/share/doc/groff/1.18.1.4/pic.ms
TeX mode
TeX mode is enabled by the -t option. In TeX mode, pic will define a
vbox called \graph for each picture. You must yourself print that vbox
using, for example, the command
\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 TeX 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 treat-
ment.
Commands
for variable = expr1 to expr2 [by [*]expr3] do 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
by 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.
if expr then X if-true X [else 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.
print 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.
command 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.
sh X command X
Pass command to a shell. X can be any character not occurring
in command.
copy "filename"
Include filename at this point in the file.
copy ["filename"] thru X body X [until "word"]
copy ["filename"] thru macro [until "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 .PE. If an until 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,
.PS
copy thru % circle at ($1,$2) % until "END"
1 2
3 4
5 6
END
box
.PE
is equivalent to
.PS
circle at (1,2)
circle at (3,4)
circle at (5,6)
box
.PE
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 thru.
reset
reset 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 scale also causes all pre-defined variables that con-
trol dimensions to be reset to their default values times the
new value of scale.
plot 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 "%g" 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; pic does
only very limited checking of the string. This is deprecated in
favour of sprintf.
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:
.PS
x = 3
y = 3
[
x := 5
y = 5
]
print x " " y
.PE
prints 5 3.
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 }.
Expressions
The syntax for expressions has been significantly extended:
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.
Other Changes
A bare expression, expr, is acceptable as an attribute; it is equiva-
lent to dir expr, where dir is the current direction. For example
line 2i
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 maxpswid and maxpsht. Initially these have values 8.5 and 11.
Scientific notation is allowed for numbers. For example
x = 5e-2
Text attributes can be compounded. For example,
"foo" above ljust
is legal.
There is no limit to the depth to which blocks can be examined. For
example,
[A: [B: [C: box ]]] with .A.B.C.sw at 1,2
circle at last [].A.B.C
is acceptable.
Arcs now have compass points determined by the circle of which the arc
is a part.
Circles and arcs can be dotted or dashed. In TeX mode splines can be
dotted or dashed.
Boxes can have rounded corners. The rad attribute specifies the radius
of the quarter-circles at each corner. If no rad or diam attribute is
given, a radius of boxrad is used. Initially, boxrad has a value of 0.
A box with rounded corners can be dotted or dashed.
The .PS 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
pic will always scale a picture by the same amount vertically as well
as horizontally. This is different from the DWB 2.0 pic 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 textwid; 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 textht. Initially textwid and textht have a value of 0.
In (almost all) places where a quoted text string can be used, an
expression of the form
sprintf("format", arg,...)
can also be used; this will produce the arguments formatted according
to format, which should be a string as described in printf(3) appropri-
ate for the number of arguments supplied.
The thickness of the lines used to draw objects is controlled by the
linethick 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 -c option, this means use the line thickness specified by .ps
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 thick[ness] attribute. For example,
circle thickness 1.5
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 scale variable,
nor by the width or height given in the .PS line.
Boxes (including boxes with rounded corners), circles and ellipses can
be filled by giving them an attribute of fill[ed]. 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 fillval 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:
outline[d] sets the color of the outline, shaded the fill color, and
colo[u]r[ed] sets both. All three keywords expect a suffix specifying
the color, for example
circle shaded "green" outline "black"
Currently, color support isn’t available in TeX mode. Predefined color
names for groff are in the device macro files, for example ps.tmac;
additional colors can be defined with the .defcolor request (see the
manual page of troff(1) for more details).
pic 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 arrowhead
is non-zero and either TeX mode is enabled or the -n option has not
been given. Initially arrowhead has a value of 1. Note that solid
arrow heads are always filled with the current outline color.
The troff output of pic is device-independent. The -T 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 aligned attribute. This will only work if the
postprocessor is grops. Any text associated with an object having the
aligned 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 nth is allowed ‘expr’th is also allowed. Note that ’th
is a single token: no space is allowed between the ’ and the th. For
example,
for i = 1 to 4 do {
line from ‘i’th box.nw to ‘i+1’th box.se
}
CONVERSION
To obtain a stand-alone picture from a pic file, enclose your pic code
with .PS and .PE requests; roff configuration commands may be added at
the beginning of the file, but no roff text.
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 trans-
form 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=
Copyright(C) linux-cmd.com All Rights Reserved. Author Takayuki Yukawa