Move a tag
[latex2e.git] / latex2e-20160201 / required / graphics / drivers.dtx
bloba344b6ecf0d97236f3d631b10a9e5d672395d341
2 % \iffalse
4 %% drivers.dtx Copyright (C) 1994      David Carlisle Sebastian Rahtz
5 %%             Copyright (C) 1995 1996 1997 1998 1999 David Carlisle
6 %%             Copyright (C) 2000--2015 David Carlisle, LaTeX3 Project
7 %%
8 %% This file is part of the Standard LaTeX `Graphics Bundle'.
9 %% It may be distributed under the terms of the LaTeX Project Public
10 %% License, as described in lppl.txt in the base LaTeX distribution.
11 %% Either version 1.3 or, at your option, any later version.
13 %<template, >\ProvidesFile{template.def}
14 %<dvips,    >\ProvidesFile{dvips.def}
15 %<dvipsnames>\ProvidesFile{dvipsnam.def}
16 %<dvipdf,   >\ProvidesFile{dvipdf.def}
17 %<emtex,    >\ProvidesFile{emtex.def}
18 %<dviwin,   >\ProvidesFile{dviwin.def}
19 %<dvipsone, >\ProvidesFile{dvipsone.def}
20 %<pctexps,  >\ProvidesFile{pctexps.def}
21 %<pctex32,  >\ProvidesFile{pctex32.def}
22 %<pctexwin, >\ProvidesFile{pctexwin.def}
23 %<pctexhp,  >\ProvidesFile{pctexhp.def}
24 %<truetex,  >\ProvidesFile{truetex.def}
25 %<tcidvi,   >\ProvidesFile{tcidvi.def}
26 %<oztex,    >\ProvidesFile{oztex.def}
27 %<textures, >\ProvidesFile{textures.def}
28 %<dvialw,   >\ProvidesFile{dvialw.def}
29 %<dvilaser, >\ProvidesFile{dvilaser.def}
30 %<psprint,  >\ProvidesFile{psprint.def}
31 %<dvi2ps,   >\ProvidesFile{dvi2ps.def}
32 %<pubps,    >\ProvidesFile{pubps.def}
33 %<dvitops,  >\ProvidesFile{dvitops.def}
34 %<ln,       >\ProvidesFile{ln.def}
36 %<*driver>
37     \NeedsTeXFormat{LaTeX2e}
38     \ProvidesFile{drivers.dtx}
39 %</driver>
40         [2015/12/30 v3.0k Driver-dependent file (DPC,SPQR)]
42 %<*driver>
43     \documentclass{ltxdoc}
44     \GetFileInfo{drivers.dtx}
45  \begin{document}
46    \title{Graphics drivers for \LaTeXe\thanks
47      {Version \fileversion, revised \filedate}}
48    \author{Sebastian Rahtz and David Carlisle}
49    \date{\filedate}
50    \MaintainedByLaTeXTeam{graphics}
51    \maketitle
52    \DocInput{drivers.dtx}
53  \end{document}
54 %</driver>
55 % \fi
57 % \CheckSum{1546}
60 % \providecommand\OzTeX{O\kern-.03em z\kern-.15em\TeX}
62 % \section{Driver files}
64 % This file implements some of the currently supported drivers.
65 % If the driver you use is not in this list then a `.def' file
66 % may be distributed with This graphics bundle,
67 % or may be distributed with your driver.
69 % If not, send us some details of the driver's |\special| syntax, and
70 % we will try to produce a suitable file.
72 % Note that some of these files are for drivers to which we have no
73 % access, so they are untested. Please send any corrections to the
74 % latexbugs address.
79 % \StopEventually{}
82 % \section{Colour}
84 % Most of the drivers that support colour use one of three methods.
85 % \begin{itemize}
86 % \item color1: `dvips' style colour specials.
87 % \item color2: `textures' style colour specials.
88 % \item color3: Colour implemented via literal PostScript specials.
89 % \item color4: Colour implemented by specials that only support RGB,
90 %               i.e., Red Green Blue specified as integers in the range
91 %               0--255. Other models converted to this within \TeX.
92 % \end{itemize}
93 % Some drivers do not use any of these modules and have their own code.
94 % Note that drivers using the `color3' code can not fully support the
95 % \LaTeX\ colour commands.
96 %    \begin{macrocode}
97 %<*color1|color2|color3|color4>
98 %    \end{macrocode}
100 %    \begin{macrocode}
101 \def\c@lor@arg#1{%
102   \dimen@#1\p@
103   \ifdim\dimen@<\z@\dimen@\maxdimen\fi
104   \ifdim\dimen@>\p@
105     \PackageError{color}{Argument `#1' not in range [0,1]}\@ehd
106   \fi}
107 %    \end{macrocode}
109 % Need to make sure of a trailing .0 for textures. Apparently it
110 % is OK to always add a . as 1.3. is accepted by textures.
111 % textures gray special is reversed, so just use rgb instead.
113 %    \begin{macrocode}
114 \def\color@gray#1#2{%
115   \c@lor@arg{#2}%
116 %<color4>  \c@lor@rgb@RGB\@tempa
117 %<color1>  \edef#1{gray #2}%
118 %<color2>  \edef#1{rgb #2. #2. #2.}%
119 %<color3>  \edef#1{#2 setgray}%
120 %<color4>  \edef#1{\@tempa\@tempa\@tempa}%
121   }
122 %    \end{macrocode}
124 %    \begin{macrocode}
125 \def\color@cmyk#1#2{\c@lor@@cmyk#2\@@#1}
126 \def\c@lor@@cmyk#1,#2,#3,#4\@@#5{%
127   \c@lor@arg{#4}%
128 %<color4>    \dimen@ii#4\p@
129   \c@lor@arg{#1}%
130 %<color4>  \c@lor@cmyk@RGB\@tempa
131   \c@lor@arg{#2}%
132 %<color4>  \c@lor@cmyk@RGB\@tempb
133   \c@lor@arg{#3}%
134 %<color4>  \c@lor@cmyk@RGB\@tempc
135 %<color1>  \edef#5{cmyk #1 #2 #3 #4}%
136 %<color2>  \edef#5{cmyk #1. #2. #3. #4.}%
137 %<color3>  \edef#5{#1 #2 #3 #4 setcmykcolor}%
138 %<color4>  \edef#5{\@tempa\@tempb\@tempc}%
139   }
140 %    \end{macrocode}
142 % A 0--1 range value will have been left in |\dimen@| by |\c@lor@arg|.
143 % The black value (0--1) will be stored in |\dimen@ii|.
144 % Covert to 0--255 integer, and leave in |#1|.
145 %    \begin{macrocode}
146 %<*color4>
147 \def\c@lor@cmyk@RGB#1{%
148   \advance\dimen@-\p@
149   \advance\dimen@\dimen@ii
150   \dimen@-\@cclv\dimen@
151   \divide\dimen@\p@
152   \count@\ifdim\dimen@<\z@\z@\else\dimen@\fi
153   \edef#1{\the\count@\space}}
154 %</color4>
155 %    \end{macrocode}
157 %    \begin{macrocode}
158 \def\color@rgb#1#2{\c@lor@@rgb#2\@@#1}
159 \def\c@lor@@rgb#1,#2,#3\@@#4{%
160   \c@lor@arg{#1}%
161 %<color4>  \c@lor@rgb@RGB\@tempa
162   \c@lor@arg{#2}%
163 %<color4>  \c@lor@rgb@RGB\@tempb
164   \c@lor@arg{#3}%
165 %<color4>  \c@lor@rgb@RGB\@tempc
166 %<color1>  \edef#4{rgb #1 #2 #3}%
167 %<color2>  \edef#4{rgb #1. #2. #3.}%
168 %<color3>  \edef#4{#1 #2 #3 setrgbcolor}%
169 %<color4>  \edef#4{\@tempa\@tempb\@tempc}%
170   }
171 %    \end{macrocode}
173 % A 0--1 range value will have been left in |\dimen@| by |\c@lor@arg|.
174 % Convert to 0--255 integer, and leave in |#1|.
175 %    \begin{macrocode}
176 %<*color4>
177 \def\c@lor@rgb@RGB#1{%
178   \dimen@\@cclv\dimen@
179   \count@\dimen@
180   \divide\count@\p@
181   \edef#1{\the\count@\space}}
182 %</color4>
183 %    \end{macrocode}
185 %    \begin{macrocode}
186 \def\color@RGB#1#2{\c@lor@@RGB#2\@@#1}
187 %    \end{macrocode}
189 %    \begin{macrocode}
190 \def\c@lor@@RGB#1,#2,#3\@@#4{%
191 %<!color4> \c@lor@RGB@rgb{#1}\@tempa
192 %<!color4> \c@lor@RGB@rgb{#2}\@tempb
193 %<!color4> \c@lor@RGB@rgb{#3}\@tempc
194 %<!color4> \c@lor@@rgb\@tempa,\@tempb,\@tempc\@@#4%
195 %<color4>  \edef#4{#1 #2 #3}%
196   }
197 %    \end{macrocode}
198 % % Convert 0--255 integer, |#1|, to 0--1 real, and leave in |#2|.
199 %    \begin{macrocode}
200 %<*!color4>
201 \def\c@lor@RGB@rgb#1#2{%
202   \dimen@#1\p@
203   \divide\dimen@\@cclv
204   \edef#2{\strip@pt\dimen@}}
205 %</!color4>
206 %    \end{macrocode}
208 %    \begin{macrocode}
209 %<*color1|color3>
210 \def\color@hsb#1#2{\c@lor@@hsb#2\@@#1}
211 %    \end{macrocode}
213 %    \begin{macrocode}
214 \def\c@lor@@hsb#1,#2,#3\@@#4{%
215   \c@lor@arg{#1}%
216   \c@lor@arg{#2}%
217   \c@lor@arg{#3}%
218 %<color1>  \edef#4{hsb #1 #2 #3}%
219 %<color3>  \edef#4{#1 #2 #3 sethsbcolor}%
220   }
221 %</color1|color3>
222 %    \end{macrocode}
224 %    \begin{macrocode}
225 \def\color@named#1#2{\c@lor@@named#2,,\@@#1}
226 %    \end{macrocode}
228 %    \begin{macrocode}
229 \def\c@lor@@named#1,#2,#3\@@#4{%
230   \@ifundefined{col@#1}%
231     {\PackageError{color}{Undefined color `#1'}\@ehd}%
232 %<color1&!dvipsone>  {\edef#4{ #1}}%
233 %<color2>  {\edef#4{ #1 \if!#2!\else #2.\fi}}%
234 %<color3|dvipsone|color4>  {\edef#4{\csname col@#1\endcsname}}%
235   }
236 %    \end{macrocode}
238 % Conversion from |\special| syntax to PostScript (for PSTricks).
239 %    \begin{macrocode}
240 %<*color1|color2>
241 \def\c@lor@to@ps#1 #2\@@{\csname c@lor@ps@#1\endcsname#2 \@@}
242 %</color1|color2>
243 %<*color3>
244 \def\c@lor@to@ps#1\@@{#1}
245 %</color3>
246 %<*color4>
247 \def\c@lor@to@ps#1#2 #3 #4\@@{%
248   #1#2 255 div #3 255 div #4 255 div setrgbcolor}
249 %</color4>
250 %    \end{macrocode}
252 %    \begin{macrocode}
253 %<*color1>
254 \def\c@lor@ps@#1 #2\@@{TeXDict begin #1 end}
255 \def\c@lor@ps@rgb#1\@@{#1 setrgbcolor}
256 \def\c@lor@ps@hsb#1\@@{#1 sethsbcolor}
257 \def\c@lor@ps@cmyk#1\@@{#1 setcmykcolor}
258 \def\c@lor@ps@gray#1\@@{#1 setgray}
259 %</color1>
260 %<*color2>
261 \def\c@lor@to@ps@#1 #2\@@{\csname c@lor@ps@#1@\endcsname#2 \@@}
262 \def\c@lor@ps@#1 #2\@@{%
263   \expandafter\expandafter\expandafter
264      \c@lor@to@ps@\csname col@#1\expandafter\endcsname\space#2. \@@{#1}}
265 \def\c@lor@ps@rgb#1. #2. #3. #4\@@{#1 #2 #3 setrgbcolor}
266 \def\c@lor@ps@rgb@#1. #2. #3. #4. #5\@@#6{#1 #2 #3 setrgbcolor}
267 \def\c@lor@ps@cmyk#1. #2. #3. #4. #5. #6\@@{#1 #2 #3 #4 setcmykcolor}
268 \def\c@lor@ps@cmyk@#1. #2. #3. #4. #5. #6\@@#7{%
269        #1 #2 #3 #4  (#7)  findcustomcmykcolor
270        \if!\@firstofone#5!1 \else#5 \fi setcustomcolor}
271 %</color2>
272 %    \end{macrocode}
274 %    \begin{macrocode}
275 %<color1&!dvipsone>\def\current@color{ Black}
276 %<color1&dvipsone>\def\current@color{gray 0}
277 %<color2>\def\current@color{rgb 0. 0. 0.}
278 %<color3>\def\current@color{0 setgray}
279 %<color4>\def\current@color{0 0 0}
280 %    \end{macrocode}
282 % \changes{v3.0j}{2014/04/23}
283 %     {add \cs{nopagecolor} for dvips graphics/3873}
284 %    \begin{macrocode}
285 %<*color1>
286 \def\set@color{%
287 %<!dvipsone&!dvipdf> \special{color push  \current@color
288 %<dvipsone>          \special{color push}\special{color \current@color
289 %<dvipdf>            \special{pdf: /C  \current@color\space<<
290                           }\aftergroup\reset@color}
291 \def\reset@color{\special{%
292 %<!dvipdf>        color pop}}
293 %<dvipdf>         pdf: /C >> }}
294 \def\set@page@color{\special{%
295 %<!dvipdf>        background \current@color}}
296 %<dvipdf>         pdf: /BG \current@color}}
297 \def\define@color@named#1#2{%
298 %<!dvipsone>  \expandafter\let\csname col@#1\endcsname\@nnil}
299 %<dvipsone>   \expandafter\edef\csname col@#1\endcsname{#2}}
300 %<dvips>      \def\no@page@color{\special{background \string"newpath clip}}
301 %</color1>
302 %<*color2>
303 \def\set@color{%
304   \special{color push}%
305   \special{color \current@color}%
306   \aftergroup\reset@color}
307 \def\reset@color{\special{color pop}}
308 \def\set@page@color{\c@lor@special\sixt@@n{background \current@color}}
309 \def\define@color@named#1#2{%
310   \AtBeginDvi{\special{color define #1 #2}}%
311   \expandafter\edef\csname col@#1\endcsname{#2}}
312 %</color2>
313 %<*color3>
314 \def\set@color{%
315   \Gin@PS@raw{\current@color}\aftergroup\reset@color}
316 \def\reset@color{\Gin@PS@raw{\current@color}}
317 %</color3>
318 %<*color4>
319 \def\set@color{%
320   \special{textcolor: \current@color}\aftergroup\reset@color}
321 \def\reset@color{\special{textcolor: \current@color}}
322 %</color4>
323 %<*color3|color4>
324 \def\set@page@color{%
325   \c@lor@special\sixt@@n{background color ignored: \current@color}}
326 \def\define@color@named#1#2{%
327   \expandafter\edef\csname col@#1\endcsname{#2}}
328 %</color3|color4>
329 %    \end{macrocode}
331 %    \begin{macrocode}
332 %</color1|color2|color3|color4>
333 %    \end{macrocode}
335 %    \begin{macrocode}
336 %<*colorfix>
337 \AtBeginDocument{%
338   \let\@ldc@l@r\color
339   \def\color{\if@inlabel\leavevmode\fi\@ldc@l@r}%
340   \let\@lduseb@x\usebox
341   \def\usebox#1{\@lduseb@x{#1}\set@color}}
342 %</colorfix>
343 %    \end{macrocode}
345 %    \begin{macrocode}
346 %<*dvipsnames>
347 \DefineNamedColor{named}{GreenYellow}   {cmyk}{0.15,0,0.69,0}
348 \DefineNamedColor{named}{Yellow}        {cmyk}{0,0,1,0}
349 \DefineNamedColor{named}{Goldenrod}     {cmyk}{0,0.10,0.84,0}
350 \DefineNamedColor{named}{Dandelion}     {cmyk}{0,0.29,0.84,0}
351 \DefineNamedColor{named}{Apricot}       {cmyk}{0,0.32,0.52,0}
352 \DefineNamedColor{named}{Peach}         {cmyk}{0,0.50,0.70,0}
353 \DefineNamedColor{named}{Melon}         {cmyk}{0,0.46,0.50,0}
354 \DefineNamedColor{named}{YellowOrange}  {cmyk}{0,0.42,1,0}
355 \DefineNamedColor{named}{Orange}        {cmyk}{0,0.61,0.87,0}
356 \DefineNamedColor{named}{BurntOrange}   {cmyk}{0,0.51,1,0}
357 \DefineNamedColor{named}{Bittersweet}   {cmyk}{0,0.75,1,0.24}
358 \DefineNamedColor{named}{RedOrange}     {cmyk}{0,0.77,0.87,0}
359 \DefineNamedColor{named}{Mahogany}      {cmyk}{0,0.85,0.87,0.35}
360 \DefineNamedColor{named}{Maroon}        {cmyk}{0,0.87,0.68,0.32}
361 \DefineNamedColor{named}{BrickRed}      {cmyk}{0,0.89,0.94,0.28}
362 \DefineNamedColor{named}{Red}           {cmyk}{0,1,1,0}
363 \DefineNamedColor{named}{OrangeRed}     {cmyk}{0,1,0.50,0}
364 \DefineNamedColor{named}{RubineRed}     {cmyk}{0,1,0.13,0}
365 \DefineNamedColor{named}{WildStrawberry}{cmyk}{0,0.96,0.39,0}
366 \DefineNamedColor{named}{Salmon}        {cmyk}{0,0.53,0.38,0}
367 \DefineNamedColor{named}{CarnationPink} {cmyk}{0,0.63,0,0}
368 \DefineNamedColor{named}{Magenta}       {cmyk}{0,1,0,0}
369 \DefineNamedColor{named}{VioletRed}     {cmyk}{0,0.81,0,0}
370 \DefineNamedColor{named}{Rhodamine}     {cmyk}{0,0.82,0,0}
371 \DefineNamedColor{named}{Mulberry}      {cmyk}{0.34,0.90,0,0.02}
372 \DefineNamedColor{named}{RedViolet}     {cmyk}{0.07,0.90,0,0.34}
373 \DefineNamedColor{named}{Fuchsia}       {cmyk}{0.47,0.91,0,0.08}
374 \DefineNamedColor{named}{Lavender}      {cmyk}{0,0.48,0,0}
375 \DefineNamedColor{named}{Thistle}       {cmyk}{0.12,0.59,0,0}
376 \DefineNamedColor{named}{Orchid}        {cmyk}{0.32,0.64,0,0}
377 \DefineNamedColor{named}{DarkOrchid}    {cmyk}{0.40,0.80,0.20,0}
378 \DefineNamedColor{named}{Purple}        {cmyk}{0.45,0.86,0,0}
379 \DefineNamedColor{named}{Plum}          {cmyk}{0.50,1,0,0}
380 \DefineNamedColor{named}{Violet}        {cmyk}{0.79,0.88,0,0}
381 \DefineNamedColor{named}{RoyalPurple}   {cmyk}{0.75,0.90,0,0}
382 \DefineNamedColor{named}{BlueViolet}    {cmyk}{0.86,0.91,0,0.04}
383 \DefineNamedColor{named}{Periwinkle}    {cmyk}{0.57,0.55,0,0}
384 \DefineNamedColor{named}{CadetBlue}     {cmyk}{0.62,0.57,0.23,0}
385 \DefineNamedColor{named}{CornflowerBlue}{cmyk}{0.65,0.13,0,0}
386 \DefineNamedColor{named}{MidnightBlue}  {cmyk}{0.98,0.13,0,0.43}
387 \DefineNamedColor{named}{NavyBlue}      {cmyk}{0.94,0.54,0,0}
388 \DefineNamedColor{named}{RoyalBlue}     {cmyk}{1,0.50,0,0}
389 \DefineNamedColor{named}{Blue}          {cmyk}{1,1,0,0}
390 \DefineNamedColor{named}{Cerulean}      {cmyk}{0.94,0.11,0,0}
391 \DefineNamedColor{named}{Cyan}          {cmyk}{1,0,0,0}
392 \DefineNamedColor{named}{ProcessBlue}   {cmyk}{0.96,0,0,0}
393 \DefineNamedColor{named}{SkyBlue}       {cmyk}{0.62,0,0.12,0}
394 \DefineNamedColor{named}{Turquoise}     {cmyk}{0.85,0,0.20,0}
395 \DefineNamedColor{named}{TealBlue}      {cmyk}{0.86,0,0.34,0.02}
396 \DefineNamedColor{named}{Aquamarine}    {cmyk}{0.82,0,0.30,0}
397 \DefineNamedColor{named}{BlueGreen}     {cmyk}{0.85,0,0.33,0}
398 \DefineNamedColor{named}{Emerald}       {cmyk}{1,0,0.50,0}
399 \DefineNamedColor{named}{JungleGreen}   {cmyk}{0.99,0,0.52,0}
400 \DefineNamedColor{named}{SeaGreen}      {cmyk}{0.69,0,0.50,0}
401 \DefineNamedColor{named}{Green}         {cmyk}{1,0,1,0}
402 \DefineNamedColor{named}{ForestGreen}   {cmyk}{0.91,0,0.88,0.12}
403 \DefineNamedColor{named}{PineGreen}     {cmyk}{0.92,0,0.59,0.25}
404 \DefineNamedColor{named}{LimeGreen}     {cmyk}{0.50,0,1,0}
405 \DefineNamedColor{named}{YellowGreen}   {cmyk}{0.44,0,0.74,0}
406 \DefineNamedColor{named}{SpringGreen}   {cmyk}{0.26,0,0.76,0}
407 \DefineNamedColor{named}{OliveGreen}    {cmyk}{0.64,0,0.95,0.40}
408 \DefineNamedColor{named}{RawSienna}     {cmyk}{0,0.72,1,0.45}
409 \DefineNamedColor{named}{Sepia}         {cmyk}{0,0.83,1,0.70}
410 \DefineNamedColor{named}{Brown}         {cmyk}{0,0.81,1,0.60}
411 \DefineNamedColor{named}{Tan}           {cmyk}{0.14,0.42,0.56,0}
412 \DefineNamedColor{named}{Gray}          {cmyk}{0,0,0,0.50}
413 \DefineNamedColor{named}{Black}         {cmyk}{0,0,0,1}
414 \DefineNamedColor{named}{White}         {cmyk}{0,0,0,0}
415 %</dvipsnames>
416 %    \end{macrocode}
418 % \section{dvips}
419 % A \LaTeXe\ graphics driver file for Tom Rokicki's \emph{dvips}
420 % driver; tested with version 5.58f.
422 %    \begin{macrocode}
423 %<*dvips>
424 %    \end{macrocode}
426 % \subsection{Colour}
427 % Uses the generic `color1' code.
429 % \subsection{File inclusion}
431 % \begin{macro}{\Ginclude@eps}
432 %  |#1| input file (or command)
433 %    \begin{macrocode}
434 \def\Ginclude@eps#1{%
435  \message{<#1>}%
436   \bgroup
437 %    \end{macrocode}
438 % \emph{dvips} likes to work with its own pixel resolution, so
439 % mangle the sizes slightly.
440 %    \begin{macrocode}
441   \def\@tempa{!}%
442   \dimen@\Gin@req@width
443   \dimen@ii.1bp%
444   \divide\dimen@\dimen@ii
445   \@tempdima\Gin@req@height
446   \divide\@tempdima\dimen@ii
447     \special{PSfile="#1"\space
448       llx=\Gin@llx\space
449       lly=\Gin@lly\space
450       urx=\Gin@urx\space
451       ury=\Gin@ury\space
452       \ifx\Gin@scalex\@tempa\else rwi=\number\dimen@\space\fi
453       \ifx\Gin@scaley\@tempa\else rhi=\number\@tempdima\space\fi
454       \ifGin@clip clip\fi}%
455   \egroup}
456 %    \end{macrocode}
457 %  \end{macro}
459 %  \begin{macro}{\Ginclude@bmp}
460 %  |#1| input file; if zero size is requested, the graphic will
461 % come at `natural' size.
462 %    \begin{macrocode}
463 \def\Ginclude@bmp#1{%
464   \message{<#1>}%
465   \dimen@\Gin@req@height
466   \advance\dimen@ by-\Gin@lly bp
467   \kern-\Gin@llx bp\raise\Gin@req@height\hbox{%
468    \ifdim\Gin@urx bp=\z@
469      \ifdim\Gin@ury bp=\z@
470         \special{em: graph #1}%
471      \else
472         \special{em: graph #1,\Gin@urx bp}%
473      \fi
474   \else
475         \special{em: graph #1,\Gin@urx bp,\Gin@ury bp}%
476   \fi
477  }%
479 %    \end{macrocode}
480 % \end{macro}
482 %  \begin{macro}{\Ginclude@pict}
483 %  \begin{macro}{\Ginclude@pntg}
484 %  \begin{macro}{\oztex@include}
485 % PICT/PNTG format from the Mac. Actually only currently supported by
486 % the version of dvips distributed with \OzTeX, and with the built in
487 % \OzTeX\ drivers, but put here anyway as it is not much code and
488 % increases portability between the systems as now |[dvips]| and
489 % |[oztex]| share the same back end.
490 %    \begin{macrocode}
491 \def\oztex@include#1#2{%
492  \dimen@1bp%
493  \divide\Gin@req@width\dimen@
494  \divide\Gin@req@height\dimen@
495  \special{#1=#2\space
496    \@width=\number\Gin@req@width \space
497    \@height=\number\Gin@req@height}}
498 %    \end{macrocode}
500 %    \begin{macrocode}
501 \def\Ginclude@pntg{\oztex@include{pntg}}
502 \def\Ginclude@pict{\oztex@include{pict}}
503 %    \end{macrocode}
504 % \end{macro}
505 % \end{macro}
506 % \end{macro}
508 % \subsection{Rotation}
509 %    \begin{macrocode}
510 \def\Grot@start{%
511  \special{ps: gsave currentpoint
512  currentpoint translate \Grot@angle\space neg
513  rotate neg exch neg exch translate}}
514 \def\Grot@end{\special{ps: currentpoint grestore moveto}}
515 %    \end{macrocode}
516 % \subsection{Scaling}
517 %    \begin{macrocode}
518 \def\Gscale@start{\special{ps:  currentpoint currentpoint translate
519   \Gscale@x\space \Gscale@y\space scale neg exch neg exch translate}}
520 \def\Gscale@end{\special{ps:  currentpoint currentpoint translate
521   1 \Gscale@x\space div 1 \Gscale@y\space div scale
522   neg exch neg exch translate}}
523 %    \end{macrocode}
525 % \section{Literal Postscript}
527 % Raw PostScript code, no save/restore.
528 %    \begin{macrocode}
529 \def\Gin@PS@raw#1{\special{ps: #1}}
530 %    \end{macrocode}
532 % PostScript code, to be surrounded by save/restore by the driver.
533 % Coordinate system standard PostScript, but with origin
534 % at current (\TeX) position.
535 %    \begin{macrocode}
536 \def\Gin@PS@restored#1{\special{" #1}}
537 %    \end{macrocode}
539 % PostScript code to be inserted in the Header section of the final
540 % PostScript. Must be issued on the first page of a document.
541 %    \begin{macrocode}
542 \def\Gin@PS@literal@header#1{\AtBeginDvi{\special{! #1}}}
543 %    \end{macrocode}
545 % Name of external file, the contents of which are to be inserted in
546 % the Header section of the final PostScript. Must be issued on the
547 % first page of a document.
548 %    \begin{macrocode}
549 \def\Gin@PS@file@header#1{\AtBeginDvi{\special{header=#1}}}
550 %    \end{macrocode}
552 %    \begin{macrocode}
553 %</dvips>
554 %    \end{macrocode}
557 % \section{dvipdf}
558 % A \LaTeXe\ graphics driver file for  \emph{dvipdf} driver.
560 %    \begin{macrocode}
561 %<*dvipdf>
562 %    \end{macrocode}
564 % \subsection{Colour}
565 % Uses the generic `color1' code.
567 % \subsection{File inclusion}
569 % \begin{macro}{\Ginclude@eps}
570 %  |#1| input file (or command)
571 %    \begin{macrocode}
572 \def\Ginclude@eps#1{%
573  \message{<#1>}%
574   \bgroup
575 %    \end{macrocode}
576 % \emph{dvips} likes to work with its own pixel resolution, so
577 % mangle the sizes slightly.
578 %    \begin{macrocode}
579   \def\@tempa{!}%
580   \dimen@\Gin@req@width
581   \dimen@ii.1bp%
582   \divide\dimen@\dimen@ii
583   \@tempdima\Gin@req@height
584   \divide\@tempdima\dimen@ii
585     \special{PSfile="#1"\space
586       llx=\Gin@llx\space
587       lly=\Gin@lly\space
588       urx=\Gin@urx\space
589       ury=\Gin@ury\space
590       \ifx\Gin@scalex\@tempa\else rwi=\number\dimen@\space\fi
591       \ifx\Gin@scaley\@tempa\else rhi=\number\@tempdima\space\fi
592       \ifGin@clip clip\fi}%
593   \egroup}
594 %    \end{macrocode}
595 %  \end{macro}
597 %  \begin{macro}{\Ginclude@bmp}
598 %  |#1| input file; if zero size is requested, the graphic will
599 % come at `natural' size.
600 %    \begin{macrocode}
601 \def\Ginclude@bmp#1{%
602   \message{<#1>}%
603   \dimen@\Gin@req@height
604   \advance\dimen@ by-\Gin@lly bp
605   \kern-\Gin@llx bp\raise\Gin@req@height\hbox{%
606    \ifdim\Gin@urx bp=\z@
607      \ifdim\Gin@ury bp=\z@
608         \special{pdf: /GRAPH  #1}%
609      \else
610         \special{pdf: /GRAPH  #1 \number\Gin@req@width sp}%
611      \fi
612   \else
613         \special{pdf: /GRAPH  #1 \number\Gin@req@width sp
614                                \number\Gin@req@height sp}%
615   \fi}}
616 %    \end{macrocode}
617 % \end{macro}
619 % \subsection{Rotation}
620 %    \begin{macrocode}
621 \def\Grot@start{%
622 \special{pdf: /ROT \Grot@angle\space << }}
623 \def\Grot@end{\special{pdf: /ROT >> }}
624 %    \end{macrocode}
626 % \subsection{Scaling}
627 %    \begin{macrocode}
628 \def\Gscale@start{\special{pdf: /S \Gscale@x\space \Gscale@y\space << }}
629 \def\Gscale@end{\special{pdf: /S \space >> }}
630 %    \end{macrocode}
632 % \section{Literal Postscript}
634 % Raw PostScript code, no save/restore.
635 %    \begin{macrocode}
636 \def\Gin@PS@raw#1{\special{ps: #1}}
637 %    \end{macrocode}
639 % PostScript code, to be surrounded by save/restore by the driver.
640 % Coordinate system standard PostScript, but with origin
641 % at current (\TeX) position.
642 %    \begin{macrocode}
643 \def\Gin@PS@restored#1{\special{" #1}}
644 %    \end{macrocode}
646 % PostScript code to be inserted in the Header section of the final
647 % PostScript. Must be issued on the first page of a document.
648 %    \begin{macrocode}
649 \def\Gin@PS@literal@header#1{\AtBeginDvi{\special{! #1}}}
650 %    \end{macrocode}
652 % Name of external file, the contents of which are to be inserted in
653 % the Header section of the final PostScript. Must be issued on the
654 % first page of a document.
655 %    \begin{macrocode}
656 \def\Gin@PS@file@header#1{\AtBeginDvi{\special{header=#1}}}
657 %    \end{macrocode}
659 % \subsection{File extensions}
661 %    \begin{macrocode}
662 \@namedef{Gin@rule@.msp}#1{{bmp}{.bb}{#1}}
663 \@namedef{Gin@rule@.jpg}#1{{bmp}{.bb}{#1}}
664 \@namedef{Gin@rule@.bmp}#1{{bmp}{.bb}{#1}}
665 %    \end{macrocode}
667 %    \begin{macrocode}
668 %</dvipdf>
669 %    \end{macrocode}
671 % \section{\OzTeX}
673 % A \LaTeXe\ graphics driver file for  \OzTeX\
674 % (versions 1.42 and later),
675 % by Andrew Trevorrow.
676 %    \begin{macrocode}
677 %<*oztex>
678 %    \end{macrocode}
679 %\subsection{Graphics inclusion}
680 %    \begin{macrocode}
681 \def\Ginclude@eps{\Oztex@Include{epsf}}
682 \def\Ginclude@pntg{\Oztex@Include{pntg}}
683 \def\Ginclude@pict{\Oztex@Include{pict}}
684 \def\Oztex@Include#1#2{%
685  \ifGin@clip
686   \typeout{No clipping support in OzTeX}%
687  \fi
688  \divide\Gin@req@width by 65781% convert sp to bp
689  \divide\Gin@req@height by 65781%
690  \special{#1=#2\space
691   width=\number\Gin@req@width \space
692   height=\number\Gin@req@height
693  }%
695 %</oztex>
696 %    \end{macrocode}
697 %\section{Textures}
698 % A \LaTeXe\ graphics driver file for Blue Sky's Textures
700 % \textbf{WARNING! There is ongoing work to produce a new version of
701 % the textures support. Do not rely on anything in this file being in
702 % the next version!}
705 %    \begin{macrocode}
706 %<*textures>
707 %    \end{macrocode}
708 % \subsection{Graphics inclusion}
711 %    \begin{macrocode}
712 \PackageInfo{graphics/color}
713   {This file uses the advanced color support\MessageBreak
714    available in textures1.7\MessageBreak
715    If you are using color with an earlier version\MessageBreak
716    of textures, edit graphics.ins where marked,\MessageBreak
717    and re-latex graphics.ins.\MessageBreak\MessageBreak
718    If you are using textures1.7\MessageBreak
719    you may want to delete this warning\MessageBreak
720    from textures.def.\MessageBreak\MessageBreak
721    The code for scaling/rotation and file inclusion\MessageBreak
722    in this file is still rudimentary, and does not\MessageBreak
723    use textures' full capabilities.\MessageBreak\MessageBreak
724    A new textures.def is currently being developed\@gobble}
725 %    \end{macrocode}
728 %    \begin{macrocode}
729 \def\Ginclude@eps{\Textures@Include{illustration}}
730 \def\Ginclude@pict{\Textures@Include{pictfile}}
731 \def\Textures@Include#1#2{%
732  \def\@tempa{!}%
733  \ifx\Gin@scaley\@tempa
734      \let\Gin@scaley\Gin@scalex
735  \else
736     \ifx\Gin@scalex\@tempa\let\Gin@scalex\Gin@scaley\fi
737  \fi
738  \setlength\@tempdima{\Gin@scalex pt}%
739  \setlength\@tempdimb{\Gin@scaley pt}%
740  \ifdim\@tempdima>\@tempdimb
741     \let\Gin@scalex\Gin@scaley
742  \fi
743  \ifGin@clip
744   \typeout{no clipping support in Textures}%
745  \fi
746  \@tempdimb=1000sp%
747  \setlength\@tempdima{\Gin@scalex\@tempdimb}%
748  \special{#1 #2\space scaled \number\@tempdima}%
750 %    \end{macrocode}
751 % \subsection{Rotation}
752 % This code was written when no unprotected postscript code was allowed;
753 % it could almost certainly be rewritten now with `rawpostscript'.
754 %    \begin{macrocode}
755 \def\Grot@start{\special{postscript
756   0 0 transform
757   grestore
758   matrix currentmatrix
759   3 1 roll
760   itransform
761   dup 3 -1 roll
762   dup 4 1 roll exch
763   translate
764   \Grot@angle\space neg rotate
765   neg exch neg exch translate
766   gsave}}
767 \def\Grot@end{\special{postscript grestore  setmatrix  gsave}}
768 %    \end{macrocode}
769 % \subsection{Colour}
770 % This will only work for versions 1.6 and Version 1.7 uses `color2'.
771 %    \begin{macrocode}
772 %<color3>\def\Gin@PS@raw#1{\special{rawpostscript #1}}
773 %</textures>
774 %    \end{macrocode}
776 % \section{dvialw}
777 % A \LaTeXe\ graphics driver file for dvialw, by Nelson Beebe
778 %    \begin{macrocode}
779 %<*dvialw>
780 %    \end{macrocode}
781 % \subsection{Rotation}
782 %    \begin{macrocode}
783 \def\Ginclude@eps#1{%
784    \def\@tempa{!}%
785    \ifx\Gin@scaley\@tempa
786      \let\Gin@scaley\Gin@scalex
787    \else
788     \ifx\Gin@scalex\@tempa\let\Gin@scalex\Gin@scaley\fi
789    \fi
790    \ifGin@clip
791     \typeout{no clipping support in dvialw}%
792    \fi
793    \special{language "PS",
794       literal "\Gin@scalex\space
795         \Gin@scaley\space scale",
796       position = "bottom left",
797       include "#1\space"}%
799 %</dvialw>
800 %    \end{macrocode}
801 % \section{emtex}
802 % A \LaTeXe\ graphics driver file for Eberhard Mattes' emTeX
803 %    \begin{macrocode}
804 %<*emtex>
805 %    \end{macrocode}
806 % \subsection{Graphics file inclusion}
807 %    \begin{macrocode}
808 \def\Ginclude@bmp#1{%
809   \raise\Gin@req@height\hbox{\special{em:graph #1}}%
810 \typeout{WARNING: emtex does not permit graphics to be scaled}%
812 %</emtex>
813 %    \end{macrocode}
814 % \section{dvilaser/ps}
815 % A \LaTeXe\ graphics driver file for Arbortext's dvilaser/ps
816 %    \begin{macrocode}
817 %<*dvilaser>
818 %    \end{macrocode}
819 %\subsection{Graphic file inclusion}
820 %    \begin{macrocode}
821 \def\Ginclude@eps#1{%
822 \ifGin@clip
823   \typeout{no clipping support in dvilaser/ps}%
825 \special{ps: epsfile #1\space \the\Gin@req@width}%
827 %</dvilaser>
828 %    \end{macrocode}
829 % \section{psprint}
830 % A \LaTeXe\ graphics driver file for Trevorrow's psprint
831 %    \begin{macrocode}
832 %<*psprint>
833 %    \end{macrocode}
834 %\subsection{Graphic file inclusion}
835 %    \begin{macrocode}
836 \def\Ginclude@eps#1{%
837    \def\@tempa{!}%
838    \ifx\Gin@scaley\@tempa
839      \let\Gin@scaley\Gin@scalex
840    \else
841      \ifx\Gin@scalex\@tempa\let\Gin@scalex\Gin@scaley\fi
842    \fi
843    \ifGin@clip
844      \typeout{no clipping support in psprint}%
845    \fi
846    \special{#1\space
847        \Gin@scalex\space \Gin@scaley\space scale
848        \Gin@llx\space neg
849        \Gin@lly \space neg translate
852 %</psprint>
853 %    \end{macrocode}
854 % \section{dvipsone}
856 % A \LaTeXe\ graphics driver file for Y\&Y's dvipsone
857 %    \begin{macrocode}
858 %<*dvipsone>
859 %    \end{macrocode}
861 % \subsection{Graphic file inclusion}
863 % PostScript Files.
864 %    \begin{macrocode}
865 \def\Ginclude@eps#1{%
866  \message{<#1>}%
867   \bgroup
868   \def\@tempa{!}%
869   \dimen@\Gin@req@width
870   \dimen@ii.1bp%
871   \divide\dimen@\dimen@ii
872   \@tempdima\Gin@req@height
873   \divide\@tempdima\dimen@ii
874     \special{PSfile="#1"\space
875       llx=\Gin@llx\space
876       lly=\Gin@lly\space
877       urx=\Gin@urx\space
878       ury=\Gin@ury\space
879       \ifx\Gin@scalex\@tempa\else rwi=\number\dimen@\space\fi
880       \ifx\Gin@scaley\@tempa\else rhi=\number\@tempdima\space\fi
881       \ifGin@clip clip\fi}%
882   \egroup}
883 %    \end{macrocode}
885 % Tiff files.
886 %    \begin{macrocode}
887 \def\Ginclude@tiff#1{%
888 \message{<#1>}%
889  \special{insertimage: #1 \number\Gin@req@width\space
890      \number\Gin@req@height}}
891 %    \end{macrocode}
893 % Windows Metafiles.
894 %    \begin{macrocode}
895 \def\Ginclude@wmf#1{%
896   \message{<#1>}%
897   \special{insertmf: #1 0 0 \number\Gin@req@width\space
898        \number\Gin@req@height}}
899 %    \end{macrocode}
901 %    \begin{macrocode}
902 %    \end{macrocode}
904 %    \begin{macrocode}
905 \def\Gin@PS@raw#1{\special{ps: #1}}
906 %    \end{macrocode}
908 % \subsection{Rotation}
909 %    \begin{macrocode}
910 \def\Grot@start{%
911  \special{ps: gsave currentpoint
912  currentpoint translate \Grot@angle\space
913  rotate neg exch neg exch translate}}
914 \def\Grot@end{%
915   \special{ps: currentfont currentpoint grestore moveto setfont}}
916 %    \end{macrocode}
918 % \subsection{Scaling}
919 %    \begin{macrocode}
920 \def\Gscale@start{\special{ps:  currentpoint currentpoint translate
921   \Gscale@x\space \Gscale@y\space scale neg exch neg exch translate}}
922 \def\Gscale@end{\special{ps:  currentpoint currentpoint translate
923   1 \Gscale@x\space div 1 \Gscale@y\space div scale
924   neg exch neg exch translate}}
925 %    \end{macrocode}
927 % \subsection{File Extensions}
929 %    \begin{macrocode}
930 \@namedef{Gin@rule@.wmf}#1{{wmf}{}{#1}}
931 \@namedef{Gin@rule@.clp}#1{{wmf}{}{#1}}
932 %    \end{macrocode}
934 % \section{Literal Postscript}
936 % Raw PostScript code, no save/restore.
937 %    \begin{macrocode}
938 \def\Gin@PS@raw#1{\special{ps: #1}}
939 %    \end{macrocode}
941 % PostScript code, to be surrounded by save/restore by the driver.
942 % Coordinate system standard PostScript, but with origin
943 % at current (\TeX) position.
944 %    \begin{macrocode}
945 \def\Gin@PS@restored#1{\special{" #1}}
946 %    \end{macrocode}
948 % PostScript code to be inserted in the Header section of the final
949 % PostScript. Must be issued on the first page of a document.
950 %    \begin{macrocode}
951 \def\Gin@PS@literal@header#1{\AtBeginDvi{\special{headertext=#1}}}
952 %    \end{macrocode}
954 % Name of external file, the contents of which are to be inserted in
955 % the Header section of the final PostScript. Must be issued on the
956 % first page of a document.
957 %    \begin{macrocode}
958 \def\Gin@PS@file@header#1{\AtBeginDvi{\special{header=#1}}}
959 %    \end{macrocode}
961 %    \begin{macrocode}
962 %</dvipsone>
963 %    \end{macrocode}
965 % \section{dviwindo}
966 % A \LaTeXe\ graphics driver file for Y\&Y's dviwindo.
968 % This driver now uses the same file as |dvipsone|.
970 % \section{dvitops}
971 % A \LaTeXe\ graphics driver file for James Clark's dvitops
972 %    \begin{macrocode}
973 %<*dvitops>
974 %    \end{macrocode}
975 % \subsection{Rotation}
976 %    \begin{macrocode}
977 \newcount\Grot@count
978 \Grot@count=\@ne
979 \def\Grot@start{\special{dvitops: origin
980     rot\the\@tempdima}%
981 \special{dvitops: begin rot\the\Grot@count}}%
982 \def\Grot@end{\special{dvitops: end}%
983 \special{dvitops: rotate rot\the\Grot@count \space
984     \Grot@angle}%
985 \global\advance\Grot@count by\@ne}%
986 %    \end{macrocode}
987 % \subsection{Graphic file inclusion}
988 %    \begin{macrocode}
989 \def\Ginclude@eps#1{%
990 % These cause an arithmetic overflow, so I've commented them
991 % out. Presumably they were there for some reason.
992 % Any dvitops users out there??
993 % \multiply\Gin@req@width by \@m
994 % \multiply\Gin@req@height by \@m
995 \ifGin@clip
996   \typeout{no clipping support in dvitops}%
998 \special{import #1\space \the\Gin@req@width\space
999                          \the\Gin@req@height\space fill}}
1000 %    \end{macrocode}
1002 %    \begin{macrocode}
1003 %</dvitops>
1004 %    \end{macrocode}
1006 %\section{dvi2ps}
1007 % A \LaTeXe\ graphics driver file for original dvi2ps
1008 %    \begin{macrocode}
1009 %<*dvi2ps>
1010 %    \end{macrocode}
1012 % \subsection{Graphic file inclusion}
1013 %    \begin{macrocode}
1014 \def\Ginclude@eps#1{%
1015    \def\@tempa{!}%
1016    \ifx\Gin@scaley\@tempa
1017      \let\Gin@scaley\Gin@scalex
1018    \else
1019     \ifx\Gin@scalex\@tempa\let\Gin@scalex\Gin@scaley\fi
1020    \fi
1021    \ifGin@clip
1022      \typeout{no clipping support in dvi2ps}%
1023    \fi
1024    \special{psfile=#1\space
1025         hscale=\Gin@scalex\space 1000 mul
1026         vscale=\Gin@scaley\space 1000 mul}}
1027 %    \end{macrocode}
1029 %    \begin{macrocode}
1030 %</dvi2ps>
1031 %    \end{macrocode}
1033 % \section{pctexps}
1034 % A \LaTeXe\ graphics driver file for Personal TeX's PTI Laser/PS;
1035 % from information supplied by Lance Carnes and Tao Wang
1036 % |<pti@crl.com>|.
1037 %    \begin{macrocode}
1038 %<*pctexps>
1039 %    \end{macrocode}
1041 % \subsection{Graphic file inclusion}
1043 %    \begin{macrocode}
1044 \def\Ginclude@eps#1{%
1045 \message{<#1>}%
1046    \ifGin@clip
1047      \typeout{no clipping support in pctexps}%
1048    \fi
1049    \Gin@req@width.03515\Gin@req@width
1050    \Gin@req@height.03515\Gin@req@height
1051    \special{ps:#1\space x=\strip@pt\Gin@req@width cm,
1052                         y=\strip@pt\Gin@req@height cm}}
1053 %    \end{macrocode}
1055 %    \begin{macrocode}
1056 \def\Ginclude@ps#1{%
1057 \message{<#1>}%
1058   \ifGin@clip
1059     \typeout{no clipping support in pctexps}%
1060   \fi
1061   \hbox{\kern-\Gin@llx bp\raise-\Gin@lly bp\hbox{\special{ps:#1}}}%
1062   \typeout{^^J%
1063 ---------------------------------------------------------^^J%
1064 .ps graphics without bounding box information cannot be^^J%
1065 scaled.  If the file actually contains the information,^^J%
1066 please rename the file to .eps file extension.^^J%
1067 ---------------------------------------------------------^^J}}
1068 %    \end{macrocode}
1070 %    \begin{macrocode}
1071 \def\Gin@extensions{.eps,.ps}
1072 \@namedef{Gin@rule@.ps}#1{{ps}{.ps}{#1}}
1073 \@namedef{Gin@rule@.eps}#1{{eps}{.eps}{#1}}
1074 %    \end{macrocode}
1076 %    \begin{macrocode}
1077 \def\Gin@PS@raw#1{\special{ps::#1}}
1078 \def\Grot@start{%
1079  \special{ps::gsave currentpoint
1080  currentpoint translate \Grot@angle\space
1081  rotate neg exch neg exch translate}}
1082 \def\Grot@end{\special{ps:: currentpoint grestore moveto}}
1083 %    \end{macrocode}
1085 %    \begin{macrocode}
1086 \def\Gscale@start{\special{ps:: currentpoint currentpoint translate
1087   \Gscale@x\space \Gscale@y\space scale neg exch neg exch translate}}
1088 \def\Gscale@end{\special{ps::  currentpoint currentpoint translate
1089   1 \Gscale@x\space div 1 \Gscale@y\space div scale
1090   neg exch neg exch translate}}
1091 %    \end{macrocode}
1093 %    \begin{macrocode}
1094 %</pctexps>
1095 %    \end{macrocode}
1097 % \section{pctex32}
1098 % A \LaTeXe\ graphics driver file for Personal TeX's PC TeX for 32 bit
1099 % Windows; Code supplied by Tao Wang |<pti@crl.com>|.
1101 % \subsection{Colour}
1102 % Uses the generic `color1' code.
1104 %    \begin{macrocode}
1105 %<*pctex32>
1106 %    \end{macrocode}
1108 % \subsection{Graphic file inclusion}%
1109 %    \begin{macrocode}
1110 % including PostScript graphics
1111 \def\Ginclude@eps#1{%
1112  \message{<#1>}%
1113   \bgroup
1114   \def\@tempa{!}%
1115   \dimen@\Gin@req@width
1116   \dimen@ii.1bp%
1117   \divide\dimen@\dimen@ii
1118   \@tempdima\Gin@req@height
1119   \divide\@tempdima\dimen@ii
1120     \special{PSfile="#1"\space
1121       llx=\Gin@llx\space
1122       lly=\Gin@lly\space
1123       urx=\Gin@urx\space
1124       ury=\Gin@ury\space
1125       \ifx\Gin@scalex\@tempa\else rwi=\number\dimen@\space\fi
1126       \ifx\Gin@scaley\@tempa\else rhi=\number\@tempdima\space\fi
1127       \ifGin@clip clip\fi}%
1128   \egroup}
1129 %    \end{macrocode}
1131 % including BMP graphics
1132 %    \begin{macrocode}
1133 \def\Ginclude@bmp#1{%
1134 \message{<#1>}%
1135    \ifGin@clip
1136      \typeout{no clipping support for BMP graphics in PCTeX32}%
1137    \fi
1138    \Gin@req@width.03515\Gin@req@width
1139    \Gin@req@height.03515\Gin@req@height
1140    \special{bmp:#1\space x=\strip@pt\Gin@req@width cm,
1141      y=\strip@pt\Gin@req@height cm}}
1142 %    \end{macrocode}
1144 % including WMF graphics
1145 %    \begin{macrocode}
1146 \def\Ginclude@wmf#1{%
1147 \message{<#1>}%
1148    \ifGin@clip
1149      \typeout{no clipping support for WMF graphics in PCTeX32}%
1150    \fi
1151    \Gin@req@width.03515\Gin@req@width
1152    \Gin@req@height.03515\Gin@req@height
1153    \special{wmf:#1\space x=\strip@pt\Gin@req@width cm,
1154      y=\strip@pt\Gin@req@height cm}}
1155 %    \end{macrocode}
1157 % \subsection{Scaling and Rotating}
1158 % PostScript rotation and scaling
1159 %    \begin{macrocode}
1160 \def\Grot@start{%
1161  \special{ps:: gsave currentpoint
1162  currentpoint translate \Grot@angle\space neg
1163  rotate neg exch neg exch translate}}
1164 \def\Grot@end{\special{ps:: currentpoint grestore moveto}}
1165 \def\Gscale@start{\special{ps::  currentpoint currentpoint translate
1166   \Gscale@x\space \Gscale@y\space scale neg exch neg exch translate}}
1167 \def\Gscale@end{\special{ps::  currentpoint currentpoint translate
1168   1 \Gscale@x\space div 1 \Gscale@y\space div scale
1169   neg exch neg exch translate}}
1170 %    \end{macrocode}
1172 %    \begin{macrocode}
1173 \def\Gin@PS@raw#1{\special{ps:: #1}}
1174 \def\Gin@PS@restored#1{\special{" #1}}
1175 %    \end{macrocode}
1177 % \subsection{Default Extensions}
1179 %    \begin{macrocode}
1180 \def\Gin@extensions{.eps,.ps,.wmf,.bmp}
1181 \@namedef{Gin@rule@.ps}#1{{eps}{.ps}{#1}}
1182 \@namedef{Gin@rule@.eps}#1{{eps}{.eps}{#1}}
1183 \@namedef{Gin@rule@.bmp}#1{{bmp}{}{#1}}
1184 \@namedef{Gin@rule@.wmf}#1{{wmf}{}{#1}}
1185 %    \end{macrocode}
1187 %    \begin{macrocode}
1188 %</pctex32>
1189 %    \end{macrocode}
1191 % \section{pctexwin}
1192 % A \LaTeXe\ graphics driver file for Personal TeX's PC TeX for Windows;
1193 % from information supplied by Lance Carnes and Tao Wang
1194 % |<pti@crl.com>|.
1195 %    \begin{macrocode}
1196 %<*pctexwin>
1197 %    \end{macrocode}
1199 % \subsection{Graphic file inclusion}
1201 %    \begin{macrocode}
1202 \def\Ginclude@eps#1{%
1203 \message{<#1>}%
1204    \ifGin@clip
1205      \typeout{no clipping support in pctexwin}%
1206    \fi
1207    \Gin@req@width.03515\Gin@req@width
1208    \Gin@req@height.03515\Gin@req@height
1209    \special{eps:#1\space x=\strip@pt\Gin@req@width cm,
1210                          y=\strip@pt\Gin@req@height cm}}
1211 %    \end{macrocode}
1213 %    \begin{macrocode}
1214 \def\Ginclude@ps#1{%
1215 \message{<#1>}%
1216   \ifGin@clip
1217     \typeout{no clipping support in pctexwin}%
1218   \fi
1219   \hbox{\kern-\Gin@llx bp\raise-\Gin@lly bp\hbox{\special{ps:#1}}}%
1220   \typeout{^^J%
1221 ---------------------------------------------------------^^J%
1222 .ps graphics without bounding box information cannot be^^J%
1223 scaled.  If the file actually contains the information,^^J%
1224 please rename the file to .eps file extension.^^J%
1225 ---------------------------------------------------------^^J%
1227 %    \end{macrocode}
1229 %    \begin{macrocode}
1230 \def\Ginclude@bmp#1{%
1231 \message{<#1>}%
1232    \ifGin@clip
1233      \typeout{no clipping support in pctexwin}%
1234    \fi
1235    \Gin@req@width.03515\Gin@req@width
1236    \Gin@req@height.03515\Gin@req@height
1237    \special{bmp:#1\space x=\strip@pt\Gin@req@width cm,
1238                          y=\strip@pt\Gin@req@height cm}}
1239 %    \end{macrocode}
1241 %    \begin{macrocode}
1242 \def\Ginclude@wmf#1{%
1243 \message{<#1>}%
1244    \ifGin@clip
1245      \typeout{no clipping support in pctexwin}%
1246    \fi
1247    \Gin@req@width.03515\Gin@req@width
1248    \Gin@req@height.03515\Gin@req@height
1249    \special{wmf:#1\space x=\strip@pt\Gin@req@width cm,
1250                          y=\strip@pt\Gin@req@height cm}}
1251 %    \end{macrocode}
1253 %    \begin{macrocode}
1254 \def\Gin@extensions{.eps,.ps,.wmf,.bmp}
1255 \@namedef{Gin@rule@.bmp}#1{{bmp}{}{#1}}
1256 \@namedef{Gin@rule@.wmf}#1{{wmf}{}{#1}}
1257 \@namedef{Gin@rule@.ps}#1{{ps}{.ps}{#1}}
1258 \@namedef{Gin@rule@.eps}#1{{eps}{.eps}{#1}}
1259 %    \end{macrocode}
1261 %    \begin{macrocode}
1262 %</pctexwin>
1263 %    \end{macrocode}
1265 % \section{pctexhp}
1266 % A \LaTeXe\ graphics driver file for Personal TeX's PTI Laser/HP;
1267 % from information supplied by Lance Carnes and Tao Wang
1268 % |<pti@crl.com>|.
1269 %    \begin{macrocode}
1270 %<*pctexhp>
1271 %    \end{macrocode}
1272 % \subsection{Graphic file inclusion}
1273 %    \begin{macrocode}
1274 \def\Ginclude@pcl#1{%
1275 \message{<#1>}%
1276    \ifGin@clip
1277      \typeout{no clipping support in pctexhp}%
1278    \fi
1279    \hbox{\kern-\Gin@llx bp\raise-\Gin@lly bp\hbox{\special{pcl:#1}}}%
1280    \typeout{WARNING: pctexhp does not permit graphics to be scaled}}
1281 \@namedef{Gin@rule@.pcl}#1{{pcl}{}{#1}}
1282 \def\Gin@extensions{.pcl}
1283 %</pctexhp>
1284 %    \end{macrocode}
1286 % \section{pubps}
1287 % A \LaTeXe\ graphics driver file for Arbortext's PUBps;
1288 % information from Peter R Wilson |pwilson@rdrc.rpi.edu|.
1289 %    \begin{macrocode}
1290 %<*pubps>
1291 %    \end{macrocode}
1292 % \subsection{Rotation}
1293 %    \begin{macrocode}
1294 \def\Grot@start{\special{ps: gsave currentpoint
1295         currentpoint translate \Grot@angle\space
1296         rotate  neg exch neg exch translate}}
1297 \def\Grot@end{\special{ps: currentpoint grestore moveto}}
1298 %</pubps>
1299 %    \end{macrocode}
1301 % \section{dviwin}
1302 % A \LaTeXe\ graphics driver file for Hippocrates Sendoukas' dviwin
1303 %    \begin{macrocode}
1304 %<*dviwin>
1305 %    \end{macrocode}
1306 % \subsection{Graphic file inclusion}
1307 % Dviwin sorts out the graphics type itself based on extension.
1308 % They all use the same |\special|, so as far as graphics.sty is
1309 % concerned they are all the same `type'. Use `bmp' for the type
1310 % as that is as good a name as any. Make this the default.
1311 %    \begin{macrocode}
1312 \@namedef{Gin@rule@*}#1{{bmp}{}{#1}}
1313 \def\Ginclude@bmp#1{%
1314   \raise\Gin@req@height\hbox{%
1315    \special{anisoscale #1,
1316    \the\Gin@req@width\space \the\Gin@req@height}}}
1317 %    \end{macrocode}
1318 % The only exception is EPS files, as they may be read for BoundingBox
1319 %    \begin{macrocode}
1320 \@namedef{Gin@rule@.ps}#1{{eps}{.ps}{#1}}
1321 \@namedef{Gin@rule@.eps}#1{{eps}{.eps}{#1}}
1322 \let\Ginclude@eps\Ginclude@bmp
1323 %    \end{macrocode}
1324 % Add a few default extensions so |\includegraphics{a}|
1325 % will pick up |a.eps| or |a.wmf|.
1326 % This list can be reset with |\DeclareGraphicsExtensions|.
1327 % Other extensions not in the list may be used explicitly, eg
1328 % |\includegraphics{a.gif}| should work as long as dviwin has access
1329 % to a gif filter. If |.gif| is added using |\DeclareGraphicsExtensions|
1330 % then  |\includegraphics{a}| would also find |a.gif|.
1331 %    \begin{macrocode}
1332 \def\Gin@extensions{.eps,.ps,.wmf,.tif}
1333 %    \end{macrocode}
1335 %    \begin{macrocode}
1336 %</dviwin>
1337 %    \end{macrocode}
1339 % \section{ln}
1340 % A \LaTeXe\ graphics driver file for B Hamilton Kelly's ln03 driver.
1341 % Untested, but based on the graphics macros distributed with the
1342 % driver.
1343 %    \begin{macrocode}
1344 %<*ln>
1345 %    \end{macrocode}
1346 % \subsection{Graphic file inclusion}
1347 %    \begin{macrocode}
1348 \def\Ginclude@sixel#1{\special{ln03:sixel #1}}
1349 %</ln>
1350 %    \end{macrocode}
1352 % \section{truetex}
1353 % A \LaTeXe\ graphics driver file for Kinch `truetex' driver.
1354 %    \begin{macrocode}
1355 %<*truetex>
1356 %    \end{macrocode}
1358 % \subsection{Colour}
1359 % Uses the `color4' colour code.
1361 % \subsection{Graphic file inclusion}
1363 %  EPS File inclusion: DVIPS style.
1364 %    \begin{macrocode}
1365 \def\Ginclude@eps#1{%
1366  \message{<#1>}%
1367   \bgroup
1368   \def\@tempa{!}%
1369   \dimen@\Gin@req@width
1370   \dimen@ii.1bp%
1371   \divide\dimen@\dimen@ii
1372   \@tempdima\Gin@req@height
1373   \divide\@tempdima\dimen@ii
1374     \special{PSfile="#1"\space
1375       llx=\Gin@llx\space
1376       lly=\Gin@lly\space
1377       urx=\Gin@urx\space
1378       ury=\Gin@ury\space
1379       \ifx\Gin@scalex\@tempa\else rwi=\number\dimen@\space\fi
1380       \ifx\Gin@scaley\@tempa\else rhi=\number\@tempdima\space\fi
1381       \ifGin@clip clip\fi}%
1382   \egroup}
1383 %    \end{macrocode}
1385 % bmp File Inclusion.
1386 %    \begin{macrocode}
1387 \def\Ginclude@bmp#1{%
1388  \message{<#1>}%
1389  \special{bmpfile #1}}
1390 %    \end{macrocode}
1392 % tif(f) File inclusion
1393 %    \begin{macrocode}
1394 \def\Ginclude@tiff#1{%
1395  \message{<#1>}%
1396  \special{tifffile #1}}
1397 %    \end{macrocode}
1399 % \subsection{Literal PostScript}
1400 % This is not supported, so uses `nops' code.
1402 % \subsection{Default Rules}
1403 % Support (e)ps, tif and bmp, default to eps.
1404 %    \begin{macrocode}
1405 \def\Gin@extensions{.eps,.ps}
1406 \@namedef{Gin@rule@.ps}#1{{eps}{.ps}{#1}}
1407 \@namedef{Gin@rule@.eps}#1{{eps}{.eps}{#1}}
1408 \@namedef{Gin@rule@.tif}#1{{tiff}{}{#1}}
1409 \@namedef{Gin@rule@.bmp}#1{{bmp}{}{#1}}
1410 %    \end{macrocode}
1412 %    \begin{macrocode}
1413 \@namedef{Gin@rule@*}#1{{eps}{\Gin@ext}{#1}}
1414 %    \end{macrocode}
1416 %    \begin{macrocode}
1417 %</truetex>
1418 %    \end{macrocode}
1420 % \section{tcidvi}
1421 % A \LaTeXe\ graphics driver file for Scientific Word/Workplace.
1422 % Actually for the Kinch truetex driver, augmented with extra
1423 % |\special| handling with the DLL supplied with SW.
1424 %    \begin{macrocode}
1425 %<*tcidvi>
1426 %    \end{macrocode}
1428 % \subsection{Colour}
1429 % Uses the `color4' colour code.
1431 % The above colours are handled by the Kinch-supplied dll
1432 % The TCI dll adds support for |\colorbox|, but only grey scale
1433 % The code below accepts any color model, but only the red
1434 %  component is used.
1435 %    \begin{macrocode}
1436 \AtBeginDocument{\def\color@block#1#2#3{%
1437   {\rlap{\ifcolors@
1438       \@defaultunits\count@\current@color\@nnil
1439       \dimen@\count@\p@
1440       \divide\dimen@\@cclv
1441       \dimen@ii#2%
1442       \advance\dimen@ii#3%
1443       \lower#3\hbox{%
1444       \special{language "Scientific Word";%
1445                type "greybox";%
1446                greyscale \strip@pt\dimen@;%
1447                height \the\dimen@ii;%
1448                width \the#1;%
1449                depth 0pt;}}%
1450            \fi}}}}
1451 %    \end{macrocode}
1453 % \subsection{Graphic file inclusion}
1455 %  EPS File inclusion.
1456 %    \begin{macrocode}
1457 \def\Ginclude@eps#1{%
1458  \message{<#1>}%
1459  \raise\Gin@req@height\hbox{%
1460 %    \end{macrocode}
1462 % If the bounding box has been changed by a trim or viewport
1463 % key then need to calculate the crop ratios based on the original
1464 % bb coordinates. (This assumes that clip key is also used).
1465 %    \begin{macrocode}
1466   \ifx\Gin@ollx\@undefined
1467   \else
1468     \@tempdimb \Gin@ourx bp%
1469     \advance\@tempdimb-\Gin@ollx bp%
1470     \@tempdima\Gin@llx bp%
1471     \advance\@tempdima-\Gin@ollx bp%
1472     \Gscale@div\TCI@cropleft\@tempdima\@tempdimb
1473     \@tempdima\Gin@urx bp%
1474     \advance\@tempdima-\Gin@ollx bp%
1475     \Gscale@div\TCI@cropright\@tempdima\@tempdimb
1476     \@tempdimb \Gin@oury bp%
1477     \advance\@tempdimb-\Gin@olly bp%
1478     \@tempdima\Gin@lly bp%
1479     \advance\@tempdima-\Gin@olly bp%
1480     \Gscale@div\TCI@cropbottom\@tempdima\@tempdimb
1481     \@tempdima\Gin@ury bp%
1482     \advance\@tempdima-\Gin@olly bp%
1483     \Gscale@div\TCI@croptop\@tempdima\@tempdimb
1484   \fi
1485 %    \end{macrocode}
1487 %    \begin{macrocode}
1488     \special{%
1489       language \TCI@language;%
1490       type \TCI@type;%
1491       valid_file \TCI@validfile;%
1492       width \the\Gin@req@width;%
1493       height \the\Gin@req@height;%
1494       depth 0pt;%
1495       original-width \the\Gin@nat@width;%
1496       original-height \the\Gin@nat@height;%
1497       cropleft "\TCI@cropleft";%
1498       croptop "\TCI@croptop";%
1499       cropright "\TCI@cropright";%
1500       cropbottom "\TCI@cropbottom";%
1501       filename '#1';%
1502       \ifx\TCI@temp\@empty\else tempfilename \TCI@temp;\fi
1503       }}}
1504 %    \end{macrocode}
1506 % Default values so documents produced elsewhere should work
1507 %    \begin{macrocode}
1508 \def\TCI@language{"Scientific Word"}
1509 \def\TCI@type{"GRAPHIC"}
1510 \def\TCI@validfile{'F'}
1511 \def\TCI@cropleft{0}
1512 \def\TCI@croptop{1}
1513 \def\TCI@cropright{1}
1514 \def\TCI@cropbottom{0}
1515 \let\TCI@temp\@empty
1516 %    \end{macrocode}
1518 % Non PS Graphic files.
1520 % File inclusion macro is always the same. Use a different name though
1521 % as LaTeX thinks it can read eps files for BoundingBox.
1522 %    \begin{macrocode}
1523 \let\Ginclude@bmp\Ginclude@eps
1524 %    \end{macrocode}
1526 % \subsection{Literal PostScript}
1527 % This is not supported, so uses `nops' code.
1529 % \subsection{Default Rules}
1530 % SW always gives the full name with extension.
1531 % So leave this list empty.
1532 %    \begin{macrocode}
1533 \def\Gin@extensions{}
1534 %    \end{macrocode}
1536 % .ps .PS .eps .EPS are (E)PS
1537 % rest are `bmp' which is a catch all type for anything
1538 % that the import filter can handle.
1539 %    \begin{macrocode}
1540 \@namedef{Gin@rule@.ps}#1{{eps}{.ps}{#1}}
1541 \@namedef{Gin@rule@.eps}#1{{eps}{.eps}{#1}}
1542 \@namedef{Gin@rule@.PS}#1{{eps}{.PS}{#1}}
1543 \@namedef{Gin@rule@.EPS}#1{{eps}{.EPS}{#1}}
1544 %    \end{macrocode}
1546 %    \begin{macrocode}
1547 \@namedef{Gin@rule@*}#1{{bmp}{\Gin@ext}{#1}}
1548 %    \end{macrocode}
1550 %    \begin{macrocode}
1551 %</tcidvi>
1552 %    \end{macrocode}
1554 % \section{Literal Postscript}
1555 % Most drivers writing to PostScript allow some form of `literal'
1556 % PostScript |\special| that inserts code into the final PostScript
1557 % output. However Non-PS drivers can not support this (and some PS
1558 % one's can't either). The code here makes all these commands no ops.
1559 % Individual driver sections may define the commands to do something
1560 % useful.
1562 %    \begin{macrocode}
1563 %<*nops>
1564 %    \end{macrocode}
1566 % Raw PostScript code, no save/restore. Coordinate system unspecified.
1567 %    \begin{macrocode}
1568 \def\Gin@PS@raw#1{}
1569 %    \end{macrocode}
1571 % PostScript code, to be surrounded by save/restore by the driver.
1572 % Coordinate system standard PostScript, but with origin
1573 % at current (\TeX) position.
1574 %    \begin{macrocode}
1575 \def\Gin@PS@restored#1{}
1576 %    \end{macrocode}
1578 % PostScript code to be inserted in the Header section of the final
1579 % PostScript. Must be issued on the first page of a document.
1580 %    \begin{macrocode}
1581 \def\Gin@PS@literal@header#1{}
1582 %    \end{macrocode}
1584 % Name of external file, the contents of which are to be inserted in
1585 % the Header section of the final PostScript. Must be issued on the
1586 % first page of a document.
1587 %    \begin{macrocode}
1588 \def\Gin@PS@file@header#1{}
1589 %    \end{macrocode}
1591 %    \begin{macrocode}
1592 %</nops>
1593 %    \end{macrocode}
1595 % \section{Graphics Inclusion Rules}
1596 %    \begin{macrocode}
1597 %<*psrules>
1598 %    \end{macrocode}
1600 %    \begin{macrocode}
1601 \def\Gin@extensions{.eps,.ps}
1602 %    \end{macrocode}
1604 %    \begin{macrocode}
1605 \@namedef{Gin@rule@.ps}#1{{eps}{.ps}{#1}}
1606 \@namedef{Gin@rule@.eps}#1{{eps}{.eps}{#1}}
1607 %    \end{macrocode}
1609 %    \begin{macrocode}
1610 \@namedef{Gin@rule@*}#1{{eps}{\Gin@ext}{#1}}
1611 %    \end{macrocode}
1613 %    \begin{macrocode}
1614 %</psrules>
1615 %<*psrulesZ>
1616 %    \end{macrocode}
1618 % \changes{v3.0j}{2014/04/23}
1619 %     {add .mps for metapost generated postscript to match pdftex graphics/4050}
1620 %    \begin{macrocode}
1621 \def\Gin@extensions{.eps,.ps,.eps.gz,.ps.gz,.eps.Z,.mps}
1622 %    \end{macrocode}
1624 % \changes{v3.0k}{2015/12/30}
1625 %     {compressed files don't require gunzip for dvips/xdvi}
1626 %    \begin{macrocode}
1627 \@namedef{Gin@rule@.ps}#1{{eps}{.ps}{#1}}
1628 \@namedef{Gin@rule@.eps}#1{{eps}{.eps}{#1}}
1629 \@namedef{Gin@rule@.mps}#1{{eps}{.mps}{#1}}
1630 \@namedef{Gin@rule@.pz}#1{{eps}{.bb}{#1}}
1631 \@namedef{Gin@rule@.eps.Z}#1{{eps}{.eps.bb}{#1}}
1632 \@namedef{Gin@rule@.ps.Z}#1{{eps}{.ps.bb}{#1}}
1633 \@namedef{Gin@rule@.ps.gz}#1{{eps}{.ps.bb}{#1}}
1634 \@namedef{Gin@rule@.eps.gz}#1{{eps}{.eps.bb}{#1}}
1635 %    \end{macrocode}
1637 %    \begin{macrocode}
1638 \@namedef{Gin@rule@*}#1{{eps}{\Gin@ext}{#1}}
1639 %    \end{macrocode}
1641 %    \begin{macrocode}
1642 %</psrulesZ>
1643 %<*dosrules>
1644 %    \end{macrocode}
1646 %    \begin{macrocode}
1647 %<!psrulesZ>\def\Gin@extensions{.eps,.ps,.pcx,.bmp}
1648 %    \end{macrocode}
1650 %    \begin{macrocode}
1651 \@namedef{Gin@rule@.pcx}#1{{bmp}{}{#1}}
1652 \@namedef{Gin@rule@.bmp}#1{{bmp}{}{#1}}
1653 \@namedef{Gin@rule@.msp}#1{{bmp}{}{#1}}
1654 %    \end{macrocode}
1656 %    \begin{macrocode}
1657 %</dosrules>
1658 %<*macrules>
1659 %\def\Gin@extensions{{},.ps,.eps,.pict}
1660 %\@namedef{Gin@rule@.ps}#1{{eps}{.ps}{#1}}
1661 %\@namedef{Gin@rule@.eps}#1{{eps}{.eps}{#1}}
1662 \@namedef{Gin@rule@.pict}#1{{pict}{}{#1}}
1663 \@namedef{Gin@rule@.pntg}#1{{pntg}{}{#1}}
1664 %\@namedef{Gin@rule@}#1{{pict}{\relax}{#1}}
1665 %</macrules>
1666 %<*tiffrules>
1667 \@namedef{Gin@rule@.tif}#1{{tiff}{}{#1}}
1668 %</tiffrules>
1669 %    \end{macrocode}
1671 % \Finale