Debian Codegraph @

texmf-dist/tex/generic/pstricks/pst-code-put.tex

raw
1 %
2 % see pstricks.tex for license and copyright
3 %
4 %% The \??put macros -----------
5 %
6 % \setbox#2=\hbox{\pst@Verb{% check for empty #1
7 % (#1) /strAngle ED strAngle length 0 eq { 0 }{ #1 } ifelse
8 % %\ifPSTlualatex neg \fi
9 % \tx@RotBegin}\box#2\pst@Verb{\tx@RotEnd}}%
10
11 \def\psput@cartesian#1{%
12 \hbox to \z@{\kern\pst@dimg{\vbox to \z@{\vss\box#1\vskip\pst@dimh}\hss}}%
13 }
14 \def\psput@special#1{%
15 \hbox{%
16 \pst@Verb{{ \pst@coor \pstnodescale } \tx@PutCoor \tx@PutBegin }% 20150911 hv
17 \box#1%
18 \pst@Verb{ \tx@PutEnd }%
19 }%
20 }
21 \def\tx@PutCoor{PutCoor }
22 \def\tx@PutBegin{PutBegin }
23 \def\tx@PutEnd{PutEnd }
24 \def\rput{\def\pst@par{}\pst@ifstar{\@ifnextchar[{\rput@i}{\rput@ii}}}
25 \def\rput@i[#1]{%
26 \test@for@options#1=\@nil
27 \ifnum\the\pst@cntm=\z@
28 \addto@par{ref={#1}}%
29 \else
30 \expandafter\addto@par\expandafter{#1}%
31 \fi
32 \rput@ii
33 }
34 \def\test@for@options#1=#2\@nil{%
35 \if$#2$% #2 is empty -> old syntax
36 \pst@cntm=\z@
37 \else % something like foo=bar
38 \pst@cntm=\@ne
39 \fi
40 }
41
42 \def\rput@ii{\@ifnextchar({\rput@iv}{\rput@iii}}
43 \def\rput@iii#1{\addto@par{rot={#1}}\@ifnextchar({\rput@iv}{\rput@iv(\z@,\z@)}}
44 \def\rput@iv(#1){\pst@killglue\pst@makebox{\rput@v{#1}}}
45 \def\rput@v#1{%
46 \begingroup
47 \use@par
48 \if@star\pst@starbox\fi
49 \pst@makesmall\pst@hbox
50 \ifx\psk@rot\@empty\else\pst@rotate{ ps@rot \ifPSTlualatex neg \fi }\pst@hbox\fi% (MJS)
51 % \pst@rotate\psk@rot\pst@hbox%
52 \psput@{#1}\pst@hbox%
53 \endgroup
54 \ignorespaces}
55 %
56 \def\multirput{%
57 \def\pst@par{}%
58 \pst@ifstar{\@ifnextchar[{\multirput@i}{\multirput@ii}}}
59 \def\multirput@i[#1]{\addto@par{ref={#1}}\multirput@ii}
60 \def\multirput@ii{\@ifnextchar({\multirput@iv}{\multirput@iii}}
61 \def\multirput@iii#1{\addto@par{rot={#1}}\multirput@iv}
62 \def\multirput@iv(#1){%
63 \@ifnextchar({\multirput@v(#1)}{\multirput@v(\z@,\z@)(#1)}}
64 \def\multirput@v(#1,#2)(#3,#4)#5{%
65 \pst@makebox{\multirput@vi(#1,#2)(#3,#4){#5}}}
66 \def\multirput@vi(#1,#2)(#3,#4)#5{%
67 \pst@killglue%
68 \global\psLoopIndex=\@ne\relax
69 \begingroup
70 \use@par
71 \if@star\pst@starbox\fi
72 \pst@makesmall\pst@hbox
73 \ifx\psk@rot\@empty\else\pst@rotate{ps@rot }\pst@hbox\fi% (MJS)
74 % \pst@rotate\psk@rot\pst@hbox
75 \pssetxlength\pst@dima{#1}%
76 \pssetylength\pst@dimb{#2}%
77 \pssetxlength\pst@dimc{#3}%
78 \pssetylength\pst@dimd{#4}%
79 \pst@cntg=#5\relax
80 \leavevmode
81 \loop
82 \vbox to \z@{%
83 \vss
84 \hbox to \z@{\kern\pst@dima\copy\pst@hbox\hss}%
85 \vskip\pst@dimb%
86 }%
87 \ifnum\pst@cntg>\psLoopIndex
88 \advance\pst@dima\pst@dimc
89 \advance\pst@dimb\pst@dimd
90 \global\advance\psLoopIndex by \@ne
91 \repeat
92 \endgroup
93 \ignorespaces%
94 }
95 %
96 \newif\if@fixedradius
97 \def\cput{\def\pst@par{}\pst@object{cput}}
98 \def\cput@i{\@fixedradiusfalse\cput@ii}
99 \def\cput@ii{\pst@killglue\@ifnextchar({\cput@iv}{\cput@iii}}
100 \def\cput@iii#1{%
101 \addto@par{rot={#1}}%
102 \@ifnextchar({\cput@iv}{\cput@iv(\z@,\z@)}%
103 }
104 \def\cput@iv(#1){\pst@makebox{\cput@v{#1}}}
105 \def\cput@v#1{%
106 \begingroup
107 \use@par
108 \setbox\pst@hbox=\hbox{%
109 \psboxsepfalse
110 \if@fixedradius\psCirclebox@ii\else\pscirclebox@ii\fi%
111 }%
112 \pst@@makesmall\pst@hbox
113 \ifx\psk@rot\@empty\else\pst@rotate{ps@rot }\pst@hbox\fi% (MJS)
114 % \pst@rotate\psk@rot\pst@hbox
115 \psput@{#1}\pst@hbox
116 \endgroup
117 \ignorespaces%
118 }
119 %
120 \def\Cput{\def\pst@par{}\pst@object{Cput}}
121 \def\Cput@i{\@fixedradiustrue\cput@ii}
122 \newdimen\pslabelsep
123 \define@key[psset]{pstricks}{labelsep}[5pt]{%
124 \pssetlength\pslabelsep{#1}%
125 \ifx\PSTplotLoaded\endinput% Set labels for pst-plot, if laoded
126 \let\psxlabelsep\pslabelsep%
127 \let\psylabelsep\pslabelsep%
128 \fi}
129 \psset[pstricks]{labelsep=5pt}
130 %
131 \define@key[psset]{pstricks}{refangle}[0]{\pst@expandafter\psset@@refangle{#1}\@nil}
132 \def\psset@@refangle#1\@nil{%
133 \def\next##1@#1=##2"##3@##4\@nil{%
134 \ifx\relax##2%
135 \pst@getangle{#1}\psk@refangle
136 \def\psk@uputref{}%
137 \else
138 \def\psk@refangle{##2 }%
139 \def\psk@uputref{##3}%
140 \fi}%
141 \expandafter\next\pst@refangletable @#1=\relax"@\@nil%
142 \pst@Verb{ gsave STV CP T /ps@refangle \psk@refangle\space def grestore }%ADDED (MJS)
143 }
144 %
145 \def\pst@refangletable{%
146 @r=0"20%
147 @u=90"02%
148 @l=180"10%
149 @d=-90"01%
150 @ur=45"22%
151 @ul=135"12%
152 @dr=-135"21%
153 @dl=-45"11}
154 \psset[pstricks]{refangle=0}
155
156 % DG/SR modification begin - Mar. 24, 1999 - Patch 10
157 %\def\uput{\def\pst@par{}\@ifnextchar[{\uput@ii}{\uput@i}}
158 \def\uput{\def\pst@par{}\pst@ifstar{\@ifnextchar[{\uput@ii}{\uput@i}}}
159 % DG/SR modification end
160 \def\uput@i#1{\addto@par{labelsep=#1}\uput@ii}
161 %
162 \def\uput@ii[#1]{%
163 \addto@par{refangle={#1}}%
164 \@ifnextchar({\uput@iv}{\uput@iii}}
165 %
166 \def\uput@iii#1{%
167 \addto@par{rot={#1}}%
168 \@ifnextchar({\uput@iv}{\uput@iv(\z@,\z@)}}
169 %
170 \def\uput@iv(#1){\pst@killglue\pst@makebox{\uput@v{#1}}}
171 %
172 \def\uput@v#1{%
173 \begingroup
174 \use@par
175 \if@star\pst@starbox\fi
176 \pstCheckCoorType{#1}% needed for \uput@vii
177 \uput@vi
178 \psput@{#1}\pst@hbox
179 \endgroup
180 \ignorespaces}
181 %
182 \def\uput@vi{%
183 \ifx\psk@uputref\@empty\uput@vii\tx@UUput{}%
184 \else
185 \ifx\psk@rot\@empty\expandafter\uput@viii\psk@uputref
186 \else\uput@vii\tx@UUput{}\fi
187 \fi}
188 %
189 \def\uput@vii#1#2{%
190 \edef\pst@coor{%
191 \ifPst@SpecialLength\pst@SpecialLength\else\pst@number\pslabelsep\fi
192 % \pst@number\pslabelsep % \ifdim\pslabelsep<\z@ neg \fi
193 #2%
194 \pst@number{\wd\pst@hbox}%
195 \pst@number{\ht\pst@hbox}%
196 \pst@number{\dp\pst@hbox}%
197 \ifnum\pst@C@@rType=7
198 ps@refangle % CHANGED (MJS) FROM \psk@refangle\space
199 \ifx\psk@rot\@empty\else ps@rot\space sub \fi
200 \else
201 \psk@refangle\space
202 \ifx\psk@rot\@empty\else \psk@rot\space sub \fi
203 \fi
204 \tx@Uput #1}%
205 %\show\pst@coor
206 \setbox\pst@hbox=\hbox to\z@{\hss\vbox to\z@{\vss\box\pst@hbox\vss}\hss}%
207 \setbox\pst@hbox=\psput@special\pst@hbox
208 \ifPSTlualatex
209 \ifnum\pst@C@@rType=7
210 \ifx\psk@rot\@empty\else\pst@rotate{ps@rot neg}\pst@hbox\fi% CHANGED FROM \psk@rot (MJS)
211 \else
212 \ifx\psk@rot\@empty\else\pst@rotate{\psk@rot\space neg}\pst@hbox\fi%
213 \fi
214 \else
215 \ifnum\pst@C@@rType=7
216 \ifx\psk@rot\@empty\else\pst@rotate{ps@rot }\pst@hbox\fi% CHANGED FROM \psk@rot (MJS)
217 \else
218 \ifx\psk@rot\@empty\else\pst@rotate{\psk@rot}\pst@hbox\fi%
219 \fi
220 \fi
221 }
222 %
223 %
224 \def\uput@viii#1#2{%
225 \ifnum#1>\z@\relax\ifnum#2>\z@\relax\pslabelsep=.707\pslabelsep\fi\fi
226 \setbox\pst@hbox=\vbox to\z@{%
227 \ifnum#2=1\relax\vskip\pslabelsep\else\vss\fi
228 \hbox to\z@{%
229 \ifnum#1=2\relax\hskip\pslabelsep \else\hss\fi
230 \box\pst@hbox%
231 \ifnum#1=1\relax\hskip\pslabelsep\else\hss\fi}%
232 \ifnum#2=2\relax\vskip\pslabelsep\else\vss\fi}}
233 %
234 \def\tx@Uput{Uput }
235 \def\tx@UUput{UUput }
236 %
237 \def\Rput{\def\pst@par{}\pst@ifstar{\@ifnextchar[{\Rput@ii}{\Rput@i}}}
238 \def\Rput@i#1{\addto@par{labelsep=#1}\Rput@ii}
239 \def\Rput@ii[#1]{\addto@par{ref={#1}}\@ifnextchar({\Rput@iv}{\Rput@iii}}
240 \def\Rput@iii#1{\addto@par{rot={#1}}\@ifnextchar({\Rput@iv}{\Rput@iv(\z@,\z@)}}
241 \def\Rput@iv(#1){\pst@killglue\pst@makebox{\Rput@v{#1}}}
242 \def\Rput@v#1{%
243 \begingroup
244 \use@par
245 \if@star\pst@starbox\fi
246 \Rput@vi
247 \pst@makesmall\pst@hbox
248 \ifx\psk@rot\@empty\else\pst@rotate{ps@rot }\pst@hbox\fi% (MJS)
249 % \pst@rotate\psk@rot\pst@hbox
250 \psput@{#1}\pst@hbox
251 \endgroup
252 \ignorespaces}
253 %
254 \def\Rput@vi{%
255 \pst@dimg=\dp\pst@hbox
256 \advance\pst@dimg\pslabelsep
257 \dp\pst@hbox=\pst@dimg
258 \pst@dimg=\ht\pst@hbox
259 \advance\pst@dimg\pslabelsep
260 \ht\pst@hbox=\pst@dimg
261 \setbox\pst@hbox\hbox{\kern\pslabelsep\box\pst@hbox\kern\pslabelsep}}%
262 %
263 \def\oldpsput{\def\pst@par{}\pst@ifstar{\@ifnextchar[{\oldpsput@i}{\oldpsput@ii}}}
264 \def\oldpsput@i[#1]{\addto@par{ref={#1}}\oldpsput@ii}
265 \def\oldpsput@ii{\@ifnextchar<{\oldpsput@iii}{\oldpsput@iv}}
266 \def\oldpsput@iii<#1>{\rput@iii{#1}}
267 \def\OldPsput{\let\psput\oldpsput}
268 \def\NewPsput{\let\psput\rput}
269 %