~ubuntu-branches/debian/wheezy/texlive-extra/wheezy

« back to all changes in this revision

Viewing changes to texmf-dist/tex/latex/geomsty/geompsfi.sty

  • Committer: Bazaar Package Importer
  • Author(s): Norbert Preining
  • Date: 2009-01-15 09:56:54 UTC
  • mfrom: (1.3.1 upstream) (11.1.1 sid)
  • Revision ID: james.westby@ubuntu.com-20090115095654-71ev5rcx4pi5loe1
Tags: 2007.dfsg.15-1
upgrade bibleref to version from upstream which changes the license
to LPPL (Closes: #511843) RC->medium

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
% $Header: /usr/home/levy/texts/geomsty/RCS/geompsfi.sty,v 1.18 95/12/06 13:40:51 levy Exp $
2
 
 
3
 
% This is geompsfig.sty, based on psfig.tex by Trevor Darrell (as
4
 
% modified by Stefan Bechtoslheim).
5
 
%
6
 
% It works with Latex and plain TeX (normally under the name geompsfi.tex).
7
 
% Thanks to Ket Richter for working out the changes for Plain tex.
8
 
 
9
 
% Copyright 1991, 1992, 1993 Silvio Levy
10
 
 
11
 
% This file is part of the Geom Latex style files.  It is distributed in
12
 
% the hope that it will be useful, but WITHOUT ANY WARRANTY.  The author
13
 
% makes no representation as to its suitability for any purpose.
14
 
 
15
 
% Permission is granted for use and non-profit distribution of this 
16
 
% file provided that this notice is clearly maintained. The right to
17
 
% distribute this file for profit or as part of any commercial
18
 
% product is specifically reserved for the author.  If you make
19
 
% changes to this file you cannot distribute it under the same name,
20
 
% but you can distribute it under a different name provided it is not
21
 
% for profit of as part of a commercial product, and provided that the
22
 
% copyright line above and this notice are clearly maintained.
23
 
 
24
 
% This version assumes that dimensions read from a PostScript file or
25
 
% from a .lab file are in bp (big points).  Dimensions found in the
26
 
% source TeX file (as in \psfig{...,height=2in}) are true dimensions
27
 
% (that is, are not scaled pt -> bp).  This is all as it should be.
28
 
 
29
 
\edef\atcatcode{\the\catcode`\@}
30
 
\catcode`@=11 
31
 
 
32
 
\newif\ifoldlabels \oldlabelsfalse
33
 
\expandafter\ifx\csname @ifundefined\endcsname\relax 
34
 
\long\def\@ifundefined#1#2#3{\expandafter\ifx\csname
35
 
  #1\endcsname\relax#2\else#3\fi}
36
 
\def\@iden#1{#1}
37
 
%\newdimen\@tempdima
38
 
\alloc@1\dimen\dimendef\insc@unt\@tempdima
39
 
\def\@warning#1{\message{Warning: #1.}}
40
 
\fi
41
 
 
42
 
\@ifundefined{ps@init}{}{\endinput}
43
 
 
44
 
\@ifundefined{hyperactivelabels}{\let\hyperactivelabels\relax}{}
45
 
 
46
 
\newif\if@topspecials %false for Rokicki's dvips: \special is at bottom of box
47
 
                      % true for dvitps, dvi2ps
48
 
 
49
 
\input driver.chg % driver-dependent definitions (generally a symlink)
50
 
 
51
 
\newcount\psfc@a
52
 
\newcount\psfc@b
53
 
\newcount\psfc@c
54
 
\newcount\psfc@d
55
 
\newcount\psfc@e
56
 
\newcount\psfc@f
57
 
\newcount\psfc@g
58
 
\newcount\psfc@h
59
 
\newcount\psfc@i
60
 
\newcount\psfc@j
61
 
\newcount\psscale@count
62
 
\newtoks\psfigtoks@
63
 
% A dimension register for temporarily storing a dimension in
64
 
% \@pDimenToSpNumber.
65
 
\newdimen\psfig@dimen
66
 
%
67
 
%\newwrite\@unused
68
 
%\def\typeout#1{{\let\protect\string\immediate\write\@unused{#1}}}
69
 
 
70
 
% Identifying message is here.
71
 
% \typeout{psfig/tex 1.4.gcg / TeXPS}\fi
72
 
%
73
 
% @psdo control structure -- similar to Latex @for.
74
 
% I redefined these with different names so that psfig can
75
 
% be used with TeX as well as LaTeX, and so that it will not 
76
 
% be vunerable to future changes in LaTeX's internal
77
 
% control structure.
78
 
\def\@nnil{\@nil}
79
 
\def\@empty{}
80
 
\def\@psdonoop#1\@@#2#3{}
81
 
\def\@psdo#1:=#2\do#3{\edef\@psdotmp{#2}\ifx\@psdotmp\@empty \else
82
 
    \expandafter\@psdoloop#2,\@nil,\@nil\@@#1{#3}\fi}
83
 
\def\@psdoloop#1,#2,#3\@@#4#5{\def#4{#1}\ifx #4\@nnil \else
84
 
       #5\def#4{#2}\ifx #4\@nnil \else#5\@ipsdoloop #3\@@#4{#5}\fi\fi}
85
 
\def\@ipsdoloop#1,#2\@@#3#4{\def#3{#1}\ifx #3\@nnil 
86
 
       \let\@nextwhile=\@psdonoop \else
87
 
      #4\relax\let\@nextwhile=\@ipsdoloop\fi\@nextwhile#2\@@#3{#4}}
88
 
\def\@tpsdo#1:=#2\do#3{\xdef\@psdotmp{#2}\ifx\@psdotmp\@empty \else
89
 
    \@tpsdoloop#2\@nil\@nil\@@#1{#3}\fi}
90
 
\def\@tpsdoloop#1#2\@@#3#4{\def#3{#1}\ifx #3\@nnil 
91
 
       \let\@nextwhile=\@psdonoop \else
92
 
      #4\relax\let\@nextwhile=\@tpsdoloop\fi\@nextwhile#2\@@#3{#4}}
93
 
94
 
\def\psdraft{%
95
 
  \def\@psdraft{0}
96
 
  %\typeout{draft level now is \@psdraft \space.}
97
 
}
98
 
\def\psfull{%
99
 
  \def\@psdraft{100}
100
 
  %\typeout{draft level now is \@psdraft \space.}
101
 
}
102
 
\psfull
103
 
\newif\if@prologfile
104
 
\newif\if@postlogfile
105
 
\newif\if@noisy
106
 
\def\pssilent{%
107
 
  \@noisyfalse
108
 
}
109
 
\def\psnoisy{%
110
 
  \@noisytrue
111
 
}
112
 
%\psnoisy
113
 
\pssilent
114
 
% These are for the option list: 
115
 
%  a specification of the form a = b maps to calling \@p@@sa{b}.
116
 
\newif\if@bbllx
117
 
\newif\if@bblly
118
 
\newif\if@bburx
119
 
\newif\if@bbury
120
 
\newif\if@height
121
 
\newif\if@width
122
 
\newif\if@rheight
123
 
\newif\if@rwidth
124
 
\newif\if@clip
125
 
\newif\if@proportional
126
 
\newif\if@scale
127
 
\newif\if@verbose
128
 
\def\@p@@sclip#1{\@cliptrue}
129
 
\def\@p@@sproportional#1{\@proportionaltrue}
130
 
\def\@p@@sfile#1{% 
131
 
  %\typeout{file is #1}
132
 
  \def\@p@sfile{#1.ps}% 
133
 
  \def\@labfile{#1.lab}% 
134
 
}
135
 
\def\@p@@sfigure#1{% 
136
 
  \def\@p@sfile{#1.ps}% 
137
 
  \def\@labfile{#1.lab}% 
138
 
}
139
 
% \@pDimenToSpNumber
140
 
% ==================
141
 
% Convert a dimension into scaled points.
142
 
% #1: the name of macro which will expand to the dimension in
143
 
%     scaled points, without the unit 'sp' though, i.e. as a pure
144
 
%     integer.
145
 
% #2: the dimension (not a dimension register, use
146
 
%     \the if dimension is stored in a dimension register).
147
 
\def\@pDimenToSpNumber #1#2{% 
148
 
  \psfig@dimen = #2\relax
149
 
  \edef#1{\number\psfig@dimen}%
150
 
}
151
 
\def\@p@@sbbllx#1{% 
152
 
  %\typeout{bbllx is #1}
153
 
  \@bbllxtrue
154
 
  \@pDimenToSpNumber{\@p@sbbllx}{#1}% 
155
 
}
156
 
\def\@p@@sbblly#1{% 
157
 
  %\typeout{bblly is #1}
158
 
  \@bbllytrue
159
 
  \@pDimenToSpNumber{\@p@sbblly}{#1}% 
160
 
}
161
 
\def\@p@@sbburx#1{%
162
 
  %\typeout{bburx is #1}
163
 
  \@bburxtrue
164
 
  \@pDimenToSpNumber{\@p@sbburx}{#1}% 
165
 
}
166
 
\def\@p@@sbbury#1{%
167
 
  %\typeout{bbury is #1}
168
 
  \@bburytrue
169
 
  \@pDimenToSpNumber{\@p@sbbury}{#1}% 
170
 
}
171
 
\def\@p@@sheight#1{%
172
 
  \@heighttrue
173
 
  \@pDimenToSpNumber{\@p@sheight}{#1}% 
174
 
  %\typeout{Height is \@p@sheight}
175
 
}
176
 
\def\@p@@swidth#1{%
177
 
  %\typeout{Width is #1}
178
 
  \@widthtrue
179
 
  \@pDimenToSpNumber{\@p@swidth}{#1}% 
180
 
}
181
 
\def\@p@@srheight#1{%
182
 
  %\typeout{Reserved height is #1}
183
 
  \@rheighttrue
184
 
  \@pDimenToSpNumber{\@p@srheight}{#1}% 
185
 
}
186
 
\def\@p@@srwidth#1{%
187
 
  %\typeout{Reserved width is #1}
188
 
  \@rwidthtrue
189
 
  \@pDimenToSpNumber{\@p@srwidth}{#1}% 
190
 
}
191
 
\def\@p@@ssilent#1{% 
192
 
  \@verbosefalse
193
 
}
194
 
\def\@p@@sscale #1{% 
195
 
  \def\@p@scale{#1}%
196
 
  \@scaletrue
197
 
}
198
 
 
199
 
\def\@p@@sprolog#1{\@prologfiletrue\def\@prologfileval{#1}}
200
 
\def\@p@@spostlog#1{\@postlogfiletrue\def\@postlogfileval{#1}}
201
 
\def\@cs@name#1{\csname #1\endcsname}
202
 
\def\@setparms#1=#2,{\def\@tempa{#2}\ifx\@tempa\@empty
203
 
  \@warning{bad syntax (missing = or extra comma) in argument of \string\psfig}%
204
 
  \else\@@setparms#1=#2,\fi}
205
 
\def\@@setparms#1=#2=,{\@cs@name{@p@@s#1}{#2}}
206
 
%
207
 
% Initialize the defaults.
208
 
%
209
 
\def\ps@init@parms{%
210
 
  \@bbllxfalse \@bbllyfalse
211
 
  \@bburxfalse \@bburyfalse
212
 
  \@heightfalse \@widthfalse
213
 
  \@rheightfalse \@rwidthfalse
214
 
  \@scalefalse
215
 
  \def\@p@sbbllx{}\def\@p@sbblly{}%
216
 
  \def\@p@sbburx{}\def\@p@sbbury{}%
217
 
  \def\@p@sheight{}\def\@p@swidth{}%
218
 
  \def\@p@srheight{}\def\@p@srwidth{}%
219
 
  \def\@p@sfile{}%
220
 
  \def\@labfile{}%
221
 
  \def\@p@scost{10}%
222
 
  \def\@sc{}%
223
 
  \@prologfiletrue
224
 
  \@postlogfilefalse
225
 
  \@clipfalse
226
 
  \@proportionalfalse
227
 
  \if@noisy
228
 
    \@verbosetrue
229
 
  \else
230
 
    \@verbosefalse
231
 
  \fi
232
 
}
233
 
%
234
 
% Go through the options setting things up.
235
 
%
236
 
\def\parse@ps@parms#1{%
237
 
   \@psdo\@psfiga:=#1\do
238
 
     {\expandafter\@setparms\@psfiga=,}% 
239
 
}
240
 
 
241
 
\newif\ifno@file
242
 
\newif\ifno@bb
243
 
\newif\ifnot@eof
244
 
\newif\if@bbmatch
245
 
\newif\if@crematch
246
 
\newif\ifmathematica
247
 
\newif\ifillustrator
248
 
\newread\ps@stream
249
 
\newread\lab@stream
250
 
\newcount\@linecount
251
 
\newcount\maxheaderlines
252
 
\maxheaderlines=100
253
 
 
254
 
%
255
 
% Scan header of file, looking for ``BoundingBox'' and ``Creator'' lines
256
 
%
257
 
\def\scan@header{%
258
 
  \openin\ps@stream=\@p@sfile
259
 
  \openin\lab@stream=\@labfile
260
 
  \ifeof\ps@stream
261
 
    \relax %needed so the \@warning won't cause trouble
262
 
    \@warning{cannot open \@p@sfile}
263
 
    \no@filetrue
264
 
  \else
265
 
    \not@eoftrue
266
 
    \ifno@bb \@bbmatchfalse \else \@bbmatchtrue \fi
267
 
    \@crematchfalse
268
 
    \catcode`\%=12
269
 
    \catcode`\:=12 % in case punctuation is active (e.g., under french.sty)
270
 
    \@linecount=\maxheaderlines
271
 
    \loop
272
 
      \read\ps@stream to \line@in
273
 
      \global\psfigtoks@=\expandafter{\line@in}
274
 
      \ifeof\ps@stream \not@eoffalse \fi
275
 
      %\typeout{ looking at :: \the\psfigtoks@ }
276
 
      \if@bbmatch \else \@bbtest{\psfigtoks@} \fi
277
 
      \if@crematch \else \@cretest{\psfigtoks@} \fi
278
 
      \if@crematch \if@bbmatch \not@eoffalse \fi \fi
279
 
      \advance\@linecount-1
280
 
      \ifnum\@linecount=0 \not@eoffalse \fi
281
 
    \ifnot@eof \repeat
282
 
  \fi
283
 
  \catcode`\%=14
284
 
}  
285
 
 
286
 
% '% ' becomes a regular character for a very short time.
287
 
288
 
  \catcode`\%=12
289
 
  \catcode`\:=12
290
 
  \gdef\@bbtest#1{\expandafter\@bb@\the#1%%BoundingBox:\@bbtest\@bb@}
291
 
  \global\long\def\@bb@#1%%BoundingBox:#2#3\@bb@{\ifx\@bbtest#2
292
 
    \else\@bbmatchtrue\expandafter\bb@cull\the\psfigtoks@\fi}
293
 
 
294
 
  \gdef\@cretest#1{\expandafter\@cre@\the#1%%Creator:\@cretest\@cre@}
295
 
  \global\long\def\@cre@#1%%Creator:#2#3\@cre@{\ifx\@cretest#2
296
 
    \else\@crematchtrue\@mathtest{\psfigtoks@}\@illtest{\psfigtoks@}\fi}
297
 
}
298
 
 
299
 
%
300
 
% Takes action if ``Creator'' line contains ``Mathematica'' or ``Illustrator''
301
 
%
302
 
\def\@mathtest#1{\expandafter\@math@\the#1Mathematica\@mathtest\@math@}
303
 
\long\def\@math@#1Mathematica#2#3\@math@{\ifx\@mathtest#2
304
 
    \else\mathematicatrue \fi}
305
 
 
306
 
\def\@illtest#1{\expandafter\@ill@\the#1Illustrator\@illtest\@ill@}
307
 
\long\def\@ill@#1Illustrator#2#3\@ill@{\ifx\@illtest#2
308
 
    \else\illustratortrue \fi}
309
 
 
310
 
\def\bb@cull#1:{\expandafter\bb@@cull\@iden}
311
 
\long\def\bb@@cull#1 #2 #3 #4 {%
312
 
  \@pDimenToSpNumber{\@p@sbbllx}{#1bp}%
313
 
  \@pDimenToSpNumber{\@p@sbblly}{#2bp}%
314
 
  \@pDimenToSpNumber{\@p@sbburx}{#3bp}%
315
 
  \@pDimenToSpNumber{\@p@sbbury}{#4bp}%
316
 
  \no@bbfalse
317
 
}
318
 
 
319
 
% Compute \@bbw and \@bbh, the width and height of the
320
 
% bounding box.
321
 
\def\compute@bb{%
322
 
  \no@bbfalse
323
 
  \if@bbllx \else \no@bbtrue \fi
324
 
  \if@bblly \else \no@bbtrue \fi
325
 
  \if@bburx \else \no@bbtrue \fi
326
 
  \if@bbury \else \no@bbtrue \fi
327
 
  \scan@header 
328
 
  \ifno@file
329
 
  \else
330
 
    \ifno@bb
331
 
      \@warning{no bounding box found in \@p@sfile}
332
 
      \no@filetrue
333
 
    \else
334
 
  % Now compute the size of the bounding box.
335
 
      \psfc@c=\@p@sbburx
336
 
      \psfc@b=\@p@sbbury
337
 
      \advance\psfc@c by -\@p@sbbllx
338
 
      \advance\psfc@b by -\@p@sbblly
339
 
      \edef\@bbw{\number\psfc@c}
340
 
      \edef\@bbh{\number\psfc@b}
341
 
      %\typeout{\string\compute@bb: bbh = \@bbh, bbw = \@bbw}
342
 
    \fi
343
 
  \fi
344
 
}
345
 
 
346
 
%
347
 
% \in@hundreds performs #1 * (#2 / #3) correct to the hundreds,
348
 
%    then leaves the result in \@result.
349
 
%
350
 
% note: #3 should be a big number, or a multiple of 10.
351
 
%
352
 
\def\in@hundreds #1#2#3{% 
353
 
  \psfc@g=#2
354
 
  \psfc@d=#3
355
 
  \divide\psfc@d 10
356
 
  \psfc@a=\psfc@g  % First two digits #2/#3.
357
 
  \divide\psfc@a by \psfc@d
358
 
  \psfc@f=\psfc@a
359
 
  \multiply\psfc@f by \psfc@d
360
 
  \advance\psfc@g by -\psfc@f
361
 
  \multiply\psfc@g by 10
362
 
  \psfc@f=\psfc@g  % Third digit of #2/#3.
363
 
  \divide\psfc@f by \psfc@d
364
 
  \psfc@j=\psfc@f
365
 
  \multiply\psfc@j by \psfc@d
366
 
  \advance\psfc@g by -\psfc@j
367
 
  \multiply\psfc@g by 10
368
 
  \psfc@j=\psfc@g  % Third digit.
369
 
  \divide\psfc@j by \psfc@d
370
 
  \psfc@h=#1\psfc@i=0
371
 
  \psfc@e=\psfc@h
372
 
  \multiply\psfc@e by \psfc@a
373
 
  \advance\psfc@i by \psfc@e
374
 
  \psfc@e=\psfc@h
375
 
  \divide\psfc@e by 10
376
 
  \multiply\psfc@e by \psfc@f
377
 
  \advance\psfc@i by \psfc@e
378
 
  %
379
 
  \psfc@e=\psfc@h
380
 
  \divide\psfc@e by 100
381
 
  \multiply\psfc@e by \psfc@j
382
 
  \advance\psfc@i by \psfc@e
383
 
  \divide\psfc@i 10
384
 
  %
385
 
  \edef\@result{\number\psfc@i}
386
 
}
387
 
% Scale a value #1 by the current scaling factor and reassign the new
388
 
% scaled value.
389
 
\def\@ScaleInHundreds #1{% 
390
 
  \in@hundreds{#1}{\@p@scale}{100}%
391
 
  \edef#1{\@result}% 
392
 
}
393
 
394
 
%
395
 
% Compute width from height.
396
 
\def\compute@wfromh{%
397
 
  % computing : width = height * (bbw / bbh)
398
 
  \in@hundreds{\@p@sheight}{\@bbw}{\@bbh}%
399
 
  %\typeout{ \@p@sheight * \@bbw / \@bbh, = \@result }
400
 
  \edef\@p@swidth{\@result}%
401
 
  %\typeout{w from h: width is \@p@swidth}%
402
 
}
403
 
%
404
 
% Compute height from width.
405
 
%
406
 
\def\compute@hfromw{%
407
 
  % computing : height = width * (bbh / bbw)
408
 
  \in@hundreds{\@p@swidth}{\@bbh}{\@bbw}%
409
 
  %\typeout{ \@p@swidth * \@bbh / \@bbw = \@result }
410
 
  \edef\@p@sheight{\@result}%
411
 
  %\typeout{h from w : height is \@p@sheight}%
412
 
}
413
 
%
414
 
% Compute height and width when both are given and proportionality
415
 
% must be preserved.
416
 
%
417
 
\def\compute@minhw{%
418
 
  \in@hundreds{\@p@swidth}{\@bbh}{\@bbw}%
419
 
  \ifnum\@p@sheight<\@result
420
 
    \in@hundreds{\@p@sheight}{\@bbw}{\@bbh}%
421
 
    \edef\@p@swidth{\@result}%
422
 
  \else
423
 
    \edef\@p@sheight{\@result}%
424
 
  \fi
425
 
}
426
 
%
427
 
% Compute height and width, i.e. \@p@sheight and \@p@swidth.
428
 
%
429
 
\def\compute@handw{%
430
 
  % If height is given.
431
 
  \if@height 
432
 
    % If width is given
433
 
    \if@width
434
 
      \if@proportional
435
 
        \compute@minhw
436
 
      \fi
437
 
    \else
438
 
      % Height, no width: compute width.
439
 
      \compute@wfromh
440
 
    \fi
441
 
  \else 
442
 
    % No height.
443
 
    \if@width
444
 
      % Width is given, no height though: compute it.
445
 
      \compute@hfromw
446
 
    \else
447
 
      % Neither width no height is give.
448
 
      \edef\@p@sheight{\@bbh}
449
 
      \edef\@p@swidth{\@bbw}
450
 
    \fi
451
 
  \fi
452
 
}
453
 
% Compute the amount of space to reserve. Unless defined
454
 
% using rheight and rwidth when \psfig is called, these values
455
 
% default to \@p@sheight and \@p@swidth.
456
 
\def\compute@resv{%
457
 
  \if@rheight \else \edef\@p@srheight{\@p@sheight} \fi
458
 
  \if@rwidth \else \edef\@p@srwidth{\@p@swidth} \fi
459
 
}
460
 
%
461
 
%
462
 
% \psfig
463
 
% ======
464
 
% usage: \psfig{file=, height=, width=, bbllx=, bblly=, bburx=, bbury=,
465
 
%      rheight=, rwidth=, clip=, scale=, proportional=}
466
 
%
467
 
% "clip=" and "proportional=" are switches and take no value, 
468
 
% but the `=' must be present.
469
 
%
470
 
\def\partest{\par}
471
 
\def\psfig#1{% 
472
 
  \vbox {%
473
 
    \offinterlineskip
474
 
    \ps@init@parms
475
 
    \parse@ps@parms{#1}%
476
 
    % Compute any missing sizes.
477
 
    \compute@bb
478
 
                \ifno@file\vbox{\hbox{{\tt\@p@sfile} not found}}%
479
 
                \else
480
 
    \compute@handw
481
 
    \compute@resv
482
 
    \if@scale
483
 
      %\if@verbose \typeout{psfig: scaling by \@p@scale}\fi
484
 
      % We now scale the width and height as reported to the PS printer.
485
 
      \@ScaleInHundreds{\@p@swidth}% 
486
 
      \@ScaleInHundreds{\@p@sheight}% 
487
 
      \@ScaleInHundreds{\@p@srwidth}% 
488
 
      \@ScaleInHundreds{\@p@srheight}% 
489
 
    \fi
490
 
    %
491
 
    \ifnum\@p@scost<\@psdraft
492
 
      %\if@verbose \typeout{psfig: including \@p@sfile \space}\fi
493
 
      \if@topspecials\do@specials\fi
494
 
      % Create a vbox to reserve the proper amount of space for the figure.
495
 
      \vbox to \@p@srheight sp{%
496
 
        \hbox to \@p@srwidth sp{}%
497
 
        \vss
498
 
      }%
499
 
      \if@topspecials\else\do@specials\fi
500
 
      \ifeof\lab@stream
501
 
        %\if@verbose\typeout{psfig: no file \@labfile \space  found}\fi
502
 
      \else{%
503
 
        \hyperactivelabels
504
 
        \not@eoftrue
505
 
        \loop
506
 
          \read\lab@stream to \line@in \ifx\line@in\partest\else\line@in\fi
507
 
          \ifeof\lab@stream \not@eoffalse \fi
508
 
        \ifnot@eof \repeat
509
 
      }\fi
510
 
    \else
511
 
      % Draft mode: reserve the space for the figure and print the path name.
512
 
      \vbox to \@p@srheight sp{%
513
 
        \hbox to \@p@srwidth sp{%
514
 
          \if@verbose
515
 
            \@p@sfile
516
 
          \fi
517
 
        }%
518
 
        \vss
519
 
      }%
520
 
    \fi
521
 
  \fi
522
 
  }%
523
 
}
524
 
 
525
 
\def\do@specials{\ps@init\ps@begin
526
 
  \if@clip 
527
 
     %\if@verbose \typeout{(clip)} \fi 
528
 
    \ps@clip \fi
529
 
  \if@prologfile \ps@prolog \fi \ps@include \if@postlogfile \ps@postlog \fi
530
 
  \ps@end}
531
 
 
532
 
\newbox\label@box
533
 
\newdimen\x@lab \newdimen\y@lab
534
 
\newdimen\x@aux \newdimen\y@aux
535
 
\newdimen\hair\hair=3pt
536
 
\def\setlabel#1#2#3#4#5{%
537
 
  \setbox\label@box\hbox{$#1$}%
538
 
  \x@lab.5\wd\label@box \x@lab#4\x@lab
539
 
  \y@lab.5\ht\label@box\advance\y@lab.5\dp\label@box \y@lab#5\y@lab 
540
 
% rotate lab clockwise by 22.5 degrees to get aux
541
 
  \x@aux.92388\x@lab \advance\x@aux.38268\y@lab
542
 
  \y@aux-.38268\x@lab \advance\y@aux.92388\y@lab
543
 
% choose 
544
 
  \ifdim\x@aux>0pt
545
 
    \ifdim\y@aux>0pt
546
 
      \ifdim\x@aux>\y@aux\advance\x@lab.7071\hair\advance\y@lab.7071\hair
547
 
      \else\advance\y@lab\hair\fi
548
 
    \else
549
 
      \ifdim\x@aux>-\y@aux\advance\x@lab\hair
550
 
      \else\advance\x@lab.7071\hair\advance\y@lab-.7071\hair\fi
551
 
    \fi
552
 
  \else
553
 
    \ifdim\y@aux>0pt
554
 
      \ifdim\x@aux>-\y@aux\advance\x@lab-.7071\hair\advance\y@lab.7071\hair
555
 
      \else\advance\x@lab-\hair\fi
556
 
    \else
557
 
      \ifdim\x@aux>\y@aux\advance\y@lab-\hair
558
 
      \else
559
 
        \ifdim\x@aux<0pt 
560
 
           \advance\x@lab-.7071\hair\advance\y@lab-.7071\hair\fi
561
 
      \fi
562
 
    \fi
563
 
  \fi
564
 
  \advance\x@lab.5\wd\label@box
565
 
  \advance\y@lab.5\ht\label@box\advance\y@lab.5\dp\label@box
566
 
  \x@aux=#2bp \ifoldlabels \else \advance\x@aux by -\@p@sbbllx sp \fi
567
 
  \y@aux=#3bp \ifoldlabels \else \advance\y@aux by -\@p@sbblly sp \fi
568
 
  \in@hundreds{\x@aux}{\@p@swidth}{\@bbw}
569
 
  \edef\@xpos{\@result}
570
 
  \in@hundreds{\y@aux}{\@p@sheight}{\@bbh}
571
 
  \edef\@ypos{\@result}
572
 
  \vbox to 0pt{%
573
 
    \vss\hbox to\@p@srwidth sp{\hskip \@xpos sp \hskip-\x@lab 
574
 
    \box\label@box\hss}\vskip \@ypos sp \vskip-\y@lab}}
575
 
 
576
 
\catcode`@=\atcatcode
577
 
 
578
 
% $Log: geompsfi.sty,v $
579
 
%Revision 1.18  95/12/06  13:40:51  levy
580
 
%made geompsfi.tex work (\ifx\@ifundefined was wrong!)
581
 
%
582
 
%Revision 1.17  1994/06/23  04:36:58  levy
583
 
%added \ifoldlabels for compatibility with behavior before version 1.11
584
 
%
585
 
%Revision 1.16  1994/04/29  00:19:21  levy
586
 
%combined with geompsfi.tex
587
 
%
588
 
%Revision 1.16  1994/04/29  00:03:40  levy
589
 
%leave plenty of space so patch geompsfi.tex works
590
 
%
591
 
%Revision 1.15  1994/04/03  07:07:57  levy
592
 
%removed hair correction when x@lab and y@lab are both zero
593
 
%
594
 
%Revision 1.14  1993/09/16  22:22:38  levy
595
 
%\catcode`\:=12 % in case punctuation is active (e.g., under french.sty)
596
 
%
597
 
%Revision 1.13  1993/08/27  23:04:27  levy
598
 
%removed "true" from PS dimensions (so it works with \magnifications)
599
 
%
600
 
%Revision 1.12  93/08/16  12:28:46  levy
601
 
%\ifundefined\hyperactivelabels
602
 
%
603
 
%Revision 1.11  93/07/19  02:17:24  levy
604
 
%.lab coordinates should be world coordinates
605
 
%
606
 
%Revision 1.10  93/03/05  10:59:38  levy
607
 
%error message when arguments of \psfig are incorrect
608
 
%
609
 
%Revision 1.9  1993/01/13  15:50:36  levy
610
 
%expressed things in bp (correctly)
611
 
%
612
 
%Revision 1.8  1993/01/10  20:56:04  levy
613
 
%inhundreds -> inthousands
614
 
%
615
 
%Revision 1.6  92/07/13  11:12:40  levy
616
 
%better error message when bounding box not found
617
 
%
618
 
%Revision 1.5  92/06/15  22:05:22  levy
619
 
%proportional scaling
620
 
%
621
 
%Revision 1.4  92/06/10  13:03:45  levy
622
 
%extend header from 10 to 15 lines
623
 
%
624
 
%Revision 1.3  92/06/10  12:41:14  levy
625
 
%scan header for "Creator" line
626
 
%
627
 
%Revision 1.2  92/04/07  09:09:17  levy
628
 
%*** empty log message ***
629
 
%
630
 
% Revision 1.1  92/03/31  14:12:38  levy
631
 
% Initial revision
632