summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/pmgraph/pmgraph.tex
blob: a3450c55510b534c6c443689ecaf0ce023e342c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
%% The following copyright notice and licensing information was added
%% by Clea F. Rees on behalf of Alexander Berdnikov on 2008/11/03.
%%
%% Copyright 1996 Alexander Berdnikov, Olga Grineva
%%
%% This file is part of pmgraph.
%% 
%% pmgraph is free software: you can redistribute it and/or modify
%% it under the terms of the GNU General Public License as published by
%% the Free Software Foundation, either version 3 of the License, or
%% (at your option) any later version.
%% 
%% pmgraph is distributed in the hope that it will be useful,
%% but WITHOUT ANY WARRANTY; without even the implied warranty of
%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
%% See the  GNU General Public License for more details.
%% 
%% You should have received a copy of the GNU General Public License
%% along with pmgraph.  If not, see <http://www.gnu.org/licenses/>.

\documentstyle[12pt,a4,pmgraph]{article}

\title{{\sc pmgraph.sty}: some useful macros which extends
the \LaTeX{} environment {\tt picture}\\[0.5\baselineskip]
\Large Version 1.0}

\author{
\begin{minipage}{0.4\textwidth}
\begin{center} A.S.Berdnikov\\{\tt berd{\sl @}ianin.spb.su} \end{center}
\end{minipage}
\hfill
\begin{minipage}{0.4\textwidth}
\begin{center} O.A.Grineva\\{\tt olga{\sl @}ianin.spb.su} \end{center}
\end{minipage}
}

\date{}

\def\PiC{P\kern-.12em\lower.5ex\hbox{I}\kern-.075emC\spacefactor1000 }
\font\manual=logo10 at 12pt
\def\MF{{\manual META}\-{\manual FONT}\spacefactor1000 }
\def\AW{Addison\kern.1em-\penalty 0pt \hskip 0pt Wesley}
\def\CandT{{\sl Computers \& Typesetting}}
\def\TUB{{\sl TUGboat\/}}

\newcommand{\bs}{\char '134 }  % char \
\newcommand{\lb}{\char '173 }  % char {
\newcommand{\rb}{\char '175 }  % char }
\makeatletter
\def\hackersmile{\@ifnextchar[{\@hackersmile}{\@hackersmile[10]}}
\def\@hackersmile[#1]{\hbox{%
   \unitlength=1pt\relax
   \unitlength=#1\unitlength
   \divide\unitlength by 10\relax
   \thicklines
   \raise -3\unitlength \hbox{%
   \begin{picture}(12,12)(-6,-6)
   \put(0,0){\circle{10}}
   \put(-2,1.75){\circle*{1}}
   \put(2,1.75){\circle*{1}}
   \thicklines
   \put(-2.75,3){\line(1,0){1.5}}
   \put(2.75,3){\line(-1,0){1.5}}
   \put(0,-1){\line(0,1){3}}
   \put(-2.5,-2.5){\line(1,0){5}}
   \put(-2.5,-2.5){\line(0,1){1}}
   \put(2.5,-2.5){\line(0,1){1}}
   \end{picture}%
}}}
\makeatother

\newcommand{\pmg}{{\sc pmgraph}}
\newcommand{\pmgs}{{\sc pmgraph.sty}}

\begin{document}
\maketitle


The original \TeX/\LaTeX{} possibilities to create
pictures are relatively poor, and there are
many extensions ({\tt epic/eepic}, {\tt pictex}, {\tt drawtex},
{\tt xypic}, {\tt mfpic}, etc.) which were created to extend
its possibilities to a higher level. The macro \pmgs{}
({\em  poor-man-graphics}) which are
described here are not so general as the ones cited
above. They manupulate with the pseudo-graphical
fonts which are used by generic \LaTeX{} without additional
extensions --- mainly because the variations of
\PiC\TeX{}, \MF{} and new graphical font
themes are already realized by other authors
and on sufficiently higher level.
To some extend the purpose of our work was to see
how far it is possible to move in the development of new
useful graphical primitives for \LaTeX{} {\em without}
the investment of the external graphical tools.

The style file \pmgs{} includes the following features:
\begin{itemize}
\item
the vectors with a set of slopes which is
as general as the line slopes implemented in \LaTeX;
\item
the vectors with an arrow at the beginning,
at the middle or at the end of vector with various orientations
of the arrow;
\item
the circles and circular arcs with nearly arbitrary diameter
using magnified {\tt circle} and {\tt circlew} \LaTeX{} fonts;
\item
the 1/4 circular arcs correctly positioned
at the centrum or at the corner;
\item
extended set of frames which include various
corner style and the optional multiple frame shadows
with a variety of styles;
\item
tools which enable the user to extend the variety of
frame styles and the shadow styles as far as his/her
fantasy allows it;
\item
automatic calculation of the picture size in terms
of the current text width --- including the {\tt picture}
inserted inside list environments.
\end{itemize}
Even not very complicated, these macros appears to
be useful in our work, and it seems that they can be
useful for other \TeX-users too.

\section*{Vectors}

The number of angles for inclined lines which can be used
in \LaTeX{} is limited to great extend, but the number of
angles for  {\em vectors} is limited even more.
The variety of vectors can be extended if instead of the
{\em strictly} inclined arrows at the end of the inclined
line the arrow with the {\em approximate} inclination is added.
Corresponding changes are incorporated in \pmg{} where
the relation between strict inclinations and approximate
inclinations are shown in Table~\ref{Tab1}. The corrections require
the modifications of the internal \LaTeX{} commands
{\tt\bs{}@svector}, {\tt\bs{}@getlarrow}, {\tt\bs{}@getrarrow}
and the command {\tt\bs{}vector} itself. As a result the command
{\tt\bs{}vector} starts to draw the vectors for all inclinations
valid for \LaTeX{} lines as it is shown on Fig.~\ref{FigA}.
The vectors are not so ideal as it is required by \TeX{} standards,
but the results are acceptable for all inclinations except $(6,1)$.

\begin{figure}
\centerline{%
\hfill
\begin{Picture}[23](600,600)
\put(300,300){\vector(1,0){300}}
\put(300,300){\vector(-1,0){300}}
\put(300,300){\vector(0,1){300}}
\put(300,300){\vector(0,-1){300}}
\put(300,300){\vector(1,1){300}}
\put(300,300){\vector(1,2){150}}
\put(300,300){\vector(1,3){100}}
\put(300,300){\vector(1,4){75}}
\put(300,300){\line(1,5){60}}
\put(300,300){\line(1,6){50}}
\put(300,300){\vector(2,1){300}}
\put(300,300){\vector(2,3){200}}
\put(300,300){\line(2,5){120}}
\put(300,300){\vector(3,1){300}}
\put(300,300){\vector(3,2){300}}
\put(300,300){\vector(3,4){225}}
\put(300,300){\line(3,5){180}}
\put(300,300){\vector(4,1){300}}
\put(300,300){\vector(4,3){300}}
\put(300,300){\line(4,5){240}}
\put(300,300){\line(5,1){300}}
\put(300,300){\line(5,2){300}}
\put(300,300){\line(5,3){300}}
\put(300,300){\line(5,4){300}}
\put(300,300){\line(5,6){250}}
\put(300,300){\line(6,1){300}}
\put(300,300){\line(6,5){300}}
\put(300,300){\vector(1,-1){300}}
\put(300,300){\vector(1,-2){150}}
\put(300,300){\vector(1,-3){100}}
\put(300,300){\vector(1,-4){75}}
\put(300,300){\line(1,-5){60}}
\put(300,300){\line(1,-6){50}}
\put(300,300){\vector(2,-1){300}}
\put(300,300){\vector(2,-3){200}}
\put(300,300){\line(2,-5){120}}
\put(300,300){\vector(3,-1){300}}
\put(300,300){\vector(3,-2){300}}
\put(300,300){\vector(3,-4){225}}
\put(300,300){\line(3,-5){180}}
\put(300,300){\vector(4,-1){300}}
\put(300,300){\vector(4,-3){300}}
\put(300,300){\line(4,-5){240}}
\put(300,300){\line(5,-1){300}}
\put(300,300){\line(5,-2){300}}
\put(300,300){\line(5,-3){300}}
\put(300,300){\line(5,-4){300}}
\put(300,300){\line(5,-6){250}}
\put(300,300){\line(6,-1){300}}
\put(300,300){\line(6,-5){300}}
\put(300,300){\vector(-1,1){300}}
\put(300,300){\vector(-1,2){150}}
\put(300,300){\vector(-1,3){100}}
\put(300,300){\vector(-1,4){75}}
\put(300,300){\line(-1,5){60}}
\put(300,300){\line(-1,6){50}}
\put(300,300){\vector(-2,1){300}}
\put(300,300){\vector(-2,3){200}}
\put(300,300){\line(-2,5){120}}
\put(300,300){\vector(-3,1){300}}
\put(300,300){\vector(-3,2){300}}
\put(300,300){\vector(-3,4){225}}
\put(300,300){\line(-3,5){180}}
\put(300,300){\vector(-4,1){300}}
\put(300,300){\vector(-4,3){300}}
\put(300,300){\line(-4,5){240}}
\put(300,300){\line(-5,1){300}}
\put(300,300){\line(-5,2){300}}
\put(300,300){\line(-5,3){300}}
\put(300,300){\line(-5,4){300}}
\put(300,300){\line(-5,6){250}}
\put(300,300){\line(-6,1){300}}
\put(300,300){\line(-6,5){300}}
\put(300,300){\vector(-1,-1){300}}
\put(300,300){\vector(-1,-2){150}}
\put(300,300){\vector(-1,-3){100}}
\put(300,300){\vector(-1,-4){75}}
\put(300,300){\line(-1,-5){60}}
\put(300,300){\line(-1,-6){50}}
\put(300,300){\vector(-2,-1){300}}
\put(300,300){\vector(-2,-3){200}}
\put(300,300){\line(-2,-5){120}}
\put(300,300){\vector(-3,-1){300}}
\put(300,300){\vector(-3,-2){300}}
\put(300,300){\vector(-3,-4){225}}
\put(300,300){\line(-3,-5){180}}
\put(300,300){\vector(-4,-1){300}}
\put(300,300){\vector(-4,-3){300}}
\put(300,300){\line(-4,-5){240}}
\put(300,300){\line(-5,-1){300}}
\put(300,300){\line(-5,-2){300}}
\put(300,300){\line(-5,-3){300}}
\put(300,300){\line(-5,-4){300}}
\put(300,300){\line(-5,-6){250}}
\put(300,300){\line(-6,-1){300}}
\put(300,300){\line(-6,-5){300}}
\end{Picture}
\hfill
\begin{Picture}[23](600,600)
\put(300,300){\vector(1,0){300}}
\put(300,300){\vector(-1,0){300}}
\put(300,300){\vector(0,1){300}}
\put(300,300){\vector(0,-1){300}}
\put(300,300){\vector(1,1){300}}
\put(300,300){\vector(1,2){150}}
\put(300,300){\vector(1,3){100}}
\put(300,300){\vector(1,4){75}}
\put(300,300){\vector(1,5){60}}
\put(300,300){\vector(1,6){50}}
\put(300,300){\vector(2,1){300}}
\put(300,300){\vector(2,3){200}}
\put(300,300){\vector(2,5){120}}
\put(300,300){\vector(3,1){300}}
\put(300,300){\vector(3,2){300}}
\put(300,300){\vector(3,4){225}}
\put(300,300){\vector(3,5){180}}
\put(300,300){\vector(4,1){300}}
\put(300,300){\vector(4,3){300}}
\put(300,300){\vector(4,5){240}}
\put(300,300){\vector(5,1){300}}
\put(300,300){\vector(5,2){300}}
\put(300,300){\vector(5,3){300}}
\put(300,300){\vector(5,4){300}}
\put(300,300){\vector(5,6){250}}
\put(300,300){\vector(6,1){300}}
\put(300,300){\vector(6,5){300}}
\put(300,300){\vector(1,-1){300}}
\put(300,300){\vector(1,-2){150}}
\put(300,300){\vector(1,-3){100}}
\put(300,300){\vector(1,-4){75}}
\put(300,300){\vector(1,-5){60}}
\put(300,300){\vector(1,-6){50}}
\put(300,300){\vector(2,-1){300}}
\put(300,300){\vector(2,-3){200}}
\put(300,300){\vector(2,-5){120}}
\put(300,300){\vector(3,-1){300}}
\put(300,300){\vector(3,-2){300}}
\put(300,300){\vector(3,-4){225}}
\put(300,300){\vector(3,-5){180}}
\put(300,300){\vector(4,-1){300}}
\put(300,300){\vector(4,-3){300}}
\put(300,300){\vector(4,-5){240}}
\put(300,300){\vector(5,-1){300}}
\put(300,300){\vector(5,-2){300}}
\put(300,300){\vector(5,-3){300}}
\put(300,300){\vector(5,-4){300}}
\put(300,300){\vector(5,-6){250}}
\put(300,300){\vector(6,-1){300}}
\put(300,300){\vector(6,-5){300}}
\put(300,300){\vector(-1,1){300}}
\put(300,300){\vector(-1,2){150}}
\put(300,300){\vector(-1,3){100}}
\put(300,300){\vector(-1,4){75}}
\put(300,300){\vector(-1,5){60}}
\put(300,300){\vector(-1,6){50}}
\put(300,300){\vector(-2,1){300}}
\put(300,300){\vector(-2,3){200}}
\put(300,300){\vector(-2,5){120}}
\put(300,300){\vector(-3,1){300}}
\put(300,300){\vector(-3,2){300}}
\put(300,300){\vector(-3,4){225}}
\put(300,300){\vector(-3,5){180}}
\put(300,300){\vector(-4,1){300}}
\put(300,300){\vector(-4,3){300}}
\put(300,300){\vector(-4,5){240}}
\put(300,300){\vector(-5,1){300}}
\put(300,300){\vector(-5,2){300}}
\put(300,300){\vector(-5,3){300}}
\put(300,300){\vector(-5,4){300}}
\put(300,300){\vector(-5,6){250}}
\put(300,300){\vector(-6,1){300}}
\put(300,300){\vector(-6,5){300}}
\put(300,300){\vector(-1,-1){300}}
\put(300,300){\vector(-1,-2){150}}
\put(300,300){\vector(-1,-3){100}}
\put(300,300){\vector(-1,-4){75}}
\put(300,300){\vector(-1,-5){60}}
\put(300,300){\vector(-1,-6){50}}
\put(300,300){\vector(-2,-1){300}}
\put(300,300){\vector(-2,-3){200}}
\put(300,300){\vector(-2,-5){120}}
\put(300,300){\vector(-3,-1){300}}
\put(300,300){\vector(-3,-2){300}}
\put(300,300){\vector(-3,-4){225}}
\put(300,300){\vector(-3,-5){180}}
\put(300,300){\vector(-4,-1){300}}
\put(300,300){\vector(-4,-3){300}}
\put(300,300){\vector(-4,-5){240}}
\put(300,300){\vector(-5,-1){300}}
\put(300,300){\vector(-5,-2){300}}
\put(300,300){\vector(-5,-3){300}}
\put(300,300){\vector(-5,-4){300}}
\put(300,300){\vector(-5,-6){250}}
\put(300,300){\vector(-6,-1){300}}
\put(300,300){\vector(-6,-5){300}}
\end{Picture}
\hfill
}
\caption{\LaTeX{} and \pmg{} vectors\label{FigA}}
\end{figure}

\begin{table}
\begin{center}
\begin{tabular}{||c|c||c|c||c|c||}
\hline
$(1,1)$ & $(1,1)$  &  $(4,1)$ & $(4,1)$  &  $(5,3)$ & $(3,2)$ \\
\hline
$(2,1)$ & $(2,1)$  &  $(4,3)$ & $(4,3)$  &  $(5,4)$ & $(4,3)$ \\
\hline
$(3,1)$ & $(3,1)$  &  $(5,1)$ & $(4,1)$  &  $(6,1)$ & $(4,1)$ \\
\hline
$(3,2)$ & $(3,2)$  &  $(5,2)$ & $(3,1)$  &  $(6,5)$ & $(4,3)$ \\
\hline
\end{tabular}
\end{center}
\caption{Relation between line slopes
and approximate vector slopes\label{Tab1}}
\end{table}

\LaTeX{} allows to put an arrow just at the end of the vector.
The command \verb?\Vector? enables to put
along the vector {\em arbitrary} arrows with different orientation
(see Fig.~\ref{TwoVec}). The predefined arrow styles
assign a letter to each position and orientation
of the arrow along the {\tt Vector}.

\begin{figure}
\centerline{\fbox{\begin{Picture}[50](300,40)
\put(20,5){\Vector[bme](1,0){100}}
\put(20,30){\Vector[BME](1,0){100}}
\put(170,5){\Vector[xZmM](1,0){100}}
\put(170,30){\Vector[XzmM](1,0){100}}
\end{Picture}}}
\caption{Multi-arrow vectors\label{TwoVec}}
\end{figure}

The arrows shown on Fig.~\ref{TwoVec} are drawn by the commands
\begin{quote}
\begin{verbatim}
\begin{picture}(300,40)
\put(20,5){\Vector[bme](1,0){100}}
\put(20,30){\Vector[BME](1,0){100}}
\put(170,5){\Vector[xmMZ](1,0){100}}
\put(170,30){\Vector[XmMz](1,0){100}}
. . . . . . . .
\end{verbatim}
\end{quote}

Letter {\tt e} corresponds to normally oriented arrow
at the end of vector, {\tt E} --- to reverse oriented arrow,
{\tt b} and {\tt B} --- to (normally and reverse oriented) arrows at the
beginning of the vector, {\tt m} and {\tt M} --- to the arrows
at the middle, etc.
The list of letters as the optional parameter produces
the set of arrows along the {\tt Vector}.
It is possible to create user-defined styles of arrows using the commands
\verb?\VectorStyle? and \verb?\VectorShiftStyle? (where the parameters
in square brackets are {\em obligatory}, not {\em optional}):
\begin{itemize}
\item[] {\tt\bs{}VectorStyle[{\em style-char}]\{{\em shift-char}\}\{{\em position}\}\{{\em orientation}\}}
\begin{itemize}
\item {\em style-char} is the character which is assigned to vector style;
\item {\em shift-char} is the character which defines the relative shift
      of the arrow with respect to {\em position} --- see command
      {\tt\bs{VectorShiftStyle}} below;
\item {\em position} is the real value which defines the relative position
      of the arrow along the vector (0.0 means starting point of the vector,
      1.0 means end point of the vector) which usually is in a range
      $0..1$ but can be greater 1 or less 0 as well;
\item {\em orientation} is the character which defines the orientation
      of the arrow with respect to the standard direction of the vecrtor:
      {\tt b} means {\em backward} direction, {\tt f} (or any other
      character) means forward direction.
\end{itemize}
\item[] {\tt\bs{}VectorShiftStyle[{\em style-char}]\{{\em shift}\}}
\begin{itemize}
\item {\em style-char} is the character which is assigned to vector-shift-style;
\item {\em shift} is the relative shift in {\tt pt} of the arrow along
      the arrow direction with respect to the positioning point
      (it is necessary to note that the length of the arrow body in \LaTeX{}
      is equal to {\tt 4pt}).
\end{itemize}
\end{itemize}
Examples:
\begin{itemize}
\item standard {\em vector-shift-styles}:
\begin{description}
\item[\quad{\tt\bs{}VectorShiftStyle[e]\{0pt\}}]
    --- style `{\tt e}' means that
    the end of the arrow is positioned strictly at the point,
    specified by the parameter {\em position};
\item[\quad{\tt\bs{}VectorShiftStyle[b]\{4pt\}}]
    --- style `{\tt b}' means that
    the backside of the arrow is positioned at the point,
    specified by the parameter {\em position};
\item[\quad{\tt\bs{}VectorShiftStyle[m]\{3pt\}}]
    --- style `{\tt m}' means that
    the middle of the arrow body is positioned at the point,
    specified by the parameter {\em position};
\item[\quad{\tt\bs{}VectorShiftStyle[E]\{-2pt\}}]
    --- style `{\tt E}' means that
    the end of the arrow is positioned a little bit before
    (i.e., by {\tt 2pt}) the point,
    specified by the parameter {\em position};
\item[\quad{\tt\bs{}VectorShiftStyle[B]\{6pt\}}]
    --- style `{\tt B}' means that
    the backside of the arrow is positioned a little bit after
    (i.e., by {\tt 2pt}) the point,
    specified by the parameter {\em position}.
\end{description}
\item standard {\em vector-styles}:
\begin{description}
\item[\quad{\tt\bs{}VectorStyle[e]\{e\}\{1.0\}\{f\}}]
    --- style `{\tt e}' means that
    the end of the arrow is positioned at the end of the vector,
    and its orientation is along the vector orientation;
\item[\quad{\tt\bs{}VectorStyle[E]\{b\}\{1.0\}\{b\}}]
    --- style `{\tt E}' means that
    the backside of the arrow is positioned at the end of the vector,
    and its orientation is rotated by $180^{\circ}$ with
    respect to the vector orientation;
\item[\quad{\tt\bs{}VectorStyle[b]\{b\}\{0.0\}\{f\}}]
    --- style `{\tt b}' means that
    the backside of the arrow is positioned at the beginning of the vector,
    and its orientation is along the vector orientation;
\item[\quad{\tt\bs{}VectorStyle[B]\{e\}\{0.0\}\{b\}}]
    --- style `{\tt B}' means that
    the end of the arrow is positioned at the beginning of the vector,
    and its orientation is rotated by $180^{\circ}$ with
    respect to the vector orientation;
\item[\quad{\tt\bs{}VectorStyle[m]\{m\}\{0.0\}\{f\}}]
    --- style `{\tt m}' means that
    the middle of the arrow body is positioned at the middle of the vector,
    and its orientation is along the vector orientation;
\item[\quad{\tt\bs{}VectorStyle[M]\{m\}\{0.0\}\{b\}}]
    --- style `{\tt M}' means that
    the middle of the arrow body is positioned at the middle of the vector,
    and its orientation is rotated by $180^{\circ}$ with
    respect to the vector orientation;
\item[\quad{\tt\bs{}VectorStyle[x]\{E\}\{1.0\}\{f\}}]
    --- style `{\tt x}' means that
    the end of the arrow is positioned a little bit before
    the end of the vector,
    and its orientation is along the vector orientation;
\item[\quad{\tt\bs{}VectorStyle[X]\{B\}\{1.0\}\{b\}}]
    --- style `{\tt X}' means that
    the backside of the arrow is positioned a little bit before
    the end of the vector,
    and its orientation is rotated by $180^{\circ}$ with
    respect to the vector orientation;
\item[\quad{\tt\bs{}VectorStyle[z]\{B\}\{0.0\}\{f\}}]
    --- style `{\tt z}' means that
    the backside of the arrow is positioned a little bit after
    the beginning of the vector,
    and its orientation is along the vector orientation;
\item[\quad{\tt\bs{}VectorStyle[Z]\{E\}\{0.0\}\{b\}}]
    --- style `{\tt Z}' means that
    the end of the arrow body is positioned a little bit after
    the beginning of the vector,
    and its orientation is rotated by $180^{\circ}$ with
    respect to the vector orientation.
\end{description}
\end{itemize}

\section*{Circles}

The range of the diameters for circles and disks
(black circular blobs) available in \LaTeX{} is very restricted.
It can be enlarged by using the magnified pseudo-graphical \LaTeX{} fonts
if the User does not have something better at his/her disposal
like {\tt curves.sty}, \PiC\TeX{} or MF\PiC.
The disadvantage of this method is that the width
of the lines is magnified too which is inconsistent
with the rigorous \TeX{} accuracy requirements,
but for {\em poor man graphics} these circles
can be satisfactory.

The scaling of circular fonts is performed by the commands
\begin{quote}
{\tt\bs{}scaledcircle\lb{\em factor}\rb}
\\
{\tt\bs{}magcircle\lb{\em magstep}\rb}
\end{quote}
which are indentical to \TeX{} commands
\begin{quote}
{\tt\bs{}font ... scaled {\em factor}}
\\
{\tt\bs{}font ... scaled \bs{}magstep {\em magstep}}
\end{quote}
The valid {\em magstep} values are {\tt 0}, {\tt h},
{\tt 1}, {\tt 2}, {\tt 3}, {\tt 4}, {\tt 5}.
The values {\em factor}=1000 and {\em magstep}=0
correspond to {\em one-to-one} magnification.
The circle magnification
like other \TeX{} commands returns to its
previous value outside the group inside which it was changed.

\begin{figure}
\def\myframe#1{\begin{picture}(0,0)
    \put(0,#1){\line(1,0){#1}}
    \put(0,#1){\line(-1,0){#1}}
    \put(0,-#1){\line(1,0){#1}}
    \put(0,-#1){\line(-1,0){#1}}%
    \put(#1,0){\line(0,1){#1}}%
    \put(#1,0){\line(0,-1){#1}}%
    \put(-#1,0){\line(0,1){#1}}%
    \put(-#1,0){\line(0,-1){#1}}%
    \end{picture}}
\begin{center}
\begin{Picture}[50](200,100)(-100,-50)
\unitlength=1pt
\put(-50,0){\thicklines\circle{80}}
\put(-50,0){\myframe{40}}
\put(50,0){\scaledcircle{2000}\circle{80}}
\put(50,0){\myframe{40}}
\end{Picture}
\end{center}
\caption{Magnified circles\label{Fig1}}
\end{figure}

To calculate properly the circle character code
after the magnification it was necessary to redefine
some internal \LaTeX{} commands like
{\tt\bs{}@getcirc} and {\tt\bs{}@circ}. To reflect
in magnified fonts the changes of the line thickness,
the commands {\tt\bs{}thinlines} and {\tt\bs{}thicklines}
are corrected also.

The example on Fig.~\ref{Fig1} is produced by
\begin{quote}
\begin{verbatim}
\setlength{\unitlength}{1pt}
\begin{picture}(200,100)(-100,-50)
\put(-50,0){\thicklines\circle{80}}
\put(-50,0){\squareframe{40}}
\magcircle{4}
\put(50,0){\thinlines\circle{80}}
\put(50,0){\squareframe{40}}
\end{picture}
\end{verbatim}
\end{quote}
where {\tt\bs{}squareframe} is the user-defined command which draws
the square with the specified side and the centrum at (0,0).
It shows how the usage of the magnified circles enables to overcome
the upper limit 40pt of the diameter of the \LaTeX{} cirles.
It is necessary to note that
the thickness of the {\tt\bs{}thinline} circles
after magnification with
{\tt\bs{}magcircle\lb{}4\rb}
corresponds approximately to the thickness
of the ordinary {\tt\bs{}thickline} circles
($\hbox{\tt\bs{}magstep4}\approx2000$).

\bigskip

\begin{figure}
\begin{center}
\begin{Picture}[50](200,60)(-100,-30)
\put(-60,10){\thicklines\tlcircle{50}}
\put(-60,10){\circle*{1}}
\put(-60,10){\line(-1,0){25}}
\put(-60,10){\line(0,1){25}}
\put(-60,-10){\thicklines\blcircle{50}}
\put(-60,-10){\circle*{1}}
\put(-60,-10){\line(-1,0){25}}
\put(-60,-10){\line(0,-1){25}}
\put(-40,10){\thicklines\trcircle{50}}
\put(-40,10){\circle*{1}}
\put(-40,10){\line(1,0){25}}
\put(-40,10){\line(0,1){25}}
\put(-40,-10){\thicklines\brcircle{50}}
\put(-40,-10){\circle*{1}}
\put(-40,-10){\line(1,0){25}}
\put(-40,-10){\line(0,-1){25}}
\put(40,10){\thicklines\BRcircle{50}}
\put(40,10){\circle*{1}}
\put(40,10){\line(-1,0){25}}
\put(40,10){\line(0,1){25}}
\put(40,-10){\thicklines\TRcircle{50}}
\put(40,-10){\circle*{1}}
\put(40,-10){\line(-1,0){25}}
\put(40,-10){\line(0,-1){25}}
\put(60,10){\thicklines\BLcircle{50}}
\put(60,10){\circle*{1}}
\put(60,10){\line(1,0){25}}
\put(60,10){\line(0,1){25}}
\put(60,-10){\thicklines\TLcircle{50}}
\put(60,-10){\circle*{1}}
\put(60,-10){\line(1,0){25}}
\put(60,-10){\line(0,-1){25}}
\end{Picture}
\end{center}
\caption{$90^{\circ}$ circular segments\label{Fig2}}
\end{figure}

Additional macro enable to
draw $90^{\circ}$ qu\-a\-ters of the circles explicitly without
tricky refinement of the parameters of the command {\tt\bs{}oval}:
\begin{quote}
{\tt\bs{}trcircle\lb{\em diam}\rb} $\longrightarrow$ {\tt\bs{}oval[tr]...}
\\
{\tt\bs{}brcircle\lb{\em diam}\rb} $\longrightarrow$ {\tt\bs{}oval[br]...}
\\
{\tt\bs{}tlcircle\lb{\em diam}\rb} $\longrightarrow$ {\tt\bs{}oval[tl]...}
\\
{\tt\bs{}blcircle\lb{\em diam}\rb} $\longrightarrow$ {\tt\bs{}oval[bl]...}
\end{quote}
The centrum of the circular arc is positioned strictly at the
point which is the argument of the corresponding {\tt\bs{}put}.
The commands {\tt\bs{}TRcircle}, {\tt\bs{}BRcircle}, {\tt\bs{}TLcircle},
{\tt\bs{}BLcircle} draw the $90^{\circ}$ circular quaters
with the reference point positioned at the corner
instead of the centrum.
Similarly, the commands
\begin{itemize}
\item[] {\tt\bs{}tlsector}, {\tt\bs{}TLsector},
{\tt\bs{}blsector}, {\tt\bs{}BLsector}, \dots
\end{itemize}
draw circular segments together with horizontal
and vertical radii. The proper positioning of the
circular segments requires special precausions
since it is necessary to take into account the
line thickness and the specific alignment of the
circular elements inside the character boxes.

The example on Fig~\ref{Fig2}
shows the usage of these commands:
\begin{quote}
\begin{verbatim}
\begin{picture}(200,60)(-100,-30)
\put(-60,10){\thicklines\tlcircle{50}}
\put(-60,10){\circle*{1}}
\put(-60,10){\line(-1,0){25}}
\put(-60,10){\line(0,1){25}}
\put(40,10){\thicklines\BRcircle{50}}
\put(40,10){\circle*{1}}
\put(40,10){\line(-1,0){25}}
\put(40,10){\line(0,1){25}}
... ... ...
\end{verbatim}
\end{quote}
The actual diameter of the circular segment
is adjusted like it is done with the circles.
The commands {\tt\bs{}scaledcircle} and {\tt\bs{}magcircle}
affect the thickness and the diameter of these circular segments also.


\section*{Frames}

\def\DiskCorner{8pt}
\def\RoundCorner{6pt}
\def\LineCorner{10pt}
\def\RectCorner{3pt}

\framesep{-2pt}
\shadowsep{1pt}
\shadowsize{8pt}
\shadowshrink{1}

The set of frames which are available in \LaTeX{} is
enhanced in \pmg{} --- except solid and dashed rectangular frames
it is possible to draw double and tripple frames in a variety
of styles (Fig.~\ref{ThrFr}). The commands
\verb?\frameBox?, \verb?\ovalBox?, \verb?\octalBox?,
\verb?\astroBox?, \verb?\parquetBox? have the same structure
as the command \verb?\framebox?, but they draw the
corresponding fancy frames:
\begin{quote}
\begin{verbatim}
\put(0,0){\ovalBox(100,50){oval}}
\put(70,0){\astroBox(100,50){astro}}
. . . . . . . . . . . . .
\end{verbatim}
\end{quote}
The ordinary solid frame is drawn by \verb?\frameBox?,
the double and triple frames are drawn by \verb?\frameBoX?
and \verb?\frameBOX?, respectively. Similar commands exist for
double and triple fancy frames.
The User can prepare the personal macro commands to draw frame corners
and extend the variety of fancy frames up to the limit of his/her fantasy.

\begin{figure}
\centerline{\begin{Picture}[50](2000,800)
\put(100,0){\parquetBox(500,300){parquet}}
\put(100,500){\octalBox(500,300){octal}}
\put(700,0){\ovalBoX(500,300){oval}}
\put(700,500){\astroBoX(500,300){astro}}
\put(1300,0){\dashBOX{10}(500,300){dash}}
\put(1300,500){\frameBOX(500,300){frame}}
\end{Picture}}
\caption{Examples of frame styles\label{ThrFr}}
\end{figure}

\begin{figure}
\centerline{\begin{Picture}[50](600,100)(-30,0)
\thicklines
\rombboxstyle(2,1,1pt)
\put(20,20){\rombBox[z](50,50){Box}}
\put(220,20){\rombBoX[z](50,50){BoX}}
\put(440,20){\rombBOX[z](50,50){BOX}}
\end{Picture}}
\caption{Romb-style frames\label{RombFram}}
\end{figure}

\begin{figure}
\centerline{\begin{Picture}[50](800,200)(-130,0)
\put(-100,20){\frameBox(100,100){}}
\put(220,20){\frameBox(100,100){}}
\put(540,20){\frameBox(100,100){}}
\thicklines
\rombboxstyle(2,1,1pt)
\put(-100,20){\rombBox[x](100,100){\tt x}}
\put(220,20){\rombBox[y](100,100){\tt y}}
\put(540,20){\rombBox[z](100,100){\tt z}}
\end{Picture}}
\caption{Alignment of romb boxes\label{FigRR}}
\end{figure}

More exotic variant of a frame can be created using
the commands {\tt\bs{}rombBox}, {\tt\bs{}rombBoX}
or {\tt\bs{}rombBOX} as it is shown on Fig.~\ref{RombFram}.
The style (i.e., inclination of the romb sides)
and the distance between multiple rombs
are set by the command {\tt\bs{}rombboxstyle}
\begin{description}
\item[\quad{\tt\bs{}rombboxstyle($\Delta x$,$\Delta y$,{\em len})}]
   --- defines the inclination for the romb boxes and for the
       corners of the {tt octal} frames and shadows.
       Parameters $\Delta x$, $\Delta y$ specifies the inclination,
       and the parameter {\em len} --- the length of the inclined
       corners (for {\tt octal} frames and shadows only) in a style
       similar to the command
       {\tt\bs{}line($\Delta x$,$\Delta y$)\{{\em len}\}}.
\end{description}
with the default settings as
\begin{center}
{\tt\bs{}rombboxstyle(2,1,2pt)}
\end{center}
The alignment of the romb around the box specified
for these commands can be varied using
additional optional parameter(see Fig.~\ref{FigRR}. The full format of the
{\tt rombbox} commands is:
\begin{itemize}
\item[]
    {\tt\bs{}rombBox[{\em char}]($\Delta X$,$\Delta Y$)\{{\em text}\}}
\end{itemize}
where
        {\em char} -is one-character parameter which
        defines the alignment of the romb frame with respect to
        rectangle $(\Delta X,\Delta Y)$:
        {\tt x} (default value) means that the $x$-axis coinsides with the
        $x$-axis of the rectangle,
        {\tt y} means that the $y$-axis coinsides with the
        $y$-axis of the rectangle,
        {\tt z} means that the corners of the rectangle are at the
        sides of the romb frame.

\begin{figure}
\begin{center}
\begin{Picture}[50](2000,1100)(0,-500)
\put(0,50){\frameBox[r](500,200){r}}
\put(0,400){\frameBox[R](500,200){R}}
\put(700,50){\frameBox[p](500,200){p}}
\put(700,400){\frameBox[P](500,200){P}}
\put(1400,50){\frameBox[o](500,200){o}}
\put(1400,400){\frameBox[O](500,200){O}}
\shadowsize{12pt}
\put(100,-400){\frameBox[A](800,300){A}}
\put(1100,-400){\frameBox[L](800,300){L}}
\end{Picture}
\end{center}
\caption{Examples of shadows\label{TypShad}}
\end{figure}

\begin{figure}
\begin{center}
\begin{Picture}[35](2000,1500)
\shadowcorner{B}
\put(0,0){\frameBoX[oPRpAORr](1000,500){Shadows}}
\end{Picture}
\end{center}
\caption{Multiple shadows\label{TypShad2}}
\end{figure}

Each rectangular box has the optional parameter which enable to specify
the ``shadows'' around this box. Each shadow style has a special letter,
and the list of letters as the optional parameter draws a list of shadows.
The standard shodow types are shown on Fig.~\ref{TypShad}.
It is possible to draw several shadows of different types
and around arbitrary corner of the frame as it is shown
on Fig.~\ref{TypShad2}:
\begin{quote}
\begin{verbatim}
\unitlength=10pt
\begin{picture}(20,15)
\shadowcorner{B}
\put(0,0){\frameBoX[oPR...](10,5){...}}
\end{picture}
\end{verbatim}
\end{quote}
The parameter of the shadows --- thickness, corner size,
additional shift, etc., --- can be varied
by the following User commands:
\begin{description}
\item[\quad{\tt\bs{}framesep\{{\em dist}\}}]
    --- set the distance between double and triple
    frames. It can be negative as well as positive.
    Default value: {\tt\framesep\{2pt\}}.
\item[\quad{\tt\bs{}shadowsep\{{\em dist}\}}]
    --- set the gap distance between the frame and the shadow
    or between multiple shadows.
    Default value: {\tt\shadowsep\{1pt\}}.
\item[\quad{\tt\bs{}shadowsize\{{\em dist}\}}]
    --- set the depth of the shadow.
    Default value: {\tt\shadowsize\{5pt\}}.
\item[\quad{\tt\bs{}shadowshrink\{{\em factor}\}}]
    --- set the contraction factor for the subsequent shadows.
    Default value: {\tt\shadowshrink\{1\}}.
\item[\quad{\tt\bs{}shadowcorner\{{\em char}\}}]
    --- set the corner for the shadows.
    Valid values: {\tt A}, {\tt B}, {\tt C}, {\tt D}.
    Default value: {\tt\bs{}shadowcorner\{A\}}.
\item[\quad{\tt\bs{}RoundCorner\{{\em radius}\}}]
    --- set the {\em radius} for the circular arcs
    at the corners of oval frames and shadows with rounded corners.
    Default value: {\tt\RoundCorner\{5pt\}}.
\item[\quad{\tt\bs{}DiskCorner\{{\em diam}\}}]
    --- set the {\em diameter} for the bulbs
    at the corners of black shadows with rounded corners.
    Default value: {\tt\DiskCorner\{5pt\}}.
\item[\quad{\tt\bs{}LineCorner\{{\em len}\}}]
    --- set the {\em length} for the inclined corners
    of octal frames and shadows.
    Default value: {\tt\LineCorner\{10pt\}}.
\item[\quad{\tt\bs{}RectCorner\{{\em size}\}}]
    --- set the {\em size} for the parquette corners
    of octal frames and shadows.
    Default value: {\tt\RectCorner\{5pt\}}.
\end{description}


\section*{Rombs}

Special command enable to draw rombs (see Fig.~\ref{FigRomb}):
\begin{itemize}
\item[] {\tt \bs{}put({\em x})({\em y})
         \{\bs{}romb[{\em pos}]($\Delta x$,$\Delta y$)\{{\em len}\}\}}
\end{itemize}
where:
\begin{itemize}
\item[] $(x,y)$ --- position of the romb inside {\tt picture};\\
        {\em pos} --- one-character option which shows the alignment of romb
        with respect to $(x,y)$: {\tt r} means right corner,
        {\tt l} means left corner; {\tt c} means center (default);\\
        $(\Delta x,\Delta y)$ and {\em len} are the parameters which
        define the inclination and the length of the romb side
        (similarly to {\tt\bs{}line}).
\end{itemize}

\begin{figure}
\centerline{\begin{Picture}[75](800,200)(-30,-100)
\thicklines
\put(20,20){\romb[c](2,1){90}}
\put(20,20){\circle*{10}}
\put(20,-60){\makebox(0,0){\tt c}}
\put(220,20){\romb[l](2,1){90}}
\put(220,20){\circle*{10}}
\put(220,-60){\makebox(0,0){\tt l}}
\put(640,20){\romb[r](2,1){90}}
\put(640,20){\circle*{10}}
\put(640,-60){\makebox(0,0){\tt r}}
\end{Picture}}
\caption{Alignment of rombes\label{FigRomb}}
\end{figure}

\section*{Automatically scaled pictures}

The idea of the macros which are responsible for these functions
is to calculate the {\tt \bs{}unitlength} va\-lue in terms of the
{\em relative fraction} of the page width instead of explicit
specifying its value in points, centimeters, inches, etc.

The command {\tt\bs{}pictureunit[{\em percent}]\lb{\em x-size}\rb}
selects the value of the variable {\tt\bs{}unitlength} so that the picture
which is {\em x-size} units in width occupies {\em percent}
width of the paper.
The environment {\tt Picture} combines the automatic calculation of
the {\tt\bs{}unitlength} with the {\tt\bs{}begin\lb{}picture\rb} --
{\tt\bs{}end\lb{}picture\rb}.
By default {\em percent}=100 is used which corresponds to 90\%
of the paper width. The default {\em percent} value can be redefined
by the command
\begin{center}
   {\tt\bs{}def\bs{}defaultpercent\lb{\em percent}\rb}.
\end{center}

Examples:
\begin{center}
\begin{tabular}{l}
   {\tt\bs{}pictureunit[75]\lb{}120\rb}\\
   {\tt\bs{}begin\lb{}picture\rb(120,80)}\\
   \dots\\
   {\tt\bs{}end\lb{}picture\rb}\\
   \phantom{.}\\
   {\tt\bs{}begin\lb{}Picture\rb[75](120,80)}\\
   \dots\\
   {\tt\bs{}end\lb{}Picture\rb}
\end{tabular}
\end{center}

These macros are inspired by {\tt fullpict.sty} by Bruce Shawyer.
Carefull examination of the file {\tt fullpict.sty}
shows some bugs/warnings which require correction:
\begin{itemize}
\item
each automatic scaling of {\tt \bs{}unitlength}
allocates a new counter;
\item
automatic scaling uses {\tt\bs{}textwidth}
as the reference width which results to improper functioning
inside list and {\tt minipage} environments;
\item
the environments {\tt fullpicture}, {\tt halfpicture}
and {\tt scalepicture} are centered internally
with {\tt\bs{}begin\lb{}center\rb} --- {\tt\bs{}end\lb{}center\rb}
which prevents the proper positioning of the picture in most cases.
\end{itemize}
The \pmgs{} macros calculates the dimension
{\tt\bs{}unitlength}
using the value {\tt\bs{}hsize}, and as a result
it works corectly also for {\tt twocolumn} mode,
inside the {\em list} environments
{\tt itemize}, {\tt enumerate}, etc.
(for example, all the figures in this paper
are drawn using the environment {\tt Picture}).
The automatic centering and repeatedly allocation
of the registers are corrected as well.

\section*{Acknowledgements}

The authors are grateful to Dr.\ Kees van der Laan
for the possibility to present the results of our research
at the EURO\TeX'95 (Aarnhem, Netherland).

One of the authors (A.S.Berdnikov) would like to express his warmest
thanks to Dr.\ A.Compagner from the Delft University of Technology
who spent a lot of his time and efforts trying to transform two naive
students from Russia (namely, him and his co-worker Sergey Turtia)
into serious scientists.

This research was partially supported by a grant
from the Dutch Organization for Scientific Research
(NWO grant No 07--30--007).

\end{document}