Debian Codegraph @

texmf-dist/tex/latex-dev/graphics/graphics-2017-06-25.sty

raw
1 %%
2 %% This is an old release of `graphics.sty' used during rollback operations.
3 %% Do not use this file directly.
4 %% ==============================
5 %%
6 %% This is file `graphics.sty',
7 %% generated with the docstrip utility.
8 %%
9 %% The original source files were:
10 %%
11 %% graphics.dtx (with options: `package')
12 %%
13 %% The source is maintained by the LaTeX Project team and bug
14 %% reports for it can be opened at https://latex-project.org/bugs/
15 %% (but please observe conditions on bug reports sent to that address!)
16 %%
17 %%
18 %% graphics.dtx Copyright (C) 1994 David Carlisle Sebastian Rahtz
19 %% Copyright (C) 1995--2017 David Carlisle, LaTeX Project
20 %%
21 %% This file is part of the Standard LaTeX `Graphics Bundle'.
22 %% It may be distributed under the terms of the LaTeX Project Public
23 %% License, as described in lppl.txt in the base LaTeX distribution.
24 %% Either version 1.3c or, at your option, any later version.
25 %%
26 %% This file has the LPPL maintenance status "maintained".
27 %%
28 \NeedsTeXFormat{LaTeX2e}[1995/12/01]
29 \ProvidesPackage{graphics}
30 [2017/06/25 v1.2c Standard LaTeX Graphics (DPC,SPQR)]
31 \edef\Gin@codes{%
32 \catcode`\noexpand\^^A\the\catcode`\^^A\relax
33 \catcode`\noexpand\"\the\catcode`\"\relax
34 \catcode`\noexpand\*\the\catcode`\*\relax
35 \catcode`\noexpand\!\the\catcode`\!\relax
36 \catcode`\noexpand\:\the\catcode`\:\relax}
37 \catcode`\^^A=\catcode`\%
38 \@makeother\"%
39 \catcode`\*=11
40 \@makeother\!%
41 \@makeother\:%
42 \RequirePackage{trig}
43 \providecommand\Grot@start{\@latex@error{Rotation not supported}\@ehc
44 \global\let\Grot@start\relax}
45 \providecommand\Grot@end{}
46 \providecommand\Gscale@start{\@latex@error{Scaling not supported}\@ehc
47 \global\let\Gscale@start\relax}
48 \providecommand\Gscale@end{}
49 \edef\Gread@BBox{\@percentchar\@percentchar BoundingBox}
50 \DeclareOption{draft}{\Gin@drafttrue}
51 \DeclareOption{final}{\Gin@draftfalse}
52 \newif\ifGin@draft
53 \DeclareOption{hiresbb}{%
54 \edef\Gread@BBox{\@percentchar\@percentchar HiResBoundingBox}}
55 \DeclareOption{demo}{%
56 \AtBeginDocument{%
57 \def\Ginclude@graphics#1{%
58 \rule{\@ifundefined{Gin@@ewidth}{150pt}{\Gin@@ewidth}}%
59 {\@ifundefined{Gin@@eheight}{100pt}{\Gin@@eheight}}}}}
60 \newif\ifGin@setpagesize\Gin@setpagesizetrue
61 \DeclareOption{setpagesize}{\Gin@setpagesizetrue}
62 \DeclareOption{nosetpagesize}{\Gin@setpagesizefalse}
63 \providecommand\Gin@driver{}
64 \DeclareOption{dvips}{\def\Gin@driver{dvips.def}}
65 \DeclareOption{xdvi}{\ExecuteOptions{dvips}}
66 \DeclareOption{dvipdf}{\def\Gin@driver{dvipdf.def}}
67 \DeclareOption{dvipdfm}{\def\Gin@driver{dvipdfmx.def}}
68 \DeclareOption{dvipdfmx}{\def\Gin@driver{dvipdfmx.def}}
69 \DeclareOption{xetex}{\def\Gin@driver{xetex.def}}
70 \DeclareOption{pdftex}{\def\Gin@driver{pdftex.def}}
71 \DeclareOption{luatex}{\def\Gin@driver{luatex.def}}
72 \DeclareOption{dvisvgm}{\def\Gin@driver{dvisvgm.def}}
73 \DeclareOption{dvipsone}{\def\Gin@driver{dvipsone.def}}
74 \DeclareOption{dviwindo}{\ExecuteOptions{dvipsone}}
75 \DeclareOption{emtex}{\def\Gin@driver{emtex.def}}
76 \DeclareOption{dviwin}{\def\Gin@driver{dviwin.def}}
77 \DeclareOption{oztex}{\ExecuteOptions{dvips}}
78 \DeclareOption{textures}{\def\Gin@driver{textures.def}}
79 \DeclareOption{pctexps}{\def\Gin@driver{pctexps.def}}
80 \DeclareOption{pctexwin}{\def\Gin@driver{pctexwin.def}}
81 \DeclareOption{pctexhp}{\def\Gin@driver{pctexhp.def}}
82 \DeclareOption{pctex32}{\def\Gin@driver{pctex32.def}}
83 \DeclareOption{truetex}{\def\Gin@driver{truetex.def}}
84 \DeclareOption{tcidvi}{\def\Gin@driver{tcidvi.def}}
85 \DeclareOption{vtex}{\def\Gin@driver{vtex.def}}
86 \DeclareOption{debugshow}{\catcode`\^^A=9 \let\GDebug\typeout}
87 \InputIfFileExists{graphics.cfg}{}{}
88 \DeclareOption{hiderotate}{%
89 \def\Grot@start{\begingroup\setbox\z@\hbox\bgroup}
90 \def\Grot@end{\egroup\endgroup}}
91 \DeclareOption{hidescale}{%
92 \def\Gscale@start{\begingroup\setbox\z@\hbox\bgroup}
93 \def\Gscale@end{\egroup\endgroup}}
94 \ProcessOptions
95 \if!\Gin@driver!
96 \PackageError{graphics}
97 {No driver specified}
98 {You should make a default driver option in a file \MessageBreak
99 graphics.cfg\MessageBreak
100 eg: \protect\ExecuteOptions{textures}%
101 }
102 \else
103 \PackageInfo{graphics}{Driver file: \Gin@driver}
104 \@ifundefined{ver@\Gin@driver}{\input{\Gin@driver}}{}
105 \fi
106 \def\Gin@llx{0}
107 \let\Gin@lly\Gin@llx
108 \let\Gin@urx\Gin@llx
109 \let\Gin@ury\Gin@llx
110 \let\Gin@nat@width\leftmarginv
111 \let\Gin@nat@height\leftmarginvi
112 \newif\ifGin@clip
113 \newcommand\DeclareGraphicsExtensions[1]{%
114 \edef\Gin@extensions{\zap@space#1 \@empty}}
115 \providecommand\Gin@extensions{}
116 \def\includegraphics{%
117 \leavevmode
118 \@ifstar
119 {\Gin@cliptrue\Gin@i}%
120 {\Gin@clipfalse\Gin@i}}
121 \def\Gin@i{%
122 \@ifnextchar[%]
123 \Gin@ii
124 {\Gin@bboxfalse\Ginclude@graphics}}
125 \def\Gin@ii[#1]{%
126 \@ifnextchar[%]
127 {\Gin@iii[#1]}
128 {\Gin@iii[0,0][#1]}}
129 \def\Gin@iii[#1,#2][#3,#4]#5{%
130 \begingroup
131 \Gin@bboxtrue
132 \Gin@defaultbp\Gin@llx{#1}%
133 \Gin@defaultbp\Gin@lly{#2}%
134 \Gin@defaultbp\Gin@urx{#3}%
135 \Gin@defaultbp\Gin@ury{#4}%
136 \Ginclude@graphics{#5}%
137 \endgroup}
138 \def\Gin@defaultbp#1#2{%
139 \afterassignment\Gin@def@bp\dimen@#2bp\relax{#1}{#2}}
140 \def\Gin@def@bp#1\relax#2#3{%
141 \if!#1!%
142 \def#2{#3}%
143 \else
144 \[email protected]\dimen@
145 \edef#2{\strip@pt\dimen@}%
146 \fi}
147 \def\DeclareGraphicsRule#1#2#3#4{%
148 \edef\@tempa{\string *}\def\@tempb{#3}%
149 \expandafter\edef\csname Gin@rule@#1\endcsname##1%
150 {{#2}%
151 {\ifx\@tempa\@tempb\noexpand\Gin@ext\else#3\fi}%
152 {\ifx\indent#4\indent##1\else#4\fi}}}
153 \def\graphicspath#1{\def\Ginput@path{#1}}
154 \ifx\Ginput@path\@undefined
155 \let\Ginput@path\input@path
156 \fi
157 \def\Gin@getbase#1{%
158 \edef\Gin@tempa{%
159 \def\noexpand\@tempa####1#1\space{%
160 \def\noexpand\Gin@base{####1}}}%
161 \IfFileExists{\filename@area\filename@base#1}%
162 {\Gin@tempa
163 \expandafter\@tempa\@filef@und
164 \edef\Gin@ext{#1}}{}}%
165 \let\Gin@ext\relax
166 \def\Gin@sepdefault{.}
167 \def\Ginclude@graphics#1{%
168 \begingroup
169 \let\input@path\Ginput@path
170 \filename@parse{#1}%
171 \ifx\filename@ext\relax
172 \@for\Gin@temp:=\Gin@extensions\do{%
173 \ifx\Gin@ext\relax
174 \Gin@getbase\Gin@temp
175 \fi}%
176 \else
177 \Gin@getbase{\Gin@sepdefault\filename@ext}%
178 \ifx\Gin@ext\relax
179 \@warning{File `#1' not found}%
180 \def\Gin@base{\filename@area\filename@base}%
181 \edef\Gin@ext{\Gin@sepdefault\filename@ext}%
182 \fi
183 \fi
184 \ifx\Gin@ext\relax
185 \@latex@error{File `#1' not found}%
186 {I could not locate the file with any of these extensions:^^J%
187 \Gin@extensions^^J\@ehc}%
188 \else
189 \@ifundefined{Gin@rule@\Gin@ext}%
190 {\ifx\Gin@rule@*\@undefined
191 \@latex@error{Unknown graphics extension: \Gin@ext}\@ehc
192 \else
193 \expandafter\Gin@setfile\Gin@rule@*{\Gin@base\Gin@ext}%
194 \fi}%
195 {\expandafter\expandafter\expandafter\Gin@setfile
196 \csname Gin@rule@\Gin@ext\endcsname{\Gin@base\Gin@ext}}%
197 \fi
198 \endgroup}
199 \newif\ifGread@\Gread@true
200 \def\Gin@setfile#1#2#3{%
201 \ifx\\#2\\\Gread@false\fi
202 \ifGin@bbox\else
203 \ifGread@
204 \csname Gread@%
205 \expandafter\ifx\csname Gread@#1\endcsname\relax
206 eps%
207 \else
208 #1%
209 \fi
210 \endcsname{\Gin@base#2}%
211 \else
212 \Gin@nosize{#3}%
213 \fi
214 \fi
215 \Gin@viewport@code
216 \Gin@nat@height\Gin@ury bp%
217 \advance\Gin@nat@height-\Gin@lly bp%
218 \Gin@nat@width\Gin@urx bp%
219 \advance\Gin@nat@width-\Gin@llx bp%
220 \Gin@req@sizes
221 \expandafter\ifx\csname Ginclude@#1\endcsname\relax
222 \Gin@drafttrue
223 \expandafter\ifx\csname Gread@#1\endcsname\relax
224 \@latex@error{Can not include graphics of type: #1}\@ehc
225 \global\expandafter\let\csname Gread@#1\endcsname\@empty
226 \fi
227 \fi
228 \leavevmode
229 \ifGin@draft
230 \hb@xt@\Gin@req@width{%
231 \vrule\hss
232 \vbox to \Gin@req@height{%
233 \hrule \@width \Gin@req@width
234 \vss
235 \edef\@tempa{#3}%
236 \rlap{ \ttfamily\expandafter\strip@prefix\meaning\@tempa}%
237 \vss
238 \hrule}%
239 \hss\vrule}%
240 \else
241 \@addtofilelist{#3}%
242 \ProvidesFile{#3}[Graphic file (type #1)]%
243 \setbox\z@\hbox{\csname Ginclude@#1\endcsname{#3}}%
244 \dp\z@\z@
245 \ht\z@\Gin@req@height
246 \wd\z@\Gin@req@width
247 \box\z@
248 \fi}
249 \let\Gin@decode\@empty
250 \def\Gin@exclamation{!}
251 \let\Gin@page\@empty
252 \def\Gin@pagebox{cropbox}
253 \newif\ifGin@interpolate
254 \let\Gin@log\wlog
255 \let\Gin@req@sizes\relax
256 \def\Gin@scalex{1}%
257 \let\Gin@scaley\Gin@exclamation
258 \let\Gin@req@height\Gin@nat@height
259 \let\Gin@req@width\Gin@nat@width
260 \let\Gin@viewport@code\relax
261 \def\Gin@nosize#1{%
262 \@latex@error
263 {Cannot determine size of graphic in #1 (no size specified)}%
264 \@ehc}
265 \newif\ifGin@bbox
266 \def\Gread@generic#1#2{%
267 \edef\Gread@attr@hash{%
268 \ifx\Gin@pagebox\@empty\else
269 :\Gin@pagebox
270 \fi
271 \ifx\Gin@page\@empty\else
272 :P\Gin@page
273 \fi
274 }%
275 \@ifundefined{#1 bbox\Gread@attr@hash}%
276 {\Gread@generic@aux{#1}{#2}}
277 {%
278 \expandafter\global\expandafter\let\expandafter\@gtempa
279 \csname #1 bbox\Gread@attr@hash\endcsname
280 }%
281 \expandafter\Gread@parse@bb\@gtempa\\%
282 }
283 \def\Gread@generic@aux#1#2{%
284 \begingroup
285 \@tempcnta\z@
286 \loop\ifnum\@tempcnta<\@xxxii
287 \catcode\@tempcnta14 %
288 \advance\@tempcnta\@ne
289 \repeat
290 \catcode`\^^?14 %
291 \let\do\@makeother
292 \dospecials
293 \catcode`\ 10 %
294 \catcode`\^^I10 %
295 \catcode\endlinechar5 %
296 \@makeother\:%
297 \@makeother\-%
298 \immediate\openin\@inputcheck"#1" %
299 #2{#1}%
300 \ifGin@bbox
301 \expandafter\xdef\csname #1 bbox\Gread@attr@hash\endcsname{\@gtempa}%
302 \else
303 \@latex@error
304 {Cannot determine size of graphic in #1 (no BoundingBox)}%
305 \@ehc
306 \gdef\@gtempa{0 0 72 72 }%
307 \fi
308 \endgroup
309 }
310 \def\Gread@eps#1{%
311 \Gread@generic{#1}\Gread@eps@aux
312 }
313 \def\Gread@eps@aux#1{%
314 \ifeof\@inputcheck
315 \@latex@error{File `#1' not found}\@ehc
316 \else
317 \Gread@true
318 \let\@tempb\Gread@false
319 \loop
320 \read\@inputcheck to\@tempa
321 \ifeof\@inputcheck
322 \Gread@false
323 \else
324 \expandafter\Gread@find@bb\@tempa:.\\%
325 \fi
326 \ifGread@
327 \repeat
328 \immediate\closein\@inputcheck
329 \fi
330 }
331 \long\def\Gread@find@bb#1:#2#3\\{%
332 \def\@tempa{#1}%
333 \ifx\@tempa\Gread@BBox
334 \Gread@test@atend#2#3()\\%
335 \fi}
336 \def\Gread@test@atend#1(#2)#3\\{%
337 \def\@tempa{#2}%
338 \ifx\@tempa\Gread@atend
339 \Gread@true
340 \let\@tempb\relax
341 \else
342 \gdef\@gtempa{#1}%
343 \@tempb
344 \Gin@bboxtrue
345 \fi}
346 \def\Gread@parse@bb#1 #2 #3 #4 #5\\{%
347 \Gin@defaultbp\Gin@llx{#1}%
348 \Gin@defaultbp\Gin@lly{#2}%
349 \Gin@defaultbp\Gin@urx{#3}%
350 \Gin@defaultbp\Gin@ury{#4}}%
351 \def\Gread@atend{atend}
352 \let\Grot@height\@ovxx
353 \let\Grot@left\@ovyy
354 \let\Grot@right\@ovdx
355 \let\Grot@depth\@ovdy
356 \let\Grot@l\@ovro
357 \let\Grot@r\@ovri
358 \let\Grot@h\@xdim
359 \let\Grot@d\@ydim
360 \let\Grot@x\@linelen
361 \let\Grot@y\@dashdim
362 \long\def\rotatebox#1#2{%
363 \leavevmode
364 \Grot@setangle{#1}%
365 \setbox\z@\hbox{{#2}}%
366 \Grot@x\z@
367 \Grot@y\z@
368 \Grot@box}
369 \def\Grot@setangle#1{\edef\Grot@angle{#1}}
370 \def\Grot@Px#1#2#3{%
371 #1\Grot@cos#2%
372 \advance#1-\Grot@sin#3}
373 \def\Grot@Py#1#2#3{%
374 #1\Grot@sin#2%
375 \advance#1\Grot@cos#3}
376 \def\Grot@box{%
377 \begingroup
378 \CalculateSin\Grot@angle
379 \CalculateCos\Grot@angle
380 \edef\Grot@sin{\UseSin\Grot@angle}%
381 \edef\Grot@cos{\UseCos\Grot@angle}%
382 ^^A \GDebug{Rotate: angle \Grot@angle, sine is \Grot@sin,
383 ^^A cosine is \Grot@cos}%
384 \Grot@r\wd\z@ \advance\Grot@r-\Grot@x
385 \Grot@l\z@ \advance\Grot@l-\Grot@x
386 \Grot@h\ht\z@ \advance\Grot@h-\Grot@y
387 \Grot@d-\dp\z@ \advance\Grot@d-\Grot@y
388 \ifdim\Grot@sin\p@>\z@
389 \ifdim\Grot@cos\p@>\z@
390 \Grot@Py\Grot@height \Grot@r\Grot@h%B
391 \Grot@Px\Grot@right \Grot@r\Grot@d%E
392 \Grot@Px\Grot@left \Grot@l\Grot@h%C
393 \Grot@Py\Grot@depth \Grot@l\Grot@d%D
394 \else
395 \Grot@Py\Grot@height \Grot@r\Grot@d%E
396 \Grot@Px\Grot@right \Grot@l\Grot@d%D
397 \Grot@Px\Grot@left \Grot@r\Grot@h%B
398 \Grot@Py\Grot@depth \Grot@l\Grot@h%C
399 \fi
400 \else
401 \ifdim\Grot@cos\p@<\z@
402 \Grot@Py\Grot@height \Grot@l\Grot@d%D
403 \Grot@Px\Grot@right \Grot@l\Grot@h%C
404 \Grot@Px\Grot@left \Grot@r\Grot@d%E
405 \Grot@Py\Grot@depth \Grot@r\Grot@h%B
406 \else
407 \Grot@Py\Grot@height \Grot@l\Grot@h%C
408 \Grot@Px\Grot@right \Grot@r\Grot@h%B
409 \Grot@Px\Grot@left \Grot@l\Grot@d%D
410 \Grot@Py\Grot@depth \Grot@r\Grot@d%E
411 \fi
412 \fi
413 \advance\Grot@height\Grot@y
414 \advance\Grot@depth\Grot@y
415 \Grot@Px\dimen@ \Grot@x\Grot@y
416 \Grot@Py\dimen@ii \Grot@x\Grot@y
417 \dimen@-\dimen@ \advance\dimen@-\Grot@left
418 \dimen@ii-\dimen@ii \advance\dimen@ii\Grot@y
419 ^^A \GDebug{Rotate: (l,r,h,d)^^J%
420 ^^A Original \the\Grot@l,\the\Grot@r,\the\Grot@h,\the\Grot@d,^^J%
421 ^^A New..... \the\Grot@left,\the\Grot@right,%
422 ^^A \the\Grot@height,\the\Grot@depth}%
423 \setbox\z@\hbox{%
424 \kern\dimen@
425 \raise\dimen@ii\hbox{\Grot@start\box\z@\Grot@end}}%
426 \ht\z@\Grot@height
427 \dp\z@-\Grot@depth
428 \advance\Grot@right-\Grot@left\wd\z@\Grot@right
429 \leavevmode\box\z@
430 \endgroup}
431 \def\scalebox#1{%
432 \@ifnextchar[{\Gscale@box{#1}}{\Gscale@box{#1}[#1]}}
433 \long\def\Gscale@box#1[#2]#3{%
434 \leavevmode
435 \def\Gscale@x{#1}\def\Gscale@y{#2}%
436 \setbox\z@\hbox{{#3}}%
437 \setbox\tw@\hbox{\Gscale@start\rlap{\copy\z@}\Gscale@end}%
438 \ifdim#2\p@<\z@
439 \ht\tw@-#2\dp\z@
440 \dp\tw@-#2\ht\z@
441 \else
442 \ht\tw@#2\ht\z@
443 \dp\tw@#2\dp\z@
444 \fi
445 \ifdim#1\p@<\z@
446 \hb@xt@-#1\wd\z@{\kern-#1\wd\z@\box\tw@\hss}%
447 \else
448 \hb@xt@#1\wd\z@{\box\tw@\kern#1\wd\z@\hss}%
449 \fi}
450 \def\reflectbox{\Gscale@box-1[1]}
451 \def\resizebox{%
452 \leavevmode
453 \@ifstar{\Gscale@@box\totalheight}{\Gscale@@box\height}}
454 \def\Gscale@@box#1#2#3{%
455 \let\@tempa\Gin@exclamation
456 \expandafter\def\expandafter\@tempb\expandafter{\string#2}%
457 \expandafter\def\expandafter\@tempc\expandafter{\string#3}%
458 \ifx\@tempb\@tempa
459 \ifx\@tempc\@tempa
460 \toks@{\mbox}%
461 \else
462 \toks@{\Gscale@box@dd{#3}#1}%
463 \fi
464 \else
465 \ifx\@tempc\@tempa
466 \toks@{\Gscale@box@dd{#2}\width}%
467 \else
468 \toks@{\Gscale@box@dddd{#2}\width{#3}#1}%
469 \fi
470 \fi
471 \the\toks@}
472 \long\def\Gscale@box@dd#1#2#3{%
473 \@begin@tempboxa\hbox{#3}%
474 \setlength\@tempdima{#1}%
475 \setlength\@tempdimb{#2}%
476 \Gscale@div\@tempa\@tempdima\@tempdimb
477 \Gscale@box\@tempa[\@tempa]{\box\@tempboxa}%
478 \@end@tempboxa}
479 \long\def\Gscale@box@dddd#1#2#3#4#5{%
480 \@begin@tempboxa\hbox{#5}%
481 \setlength\@tempdima{#1}%
482 \setlength\@tempdimb{#2}%
483 \Gscale@div\@tempa\@tempdima\@tempdimb
484 \setlength\@tempdima{#3}%
485 \setlength\@tempdimb{#4}%
486 \Gscale@div\@tempb\@tempdima\@tempdimb
487 \ifGin@iso
488 \ifdim\@tempa\p@>\@tempb\p@
489 \let\@tempa\@tempb
490 \else
491 \let\@tempb\@tempa
492 \fi
493 \fi
494 \Gscale@box\@tempa[\@tempb]{\box\@tempboxa}%
495 \@end@tempboxa}
496 \newif\ifGin@iso
497 \def\Gscale@div#1#2#3{%
498 \setlength\dimen@{#3}%
499 \ifdim\dimen@=\z@
500 \PackageError{graphics}{Division by 0}\@eha
501 \dimen@#2%
502 \fi
503 \edef\@tempd{\the\dimen@}%
504 \setlength\dimen@{#2}%
505 \count@65536\relax
506 \ifdim\dimen@<\z@
507 \dimen@-\dimen@
508 \count@-\count@
509 \fi
510 \ifdim\dimen@>\z@
511 \loop
512 \ifdim\ifnum\count@<\tw@\maxdimen\else\dimen@\fi<8192\p@
513 \dimen@\tw@\dimen@
514 \divide\count@\tw@
515 \repeat
516 \dimen@ii\@tempd\relax
517 \divide\dimen@ii\count@
518 \divide\dimen@\dimen@ii
519 \fi
520 \edef#1{\strip@pt\dimen@}}
521 \Gin@codes
522 \let\Gin@codes\relax
523 % alow use of current .def files
524 \def\quote@name#1{"\quote@@name#1\@gobble""}
525 \def\quote@@name#1"{#1\quote@@name}
526 \def\unquote@name#1{\quote@@name#1\@gobble"}
527 %
528 \endinput
529 %%
530 %% End of file `graphics.sty'.