Graphics drivers for L^{A}TEX 2ε^{∗}

Sebastian Rahtz and David Carlisle

1996/12/12

1 Driver files

This file implements the currently supported drivers. If the driver you use is not in this list then a ‘.def’ file may be distributed with the driver. If not, send us some details of the driver’s \special syntax, and we will try to produce a suitable file.

Note that some of these files are for drivers to which we have no access, so they are untested. Please send any corrections to the latexbugs address.

2 Colour

Most of the drivers that support colour use one of three methods.

• color1: ‘dvips’ style colour specials.

• color2: ‘textures’ style colour specials.

• color3: Colour implemented via literal PostScript specials.

• color4: Colour implemented by specials that only support RGB ie Red Green Blue specified as integers in the range 0–255. Other models converted to this within TEX.

Some drivers do not use any of these modules and have their own code. Note that drivers using the ‘color3’ code can not fully support the L^{A}TEX colour commands.

1 ⟨∗color1 | color2 | color3 | color4⟩

 2 \def\c@lor@arg#1{%
 3 \dimen@#1\p@
 4 \ifdim\dimen@<\z@\dimen@\maxdimen\fi
 5 \ifdim\dimen@>\p@
 6  \PackageError{color}{Argument `#1' not in range [0,1]}\@ehd
 7 \fi}

∗Version v3.0d, revised 1996/12/12

Need to make sure of a trailing .0 for textures. Apparently it is OK to always add a . as 1.3. is accepted by textures. textures gray special is reversed, so just use rgb instead.

 8 \def\color@gray#1#2{%
 9 \c@lor@arg{#2}%
10 ⟨color4⟩ \c@lor@rgb@RGB\@tempa
11 ⟨color1⟩ \edef#1{gray #2}%
12 ⟨color2⟩ \edef#1{rgb #2. #2. #2.}%
13 ⟨color3⟩ \edef#1{#2 setgray}%
14 ⟨color4⟩ \edef#1{\@tempa\@tempa\@tempa}%

15 }

16 \def\color@cmyk#1#2{\c@lor@@cmyk#2\@@#1}
17 \def\c@lor@@cmyk#1,#2,#3,#4\@@#5{%
18 \c@lor@arg{#4}%
19 ⟨color4⟩  \dimen@ii#4\p@
20 \c@lor@arg{#1}%
21 ⟨color4⟩ \c@lor@cmyk@RGB\@tempa
22 \c@lor@arg{#2}%
23 ⟨color4⟩ \c@lor@cmyk@RGB\@tempb
24 \c@lor@arg{#3}%
25 ⟨color4⟩ \c@lor@cmyk@RGB\@tempc
26 ⟨color1⟩ \edef#5{cmyk #1 #2 #3 #4}%
27 ⟨color2⟩ \edef#5{cmyk #1. #2. #3. #4.}%
28 ⟨color3⟩ \edef#5{#1 #2 #3 #4 setcmykcolor}%
29 ⟨color4⟩ \edef#5{\@tempa\@tempb\@tempc}%

30 }

A 0–1 range value will have been left in \dimen@ by \c@lor@arg. The black value (0–1) will be stored in \dimen@ii. Covert to 0–255 integer, and leave in #1.

31 ⟨∗color4⟩

32 \def\c@lor@cmyk@RGB#1{%
33 \advance\dimen@-\p@
34 \advance\dimen@\dimen@ii
35 \dimen@-\@cclv\dimen@
36 \divide\dimen@\p@
37 \count@\ifdim\dimen@<\z@\z@\else\dimen@\fi
38 \edef#1{\the\count@\space}}

39 ⟨/color4⟩

40 \def\color@rgb#1#2{\c@lor@@rgb#2\@@#1}
41 \def\c@lor@@rgb#1,#2,#3\@@#4{%
42 \c@lor@arg{#1}%
43 ⟨color4⟩ \c@lor@rgb@RGB\@tempa
44 \c@lor@arg{#2}%
45 ⟨color4⟩ \c@lor@rgb@RGB\@tempb
46 \c@lor@arg{#3}%
47 ⟨color4⟩ \c@lor@rgb@RGB\@tempc
48 ⟨color1⟩ \edef#4{rgb #1 #2 #3}%
49 ⟨color2⟩ \edef#4{rgb #1. #2. #3.}%
50 ⟨color3⟩ \edef#4{#1 #2 #3 setrgbcolor}%

51 ⟨color4⟩ \edef#4{\@tempa\@tempb\@tempc}%

52 }

A 0–1 range value will have been left in \dimen@ by \c@lor@arg. Convert to 0–255 integer, and leave in #1.

53 ⟨∗color4⟩

54 \def\c@lor@rgb@RGB#1{%
55 \dimen@\@cclv\dimen@
56 \count@\dimen@
57 \divide\count@\p@
58 \edef#1{\the\count@\space}}

59 ⟨/color4⟩

60 \def\color@RGB#1#2{\c@lor@@RGB#2\@@#1}
61 \def\c@lor@@RGB#1,#2,#3\@@#4{%
62 ⟨!color4⟩ \c@lor@RGB@rgb{#1}\@tempa
63 ⟨!color4⟩ \c@lor@RGB@rgb{#2}\@tempb
64 ⟨!color4⟩ \c@lor@RGB@rgb{#3}\@tempc
65 ⟨!color4⟩ \c@lor@@rgb\@tempa,\@tempb,\@tempc\@@#4%
66 ⟨color4⟩ \edef#4{#1 #2 #3}%

67 }

Convert 0–255 integer, #1, to 0–1 real, and leave in #2.

68 ⟨∗!color4⟩

69 \def\c@lor@RGB@rgb#1#2{%
70 \dimen@#1\p@
71 \divide\dimen@\@cclv
72 \edef#2{\strip@pt\dimen@}}

73 ⟨/!color4⟩

74 ⟨∗color1 | color3⟩

75 \def\color@hsb#1#2{\c@lor@@hsb#2\@@#1}
76 \def\c@lor@@hsb#1,#2,#3\@@#4{%
77 \c@lor@arg{#1}%
78 \c@lor@arg{#2}%
79 \c@lor@arg{#3}%
80 ⟨color1⟩ \edef#4{hsb #1 #2 #3}%
81 ⟨color3⟩ \edef#4{#1 #2 #3 sethsbcolor}%

82 } 83 ⟨/color1 | color3⟩

84 \def\color@named#1#2{\c@lor@@named#2,,\@@#1}
85 \def\c@lor@@named#1,#2,#3\@@#4{%
86 \@ifundefined{col@#1}%
87  {\PackageError{color}{Undefined color `#1'}\@ehd}%

88 ⟨color1&!dvipsone⟩ {\edef#4{ #1}}%

89 ⟨color2⟩ {\edef#4{ #1 \if!#2!\else #2.\fi}}%
90 ⟨color3 | dvipsone | color4⟩ {\edef#4{\csname col@#1\endcsname}}%

91 }

Conversion from \special syntax to PostScript (for PSTricks).

92 ⟨∗color1 | color2⟩

 93 \def\c@lor@to@ps#1 #2\@@{\csname c@lor@ps@#1\endcsname#2 \@@}

94 ⟨/color1 | color2⟩ 95 ⟨∗color3⟩

 96 \def\c@lor@to@ps#1\@@{#1}

97 ⟨/color3⟩ 98 ⟨∗color4⟩

 99 \def\c@lor@to@ps#1#2 #3 #4\@@{%
100 #1#2 255 div #3 255 div #4 255 div setrgbcolor}

101 ⟨/color4⟩

102 ⟨∗color1⟩

103 \def\c@lor@ps@#1 #2\@@{TeXDict begin #1 end}
104 \def\c@lor@ps@rgb#1\@@{#1 setrgbcolor}
105 \def\c@lor@ps@hsb#1\@@{#1 sethsbcolor}
106 \def\c@lor@ps@cmyk#1\@@{#1 setcmykcolor}
107 \def\c@lor@ps@gray#1\@@{#1 setgray}

108 ⟨/color1⟩ 109 ⟨∗color2⟩

110 \def\c@lor@to@ps@#1 #2\@@{\csname c@lor@ps@#1@\endcsname#2 \@@}
111 \def\c@lor@ps@#1 #2\@@{%
112 \expandafter\expandafter\expandafter
113  \c@lor@to@ps@\csname col@#1\expandafter\endcsname\space#2. \@@{#1}}
114 \def\c@lor@ps@rgb#1. #2. #3. #4\@@{#1 #2 #3 setrgbcolor}
115 \def\c@lor@ps@rgb@#1. #2. #3. #4. #5\@@#6{#1 #2 #3 setrgbcolor}
116 \def\c@lor@ps@cmyk#1. #2. #3. #4. #5. #6\@@{#1 #2 #3 #4 setcmykcolor}
117 \def\c@lor@ps@cmyk@#1. #2. #3. #4. #5. #6\@@#7{%
118  #1 #2 #3 #4  (#7)  findcustomcmykcolor
119  \if!\@firstofone#5!1 \else#5 \fi setcustomcolor}

120 ⟨/color2⟩

121 ⟨color1&!dvipsone⟩\def\current@color{ Black}
122 ⟨color1 & dvipsone⟩\def\current@color{gray 0}
123 ⟨color2⟩\def\current@color{rgb 0. 0. 0.}
124 ⟨color3⟩\def\current@color{0 setgray}
125 ⟨color4⟩\def\current@color{0 0 0}

126 ⟨∗color1⟩

127 \def\set@color{%
128 ⟨!dvipsone&!dvipdf⟩ \special{color push  \current@color
129 ⟨dvipsone⟩  \special{color push}\special{color \current@color
130 ⟨dvipdf⟩  \special{pdf: /C  \current@color\space<<
131  }\aftergroup\reset@color}
132 \def\reset@color{\special{%

133 ⟨!dvipdf⟩ color pop}} 134 ⟨dvipdf⟩ pdf: /C >> }}

135 \def\set@page@color{\special{%
136 ⟨!dvipdf⟩  background \current@color}}
137 ⟨dvipdf⟩  pdf: /BG \current@color}}
138 \def\define@color@named#1#2{%

139 ⟨!dvipsone⟩ \expandafter\let\csname col@#1\endcsname\@nnil}
140 ⟨dvipsone⟩ \expandafter\edef\csname col@#1\endcsname{#2}}

141 ⟨/color1⟩ 142 ⟨∗color2⟩

143 \def\set@color{%
144 \special{color push}%
145 \special{color \current@color}%
146 \aftergroup\reset@color}
147 \def\reset@color{\special{color pop}}
148 \def\set@page@color{\c@lor@special\sixt@@n{background \current@color}}
149 \def\define@color@named#1#2{%
150 \AtBeginDvi{\special{color define #1 #2}}%
151 \expandafter\edef\csname col@#1\endcsname{#2}}

152 ⟨/color2⟩ 153 ⟨∗color3⟩

154 \def\set@color{%
155 \Gin@PS@raw{\current@color}\aftergroup\reset@color}
156 \def\reset@color{\Gin@PS@raw{\current@color}}

157 ⟨/color3⟩ 158 ⟨∗color4⟩

159 \def\set@color{%
160 \special{textcolor: \current@color}\aftergroup\reset@color}
161 \def\reset@color{\special{textcolor: \current@color}}

162 ⟨/color4⟩ 163 ⟨∗color3 | color4⟩

164 \def\set@page@color{%
165 \c@lor@special\sixt@@n{background color ignored: \current@color}}
166 \def\define@color@named#1#2{%
167 \expandafter\edef\csname col@#1\endcsname{#2}}

168 ⟨/color3 | color4⟩

169 ⟨/color1 | color2 | color3 | color4⟩

170 ⟨∗colorfix⟩

171 \AtBeginDocument{%
172 \let\@ldc@l@r\color
173 \def\color{\if@inlabel\leavevmode\fi\@ldc@l@r}%
174 \let\@lduseb@x\usebox
175 \def\usebox#1{\@lduseb@x{#1}\set@color}}

176 ⟨/colorfix⟩

177 ⟨∗dvipsnames⟩

178 \DefineNamedColor{named}{GreenYellow}   {cmyk}{0.15,0,0.69,0}
179 \DefineNamedColor{named}{Yellow}        {cmyk}{0,0,1,0}
180 \DefineNamedColor{named}{Goldenrod}     {cmyk}{0,0.10,0.84,0}
181 \DefineNamedColor{named}{Dandelion}     {cmyk}{0,0.29,0.84,0}
182 \DefineNamedColor{named}{Apricot}       {cmyk}{0,0.32,0.52,0}
183 \DefineNamedColor{named}{Peach}         {cmyk}{0,0.50,0.70,0}
184 \DefineNamedColor{named}{Melon}         {cmyk}{0,0.46,0.50,0}
185 \DefineNamedColor{named}{YellowOrange}  {cmyk}{0,0.42,1,0}
186 \DefineNamedColor{named}{Orange}        {cmyk}{0,0.61,0.87,0}
187 \DefineNamedColor{named}{BurntOrange}   {cmyk}{0,0.51,1,0}

188 \DefineNamedColor{named}{Bittersweet}   {cmyk}{0,0.75,1,0.24}
189 \DefineNamedColor{named}{RedOrange}     {cmyk}{0,0.77,0.87,0}
190 \DefineNamedColor{named}{Mahogany}      {cmyk}{0,0.85,0.87,0.35}
191 \DefineNamedColor{named}{Maroon}        {cmyk}{0,0.87,0.68,0.32}
192 \DefineNamedColor{named}{BrickRed}      {cmyk}{0,0.89,0.94,0.28}
193 \DefineNamedColor{named}{Red}           {cmyk}{0,1,1,0}
194 \DefineNamedColor{named}{OrangeRed}     {cmyk}{0,1,0.50,0}
195 \DefineNamedColor{named}{RubineRed}     {cmyk}{0,1,0.13,0}
196 \DefineNamedColor{named}{WildStrawberry}{cmyk}{0,0.96,0.39,0}
197 \DefineNamedColor{named}{Salmon}        {cmyk}{0,0.53,0.38,0}
198 \DefineNamedColor{named}{CarnationPink} {cmyk}{0,0.63,0,0}
199 \DefineNamedColor{named}{Magenta}       {cmyk}{0,1,0,0}
200 \DefineNamedColor{named}{VioletRed}     {cmyk}{0,0.81,0,0}
201 \DefineNamedColor{named}{Rhodamine}     {cmyk}{0,0.82,0,0}
202 \DefineNamedColor{named}{Mulberry}      {cmyk}{0.34,0.90,0,0.02}
203 \DefineNamedColor{named}{RedViolet}     {cmyk}{0.07,0.90,0,0.34}
204 \DefineNamedColor{named}{Fuchsia}       {cmyk}{0.47,0.91,0,0.08}
205 \DefineNamedColor{named}{Lavender}      {cmyk}{0,0.48,0,0}
206 \DefineNamedColor{named}{Thistle}       {cmyk}{0.12,0.59,0,0}
207 \DefineNamedColor{named}{Orchid}        {cmyk}{0.32,0.64,0,0}
208 \DefineNamedColor{named}{DarkOrchid}    {cmyk}{0.40,0.80,0.20,0}
209 \DefineNamedColor{named}{Purple}        {cmyk}{0.45,0.86,0,0}
210 \DefineNamedColor{named}{Plum}          {cmyk}{0.50,1,0,0}
211 \DefineNamedColor{named}{Violet}        {cmyk}{0.79,0.88,0,0}
212 \DefineNamedColor{named}{RoyalPurple}   {cmyk}{0.75,0.90,0,0}
213 \DefineNamedColor{named}{BlueViolet}    {cmyk}{0.86,0.91,0,0.04}
214 \DefineNamedColor{named}{Periwinkle}    {cmyk}{0.57,0.55,0,0}
215 \DefineNamedColor{named}{CadetBlue}     {cmyk}{0.62,0.57,0.23,0}
216 \DefineNamedColor{named}{CornflowerBlue}{cmyk}{0.65,0.13,0,0}
217 \DefineNamedColor{named}{MidnightBlue}  {cmyk}{0.98,0.13,0,0.43}
218 \DefineNamedColor{named}{NavyBlue}      {cmyk}{0.94,0.54,0,0}
219 \DefineNamedColor{named}{RoyalBlue}     {cmyk}{1,0.50,0,0}
220 \DefineNamedColor{named}{Blue}          {cmyk}{1,1,0,0}
221 \DefineNamedColor{named}{Cerulean}      {cmyk}{0.94,0.11,0,0}
222 \DefineNamedColor{named}{Cyan}          {cmyk}{1,0,0,0}
223 \DefineNamedColor{named}{ProcessBlue}   {cmyk}{0.96,0,0,0}
224 \DefineNamedColor{named}{SkyBlue}       {cmyk}{0.62,0,0.12,0}
225 \DefineNamedColor{named}{Turquoise}     {cmyk}{0.85,0,0.20,0}
226 \DefineNamedColor{named}{TealBlue}      {cmyk}{0.86,0,0.34,0.02}
227 \DefineNamedColor{named}{Aquamarine}    {cmyk}{0.82,0,0.30,0}
228 \DefineNamedColor{named}{BlueGreen}     {cmyk}{0.85,0,0.33,0}
229 \DefineNamedColor{named}{Emerald}       {cmyk}{1,0,0.50,0}
230 \DefineNamedColor{named}{JungleGreen}   {cmyk}{0.99,0,0.52,0}
231 \DefineNamedColor{named}{SeaGreen}      {cmyk}{0.69,0,0.50,0}
232 \DefineNamedColor{named}{Green}         {cmyk}{1,0,1,0}
233 \DefineNamedColor{named}{ForestGreen}   {cmyk}{0.91,0,0.88,0.12}
234 \DefineNamedColor{named}{PineGreen}     {cmyk}{0.92,0,0.59,0.25}
235 \DefineNamedColor{named}{LimeGreen}     {cmyk}{0.50,0,1,0}
236 \DefineNamedColor{named}{YellowGreen}   {cmyk}{0.44,0,0.74,0}
237 \DefineNamedColor{named}{SpringGreen}   {cmyk}{0.26,0,0.76,0}

238 \DefineNamedColor{named}{OliveGreen}    {cmyk}{0.64,0,0.95,0.40}
239 \DefineNamedColor{named}{RawSienna}     {cmyk}{0,0.72,1,0.45}
240 \DefineNamedColor{named}{Sepia}         {cmyk}{0,0.83,1,0.70}
241 \DefineNamedColor{named}{Brown}         {cmyk}{0,0.81,1,0.60}
242 \DefineNamedColor{named}{Tan}           {cmyk}{0.14,0.42,0.56,0}
243 \DefineNamedColor{named}{Gray}          {cmyk}{0,0,0,0.50}
244 \DefineNamedColor{named}{Black}         {cmyk}{0,0,0,1}
245 \DefineNamedColor{named}{White}         {cmyk}{0,0,0,0}

246 ⟨/dvipsnames⟩

3 dvips

A L^{A}TEX 2ε graphics driver file for Tom Rokicki’s dvips driver; tested with version 5.58f.

247 ⟨∗dvips⟩

3.1 Colour

Uses the generic ‘color1’ code.

3.2 File inclusion

\Ginclude@eps #1 input file (or command)

248 \def\Ginclude@eps#1{%
249 \message{<#1>}%
250 \bgroup

dvips likes to work with its own pixel resolution, so mangle the sizes slightly.

251 \def\@tempa{!}%
252 \dimen@\Gin@req@width
253 \dimen@ii.1bp%
254 \divide\dimen@\dimen@ii
255 \@tempdima\Gin@req@height
256 \divide\@tempdima\dimen@ii
257  \special{PSfile="#1"\space
258  llx=\Gin@llx\space
259  lly=\Gin@lly\space
260  urx=\Gin@urx\space
261  ury=\Gin@ury\space
262  \ifx\Gin@scalex\@tempa\else rwi=\number\dimen@\space\fi
263  \ifx\Gin@scaley\@tempa\else rhi=\number\@tempdima\space\fi
264  \ifGin@clip clip\fi}%
265 \egroup}

\Ginclude@bmp #1 input file; if zero size is requested, the graphic will come at ‘natural’ size.

266 \def\Ginclude@bmp#1{%
267 \message{<#1>}%
268 \dimen@\Gin@req@height

269 \advance\dimen@ by-\Gin@lly bp
270 \kern-\Gin@llx bp\raise\Gin@req@height\hbox{%
271 \ifdim\Gin@urx bp=\z@
272  \ifdim\Gin@ury bp=\z@
273  \special{em: graph #1}%
274  \else
275  \special{em: graph #1,\Gin@urx bp}%
276  \fi
277 \else
278  \special{em: graph #1,\Gin@urx bp,\Gin@ury bp}%
279 \fi

280 }% 281 }

3.3 Rotation

282 \def\Grot@start{%
283 \special{ps: gsave currentpoint
284 currentpoint translate \Grot@angle\space neg
285 rotate neg exch neg exch translate}}
286 \def\Grot@end{\special{ps: currentpoint grestore moveto}}

3.4 Scaling

287 \def\Gscale@start{\special{ps:  currentpoint currentpoint translate
288 \Gscale@x\space \Gscale@y\space scale neg exch neg exch translate}}
289 \def\Gscale@end{\special{ps:  currentpoint currentpoint translate
290 1 \Gscale@x\space div 1 \Gscale@y\space div scale
291 neg exch neg exch translate}}

4 Literal Postscript

Raw PostScript code, no save/restore.

292 \def\Gin@PS@raw#1{\special{ps: #1}}

PostScript code, to be surrounded by save/restore by the driver. Coordinate system standard PostScript, but with origin at current (TEX) position.

293 \def\Gin@PS@restored#1{\special{" #1}}

PostScript code to be inserted in the Header section of the final PostScript. Must be issued on the first page of a document.

294 \def\Gin@PS@literal@header#1{\AtBeginDvi{\special{! #1}}}

Name of external file, the contents of which are to be inserted in the Header section of the final PostScript. Must be issued on the first page of a document.

295 \def\Gin@PS@file@header#1{\AtBeginDvi{\special{header=#1}}}

296 ⟨/dvips⟩

5 dvipdf

A L^{A}TEX 2ε graphics driver file for dvipdf driver.

297 ⟨∗dvipdf⟩

5.1 Colour

Uses the generic ‘color1’ code.

5.2 File inclusion

\Ginclude@eps #1 input file (or command)

298 \def\Ginclude@eps#1{%
299 \message{<#1>}%
300 \bgroup

dvips likes to work with its own pixel resolution, so mangle the sizes slightly.

301 \def\@tempa{!}%
302 \dimen@\Gin@req@width
303 \dimen@ii.1bp%
304 \divide\dimen@\dimen@ii
305 \@tempdima\Gin@req@height
306 \divide\@tempdima\dimen@ii
307  \special{PSfile="#1"\space
308  llx=\Gin@llx\space
309  lly=\Gin@lly\space
310  urx=\Gin@urx\space
311  ury=\Gin@ury\space
312  \ifx\Gin@scalex\@tempa\else rwi=\number\dimen@\space\fi
313  \ifx\Gin@scaley\@tempa\else rhi=\number\@tempdima\space\fi
314  \ifGin@clip clip\fi}%
315 \egroup}

\Ginclude@bmp #1 input file; if zero size is requested, the graphic will come at ‘natural’ size.

316 \def\Ginclude@bmp#1{%
317 \message{<#1>}%
318 \dimen@\Gin@req@height
319 \advance\dimen@ by-\Gin@lly bp
320 \kern-\Gin@llx bp\raise\Gin@req@height\hbox{%
321 \ifdim\Gin@urx bp=\z@
322  \ifdim\Gin@ury bp=\z@
323  \special{pdf: /GRAPH  #1}%
324  \else
325  \special{pdf: /GRAPH  #1 \number\Gin@req@width sp}%
326  \fi
327 \else
328  \special{pdf: /GRAPH  #1 \number\Gin@req@width sp
329  \number\Gin@req@height sp}%
330 \fi}}

5.3 Rotation

331 \def\Grot@start{%
332 \special{pdf: /ROT \Grot@angle\space << }}
333 \def\Grot@end{\special{pdf: /ROT >> }}

5.4 Scaling

334 \def\Gscale@start{\special{pdf: /S \Gscale@x\space \Gscale@y\space << }}
335 \def\Gscale@end{\special{pdf: /S \space >> }}

6 Literal Postscript

Raw PostScript code, no save/restore.

336 \def\Gin@PS@raw#1{\special{ps: #1}}

PostScript code, to be surrounded by save/restore by the driver. Coordinate system standard PostScript, but with origin at current (TEX) position.

337 \def\Gin@PS@restored#1{\special{" #1}}

PostScript code to be inserted in the Header section of the final PostScript. Must be issued on the first page of a document.

338 \def\Gin@PS@literal@header#1{\AtBeginDvi{\special{! #1}}}

Name of external file, the contents of which are to be inserted in the Header section of the final PostScript. Must be issued on the first page of a document.

339 \def\Gin@PS@file@header#1{\AtBeginDvi{\special{header=#1}}}

6.1 File extensions

340 \@namedef{Gin@rule@.msp}#1{{bmp}{.bb}{#1}}
341 \@namedef{Gin@rule@.jpg}#1{{bmp}{.bb}{#1}}
342 \@namedef{Gin@rule@.bmp}#1{{bmp}{.bb}{#1}}

343 ⟨/dvipdf⟩

7 OzTeX

A L^{A}TEX 2ε graphics driver file for OzTeX (versions 1.42 and later), by Andrew Trevorrow.

344 ⟨∗oztex⟩

7.1 Graphics inclusion

345 \def\Ginclude@eps{\Oztex@Include{epsf}}
346 \def\Ginclude@pntg{\Oztex@Include{pntg}}
347 \def\Ginclude@pict{\Oztex@Include{pict}}
348 \def\Oztex@Include#1#2{%
349 \ifGin@clip
350 \typeout{No clipping support in OzTeX}%
351 \fi

352 \divide\Gin@req@width by 65781% convert sp to bp
353 \divide\Gin@req@height by 65781%
354 \special{#1=#2\space
355 width=\number\Gin@req@width \space
356 height=\number\Gin@req@height

357 }% 358 } 359 ⟨/oztex⟩

8 Textures

A L^{A}TEX 2ε graphics driver file for Blue Sky’s Textures

WARNING! There is ongoing work to produce a new version of the textures support. Do not rely on anything in this file being in the next version!

360 ⟨∗textures⟩

8.1 Graphics inclusion

361 \PackageInfo{graphics/color}
362 {This file uses the advanced color support\MessageBreak
363 available in textures1.7\MessageBreak
364 If you are using color with an earlier version\MessageBreak
365 of textures, edit graphics.ins where marked,\MessageBreak
366 and re-latex graphics.ins.\MessageBreak\MessageBreak
367 If you are using textures1.7\MessageBreak
368 you may want to delete this warning\MessageBreak
369 from textures.def.\MessageBreak\MessageBreak
370 The code for scaling/rotation and file inclusion\MessageBreak
371 in this file is still rudimentary, and does not\MessageBreak
372 use textures' full capabilities.\MessageBreak\MessageBreak
373 A new textures.def is currently being developed\@gobble}
374 \def\Ginclude@eps{\Textures@Include{illustration}}
375 \def\Ginclude@pict{\Textures@Include{pictfile}}
376 \def\Textures@Include#1#2{%
377 \def\@tempa{!}%
378 \ifx\Gin@scaley\@tempa
379  \let\Gin@scaley\Gin@scalex
380 \else
381  \ifx\Gin@scalex\@tempa\let\Gin@scalex\Gin@scaley\fi
382 \fi
383 \setlength\@tempdima{\Gin@scalex pt}%
384 \setlength\@tempdimb{\Gin@scaley pt}%
385 \ifdim\@tempdima>\@tempdimb
386  \let\Gin@scalex\Gin@scaley
387 \fi
388 \ifGin@clip
389 \typeout{no clipping support in Textures}%

390 \fi
391 \@tempdimb=1000sp%
392 \setlength\@tempdima{\Gin@scalex\@tempdimb}%
393 \special{#1 #2\space scaled \number\@tempdima}%

394 }

8.2 Rotation

This code was written when no unprotected postscript code was allowed; it could almost certainly be rewritten now with ‘rawpostscript’.

395 \def\Grot@start{\special{postscript
396 0 0 transform
397 grestore
398 matrix currentmatrix
399 3 1 roll
400 itransform
401 dup 3 -1 roll
402 dup 4 1 roll exch
403 translate
404 \Grot@angle\space neg rotate
405 neg exch neg exch translate
406 gsave}}
407 \def\Grot@end{\special{postscript grestore  setmatrix  gsave}}

8.3 Colour

This will only work for versions 1.6 and Version 1.7 uses ‘color2’.

408 ⟨color3⟩\def\Gin@PS@raw#1{\special{rawpostscript #1}}

409 ⟨/textures⟩

9 dvialw

A L^{A}TEX 2ε graphics driver file for dvialw, by Nelson Beebe

410 ⟨∗dvialw⟩

9.1 Rotation

411 \def\Ginclude@eps#1{%
412 \def\@tempa{!}%
413 \ifx\Gin@scaley\@tempa
414  \let\Gin@scaley\Gin@scalex
415 \else
416  \ifx\Gin@scalex\@tempa\let\Gin@scalex\Gin@scaley\fi
417 \fi
418 \ifGin@clip
419  \typeout{no clipping support in dvialw}%
420 \fi
421 \special{language "PS",

422  literal "\Gin@scalex\space
423  \Gin@scaley\space scale",
424  position = "bottom left",
425  include "#1\space"}%

426 } 427 ⟨/dvialw⟩

10 emtex

A L^{A}TEX 2ε graphics driver file for Eberhard Mattes’ emTeX

428 ⟨∗emtex⟩

10.1 Graphics file inclusion

429 \def\Ginclude@bmp#1{%
430 \raise\Gin@req@height\hbox{\special{em:graph #1}}%
431 \typeout{WARNING: emtex does not permit graphics to be scaled}%

432 } 433 ⟨/emtex⟩

11 dvilaser/ps

A L^{A}TEX 2ε graphics driver file for Arbortext’s dvilaser/ps

434 ⟨∗dvilaser⟩

11.1 Graphic file inclusion

435 \def\Ginclude@eps#1{%
436 \ifGin@clip
437 \typeout{no clipping support in dvilaser/ps}%
438 \fi
439 \special{ps: epsfile #1\space \the\Gin@req@width}%

440 } 441 ⟨/dvilaser⟩

12 psprint

A L^{A}TEX 2ε graphics driver file for Trevorrow’s psprint

442 ⟨∗psprint⟩

12.1 Graphic file inclusion

443 \def\Ginclude@eps#1{%
444 \def\@tempa{!}%
445 \ifx\Gin@scaley\@tempa
446  \let\Gin@scaley\Gin@scalex
447 \else
448  \ifx\Gin@scalex\@tempa\let\Gin@scalex\Gin@scaley\fi

449 \fi
450 \ifGin@clip
451  \typeout{no clipping support in psprint}%
452 \fi
453 \special{#1\space
454  \Gin@scalex\space \Gin@scaley\space scale
455  \Gin@llx\space neg
456  \Gin@lly \space neg translate

457 }% 458 } 459 ⟨/psprint⟩

13 dvipsone

A L^{A}TEX 2ε graphics driver file for Y&Y’s dvipsone

460 ⟨∗dvipsone⟩

13.1 Graphic file inclusion

PostScript Files.

461 \def\Ginclude@eps#1{%
462 \message{<#1>}%
463 \bgroup
464 \def\@tempa{!}%
465 \dimen@\Gin@req@width
466 \dimen@ii.1bp%
467 \divide\dimen@\dimen@ii
468 \@tempdima\Gin@req@height
469 \divide\@tempdima\dimen@ii
470  \special{PSfile="#1"\space
471  llx=\Gin@llx\space
472  lly=\Gin@lly\space
473  urx=\Gin@urx\space
474  ury=\Gin@ury\space
475  \ifx\Gin@scalex\@tempa\else rwi=\number\dimen@\space\fi
476  \ifx\Gin@scaley\@tempa\else rhi=\number\@tempdima\space\fi
477  \ifGin@clip clip\fi}%
478 \egroup}

Tiff files.

479 \def\Ginclude@tiff#1{%
480 \message{<#1>}%
481 \special{insertimage: #1 \number\Gin@req@width\space
482  \number\Gin@req@height}}

Windows Metafiles.

483 \def\Ginclude@wmf#1{%
484 \message{<#1>}%
485 \def\@tempa{!}%
486 \ifx\Gin@scaley\@tempa\let\Gin@scaley\@empty\fi

487 \ifx\Gin@scalex\@tempa\let\Gin@scalex\Gin@scaley\fi
488 \special{insertmf: #1 \Gin@scalex\space\Gin@scaley}}
489 \def\Gin@PS@raw#1{\special{ps: #1}}

13.2 Rotation

490 \def\Grot@start{%
491 \special{ps: gsave currentpoint
492 currentpoint translate \Grot@angle\space
493 rotate neg exch neg exch translate}}
494 \def\Grot@end{\special{ps: currentpoint grestore moveto}}

13.3 Scaling

495 \def\Gscale@start{\special{ps:  currentpoint currentpoint translate
496 \Gscale@x\space \Gscale@y\space scale neg exch neg exch translate}}
497 \def\Gscale@end{\special{ps:  currentpoint currentpoint translate
498 1 \Gscale@x\space div 1 \Gscale@y\space div scale
499 neg exch neg exch translate}}

13.4 File Extensions

500 \@namedef{Gin@rule@.wmf}#1{{wmf}{}{#1}}
501 \@namedef{Gin@rule@.clp}#1{{wmf}{}{#1}}

14 Literal Postscript

Raw PostScript code, no save/restore.

502 \def\Gin@PS@raw#1{\special{ps: #1}}

PostScript code, to be surrounded by save/restore by the driver. Coordinate system standard PostScript, but with origin at current (TEX) position.

503 \def\Gin@PS@restored#1{\special{" #1}}

PostScript code to be inserted in the Header section of the final PostScript. Must be issued on the first page of a document.

504 \def\Gin@PS@literal@header#1{\AtBeginDvi{\special{headertext=#1}}}

Name of external file, the contents of which are to be inserted in the Header section of the final PostScript. Must be issued on the first page of a document.

505 \def\Gin@PS@file@header#1{\AtBeginDvi{\special{header=#1}}}

506 ⟨/dvipsone⟩

15 dviwindo

A L^{A}TEX 2ε graphics driver file for Y&Y’s dviwindo.

This driver now uses the same file as dvipsone.

16 dvitops

A L^{A}TEX 2ε graphics driver file for James Clark’s dvitops

507 ⟨∗dvitops⟩

16.1 Rotation

508 \newcount\Grot@count
509 \Grot@count=\@ne
510 \def\Grot@start{\special{dvitops: origin
511  rot\the\@tempdima}%
512 \special{dvitops: begin rot\the\Grot@count}}%
513 \def\Grot@end{\special{dvitops: end}%
514 \special{dvitops: rotate rot\the\Grot@count \space
515  \Grot@angle}%
516 \global\advance\Grot@count by\@ne}%

16.2 Graphic file inclusion

517 \def\Ginclude@eps#1{%
518 % These cause an arithmetic overflow, so I've commented them
519 % out. Presumably they were there for some reason.
520 % Any dvitops users out there??
521 % \multiply\Gin@req@width by \@m
522 % \multiply\Gin@req@height by \@m
523 \ifGin@clip
524 \typeout{no clipping support in dvitops}%
525 \fi
526 \special{import #1\space \the\Gin@req@width\space
527  \the\Gin@req@height\space fill}}

528 ⟨/dvitops⟩

17 dvi2ps

A L^{A}TEX 2ε graphics driver file for original dvi2ps

529 ⟨∗dvi2ps⟩

17.1 Graphic file inclusion

530 \def\Ginclude@eps#1{%
531 \def\@tempa{!}%
532 \ifx\Gin@scaley\@tempa
533  \let\Gin@scaley\Gin@scalex
534 \else
535  \ifx\Gin@scalex\@tempa\let\Gin@scalex\Gin@scaley\fi
536 \fi
537 \ifGin@clip
538  \typeout{no clipping support in dvi2ps}%
539 \fi

540 \special{psfile=#1\space
541  hscale=\Gin@scalex\space 1000 mul
542  vscale=\Gin@scaley\space 1000 mul}}

543 ⟨/dvi2ps⟩

18 pctexps

A L^{A}TEX 2ε graphics driver file for Personal TeX’s PTI Laser/PS; from information supplied by Lance Carnes and Tao Wang <pti@crl.com>.

544 ⟨∗pctexps⟩

18.1 Graphic file inclusion

545 \def\Ginclude@eps#1{%
546 \message{<#1>}%
547 \ifGin@clip
548  \typeout{no clipping support in pctexps}%
549 \fi
550 \Gin@req@width.03515\Gin@req@width
551 \Gin@req@height.03515\Gin@req@height
552 \special{ps:#1\space x=\strip@pt\Gin@req@width cm,
553  y=\strip@pt\Gin@req@height cm}}
554 \def\Ginclude@ps#1{%
555 \message{<#1>}%
556 \ifGin@clip
557  \typeout{no clipping support in pctexps}%
558 \fi
559 \hbox{\kern-\Gin@llx bp\raise-\Gin@lly bp\hbox{\special{ps:#1}}}%
560 \typeout{^^J%
561 ---------------------------------------------------------^^J%
562 .ps graphics without bounding box information cannot be^^J%
563 scaled.  If the file actually contains the information,^^J%
564 please rename the file to .eps file extension.^^J%
565 ---------------------------------------------------------^^J}}
566 \def\Gin@extensions{.eps,.ps}
567 \@namedef{Gin@rule@.ps}#1{{ps}{.ps}{#1}}
568 \@namedef{Gin@rule@.eps}#1{{eps}{.eps}{#1}}
569 \def\Gin@PS@raw#1{\special{ps::#1}}
570 \def\Grot@start{%
571 \special{ps::gsave currentpoint
572 currentpoint translate \Grot@angle\space
573 rotate neg exch neg exch translate}}
574 \def\Grot@end{\special{ps:: currentpoint grestore moveto}}
575 \def\Gscale@start{\special{ps:: currentpoint currentpoint translate
576 \Gscale@x\space \Gscale@y\space scale neg exch neg exch translate}}
577 \def\Gscale@end{\special{ps::  currentpoint currentpoint translate
578 1 \Gscale@x\space div 1 \Gscale@y\space div scale

579 neg exch neg exch translate}}

580 ⟨/pctexps⟩

19 pctex32

A L^{A}TEX 2ε graphics driver file for Personal TeX’s PC TeX for 32 bit Windows; Code supplied by Tao Wang <pti@crl.com>.

19.1 Colour

Uses the generic ‘color1’ code.

581 ⟨∗pctex32⟩

19.2 Graphic file inclusion

582 % including PostScript graphics
583 \def\Ginclude@eps#1{%
584 \message{<#1>}%
585 \bgroup
586 \def\@tempa{!}%
587 \dimen@\Gin@req@width
588 \dimen@ii.1bp%
589 \divide\dimen@\dimen@ii
590 \@tempdima\Gin@req@height
591 \divide\@tempdima\dimen@ii
592  \special{PSfile="#1"\space
593  llx=\Gin@llx\space
594  lly=\Gin@lly\space
595  urx=\Gin@urx\space
596  ury=\Gin@ury\space
597  \ifx\Gin@scalex\@tempa\else rwi=\number\dimen@\space\fi
598  \ifx\Gin@scaley\@tempa\else rhi=\number\@tempdima\space\fi
599  \ifGin@clip clip\fi}%
600 \egroup}

including BMP graphics

601 \def\Ginclude@bmp#1{%
602 \message{<#1>}%
603 \ifGin@clip
604  \typeout{no clipping support for BMP graphics in PCTeX32}%
605 \fi
606 \Gin@req@width.03515\Gin@req@width
607 \Gin@req@height.03515\Gin@req@height
608 \special{bmp:#1\space x=\strip@pt\Gin@req@width cm,
609  y=\strip@pt\Gin@req@height cm}}

including WMF graphics

610 \def\Ginclude@wmf#1{%
611 \message{<#1>}%
612 \ifGin@clip

613  \typeout{no clipping support for WMF graphics in PCTeX32}%
614 \fi
615 \Gin@req@width.03515\Gin@req@width
616 \Gin@req@height.03515\Gin@req@height
617 \special{wmf:#1\space x=\strip@pt\Gin@req@width cm,
618  y=\strip@pt\Gin@req@height cm}}

19.3 Scaling and Rotating

PostScript rotation and scaling

619 \def\Grot@start{%
620 \special{ps:: gsave currentpoint
621 currentpoint translate \Grot@angle\space neg
622 rotate neg exch neg exch translate}}
623 \def\Grot@end{\special{ps:: currentpoint grestore moveto}}
624 \def\Gscale@start{\special{ps::  currentpoint currentpoint translate
625 \Gscale@x\space \Gscale@y\space scale neg exch neg exch translate}}
626 \def\Gscale@end{\special{ps::  currentpoint currentpoint translate
627 1 \Gscale@x\space div 1 \Gscale@y\space div scale
628 neg exch neg exch translate}}
629 \def\Gin@PS@raw#1{\special{ps:: #1}}
630 \def\Gin@PS@restored#1{\special{" #1}}

19.4 Default Extensions

631 \def\Gin@extensions{.eps,.ps,.wmf,.bmp}
632 \@namedef{Gin@rule@.ps}#1{{eps}{.ps}{#1}}
633 \@namedef{Gin@rule@.eps}#1{{eps}{.eps}{#1}}
634 \@namedef{Gin@rule@.bmp}#1{{bmp}{}{#1}}
635 \@namedef{Gin@rule@.wmf}#1{{wmf}{}{#1}}

636 ⟨/pctex32⟩

20 pctexwin

A L^{A}TEX 2ε graphics driver file for Personal TeX’s PC TeX for Windows; from information supplied by Lance Carnes and Tao Wang <pti@crl.com>.

637 ⟨∗pctexwin⟩

20.1 Graphic file inclusion

638 \def\Ginclude@eps#1{%
639 \message{<#1>}%
640 \ifGin@clip
641  \typeout{no clipping support in pctexwin}%
642 \fi
643 \Gin@req@width.03515\Gin@req@width
644 \Gin@req@height.03515\Gin@req@height
645 \special{eps:#1\space x=\strip@pt\Gin@req@width cm,
646  y=\strip@pt\Gin@req@height cm}}

647 \def\Ginclude@ps#1{%
648 \message{<#1>}%
649 \ifGin@clip
650  \typeout{no clipping support in pctexwin}%
651 \fi
652 \hbox{\kern-\Gin@llx bp\raise-\Gin@lly bp\hbox{\special{ps:#1}}}%
653 \typeout{^^J%
654 ---------------------------------------------------------^^J%
655 .ps graphics without bounding box information cannot be^^J%
656 scaled.  If the file actually contains the information,^^J%
657 please rename the file to .eps file extension.^^J%
658 ---------------------------------------------------------^^J%

659 }}

660 \def\Ginclude@bmp#1{%
661 \message{<#1>}%
662 \ifGin@clip
663  \typeout{no clipping support in pctexwin}%
664 \fi
665 \Gin@req@width.03515\Gin@req@width
666 \Gin@req@height.03515\Gin@req@height
667 \special{bmp:#1\space x=\strip@pt\Gin@req@width cm,
668  y=\strip@pt\Gin@req@height cm}}
669 \def\Ginclude@wmf#1{%
670 \message{<#1>}%
671 \ifGin@clip
672  \typeout{no clipping support in pctexwin}%
673 \fi
674 \Gin@req@width.03515\Gin@req@width
675 \Gin@req@height.03515\Gin@req@height
676 \special{wmf:#1\space x=\strip@pt\Gin@req@width cm,
677  y=\strip@pt\Gin@req@height cm}}
678 \def\Gin@extensions{.eps,.ps,.wmf,.bmp}
679 \@namedef{Gin@rule@.bmp}#1{{bmp}{}{#1}}
680 \@namedef{Gin@rule@.wmf}#1{{wmf}{}{#1}}
681 \@namedef{Gin@rule@.ps}#1{{ps}{.ps}{#1}}
682 \@namedef{Gin@rule@.eps}#1{{eps}{.eps}{#1}}

683 ⟨/pctexwin⟩

21 pctexhp

A L^{A}TEX 2ε graphics driver file for Personal TeX’s PTI Laser/HP; from information supplied by Lance Carnes and Tao Wang <pti@crl.com>.

684 ⟨∗pctexhp⟩

21.1 Graphic file inclusion

685 \def\Ginclude@pcl#1{%
686 \message{<#1>}%

687 \ifGin@clip
688  \typeout{no clipping support in pctexhp}%
689 \fi
690 \hbox{\kern-\Gin@llx bp\raise-\Gin@lly bp\hbox{\special{pcl:#1}}}%
691 \typeout{WARNING: pctexhp does not permit graphics to be scaled}}
692 \@namedef{Gin@rule@.pcl}#1{{pcl}{}{#1}}
693 \def\Gin@extensions{.pcl}

694 ⟨/pctexhp⟩

22 pubps

A L^{A}TEX 2ε graphics driver file for Arbortext’s PUBps; information from Peter R

 Wilson pwilson@rdrc.rpi.edu.

695 ⟨∗pubps⟩

22.1 Rotation

696 \def\Grot@start{\special{ps: gsave currentpoint
697  currentpoint translate \Grot@angle\space
698  rotate  neg exch neg exch translate}}
699 \def\Grot@end{\special{ps: currentpoint grestore moveto}}

700 ⟨/pubps⟩

23 dviwin

A L^{A}TEX 2ε graphics driver file for Hippocrates Sendoukas’ dviwin

701 ⟨∗dviwin⟩

23.1 Graphic file inclusion

Dviwin sorts out the graphics type itself based on extension. They all use the same \special, so as far as graphics.sty is concerned they are all the same ‘type’. Use ‘bmp’ for the type as that is as good a name as any. Make this the default.

702 \@namedef{Gin@rule@*}#1{{bmp}{}{#1}}
703 \def\Ginclude@bmp#1{%
704 \raise\Gin@req@height\hbox{%
705 \special{anisoscale #1,
706 \the\Gin@req@width\space \the\Gin@req@height}}}

The only exception is EPS files, as they may be read for BoundingBox

707 \@namedef{Gin@rule@.ps}#1{{eps}{.ps}{#1}}
708 \@namedef{Gin@rule@.eps}#1{{eps}{.eps}{#1}}
709 \let\Ginclude@eps\Ginclude@bmp

Add a few default extensions so \includegraphics{a} will pick up a.eps or a.wmf. This list can be reset with \DeclareGraphicsExtensions. Other extensions not in the list may be used explicitly, eg \includegraphics{a.gif} should work as long as dviwin has access to a gif filter. If .gif is added us-

 ing \DeclareGraphicsExtensions then \includegraphics{a} would also find
 a.gif.
710 \def\Gin@extensions{.eps,.ps,.wmf,.tif}

711 ⟨/dviwin⟩

24 ln

A L^{A}TEX 2ε graphics driver file for B Hamilton Kelly’s ln03 driver. Untested, but based on the graphics macros distributed with the driver.

712 ⟨∗ln⟩

24.1 Graphic file inclusion

713 \def\Ginclude@sixel#1{\special{ln03:sixel #1}}

714 ⟨/ln⟩

25 trutex

A L^{A}TEX 2ε graphics driver file for Kinch ‘truetex’ driver.

715 ⟨∗truetex⟩

25.1 Colour

Uses the ‘color4’ colour code.

25.2 Graphic file inclusion

EPS File inclusion: DVIPS style.

716 \def\Ginclude@eps#1{%
717 \message{<#1>}%
718 \bgroup
719 \def\@tempa{!}%
720 \dimen@\Gin@req@width
721 \dimen@ii.1bp%
722 \divide\dimen@\dimen@ii
723 \@tempdima\Gin@req@height
724 \divide\@tempdima\dimen@ii
725  \special{PSfile="#1"\space
726  llx=\Gin@llx\space
727  lly=\Gin@lly\space
728  urx=\Gin@urx\space
729  ury=\Gin@ury\space
730  \ifx\Gin@scalex\@tempa\else rwi=\number\dimen@\space\fi
731  \ifx\Gin@scaley\@tempa\else rhi=\number\@tempdima\space\fi
732  \ifGin@clip clip\fi}%
733 \egroup}

bmp File Inclusion.

734 \def\Ginclude@bmp#1{%
735 \message{<#1>}%
736 \special{bmpfile #1}}

tif(f) File inclusion

737 \def\Ginclude@tiff#1{%
738 \message{<#1>}%
739 \special{tifffile #1}}

25.3 Literal PostScript

This is not supported, so uses ‘nops’ code.

25.4 Default Rules

Support (e)ps, tif and bmp, default to eps.

740 \def\Gin@extensions{.eps,.ps}
741 \@namedef{Gin@rule@.ps}#1{{eps}{.ps}{#1}}
742 \@namedef{Gin@rule@.eps}#1{{eps}{.eps}{#1}}
743 \@namedef{Gin@rule@.tif}#1{{tiff}{}{#1}}
744 \@namedef{Gin@rule@.bmp}#1{{bmp}{}{#1}}
745 \@namedef{Gin@rule@*}#1{{eps}{\Gin@ext}{#1}}

746 ⟨/truetex⟩

26 tcidvi

A L^{A}TEX 2ε graphics driver file for Scientific Word/Workplace. Actually for the Kinch truetex driver, augmented with extra \special handling with the DLL supplied with SW.

747 ⟨∗tcidvi⟩

26.1 Colour

Uses the ‘color4’ colour code.

The above colours are handled by the Kinch-supplied dll The TCI dll adds support for \colorbox, but only grey scale The code below accepts any color model, but only the red component is used.

748 \AtBeginDocument{\def\color@block#1#2#3{%
749 {\rlap{\ifcolors@
750  \@defaultunits\count@\current@color\@nnil
751  \dimen@\count@\p@
752  \divide\dimen@\@cclv
753  \dimen@ii#2%
754  \advance\dimen@ii#3%
755  \lower#3\hbox{%

756  \special{language "Scientific Word";%
757  type "greybox";%
758  greyscale \strip@pt\dimen@;%
759  height \the\dimen@ii;%
760  width \the#1;%
761  depth 0pt;}}%
762  \fi}}}}

26.2 Graphic file inclusion

EPS File inclusion.

763 \def\Ginclude@eps#1{%
764 \message{<#1>}%
765 \raise\Gin@req@height\hbox{%

If the bounding box has been changed by a trim or viewport key then need to calculate the crop ratios based on the original bb coordinates. (This assumes that clip key is also used).

766 \ifx\Gin@ollx\@undefined
767 \else
768  \@tempdimb \Gin@ourx bp%
769  \advance\@tempdimb-\Gin@ollx bp%
770  \@tempdima\Gin@llx bp%
771  \advance\@tempdima-\Gin@ollx bp%
772  \Gscale@div\TCI@cropleft\@tempdima\@tempdimb
773  \@tempdima\Gin@urx bp%
774  \advance\@tempdima-\Gin@ollx bp%
775  \Gscale@div\TCI@cropright\@tempdima\@tempdimb
776  \@tempdimb \Gin@oury bp%
777  \advance\@tempdimb-\Gin@olly bp%
778  \@tempdima\Gin@lly bp%
779  \advance\@tempdima-\Gin@olly bp%
780  \Gscale@div\TCI@cropbottom\@tempdima\@tempdimb
781  \@tempdima\Gin@ury bp%
782  \advance\@tempdima-\Gin@olly bp%
783  \Gscale@div\TCI@croptop\@tempdima\@tempdimb
784 \fi
785  \special{%
786  language \TCI@language;%
787  type \TCI@type;%
788  valid_file \TCI@validfile;%
789  width \the\Gin@req@width;%
790  height \the\Gin@req@height;%
791  depth 0pt;%
792  original-width \the\Gin@nat@width;%
793  original-height \the\Gin@nat@height;%
794  cropleft "\TCI@cropleft";%
795  croptop "\TCI@croptop";%
796  cropright "\TCI@cropright";%

797  cropbottom "\TCI@cropbottom";%
798  filename '#1';%
799  \ifx\TCI@temp\@empty\else tempfilename \TCI@temp;\fi
800  }}}

Default values so documents produced elsewhere should work

801 \def\TCI@language{"Scientific Word"}
802 \def\TCI@type{"GRAPHIC"}
803 \def\TCI@validfile{'F'}
804 \def\TCI@cropleft{0}
805 \def\TCI@croptop{1}
806 \def\TCI@cropright{1}
807 \def\TCI@cropbottom{0}
808 \let\TCI@temp\@empty

Non PS Graphic files.

File inclusion macro is always the same. Use a different name though as LaTeX thinks it can read eps files for BoundingBox.

809 \let\Ginclude@bmp\Ginclude@eps

26.3 Literal PostScript

This is not supported, so uses ‘nops’ code.

26.4 Default Rules

SW always gives the full name with extension. So leave this list empty.

810 \def\Gin@extensions{}

.ps .PS .eps .EPS are (E)PS rest are ‘bmp’ which is a catch all type for anything that the inport filter can handle.

811 \@namedef{Gin@rule@.ps}#1{{eps}{.ps}{#1}}
812 \@namedef{Gin@rule@.eps}#1{{eps}{.eps}{#1}}
813 \@namedef{Gin@rule@.PS}#1{{eps}{.PS}{#1}}
814 \@namedef{Gin@rule@.EPS}#1{{eps}{.EPS}{#1}}
815 \@namedef{Gin@rule@*}#1{{bmp}{\Gin@ext}{#1}}

816 ⟨/tcidvi⟩

27 Literal Postscript

Most drivers writing to PostScript allow some form of ‘literal’ PostScript \special that inserts code into the final PostScript output. However Non-PS drivers can not support this (and some PS one’s can’t either). The code here makes all these commands no ops. Individual driver sections may define the commands to do something useful.

817 ⟨∗nops⟩

Raw PostScript code, no save/restore. Coordinate system unspecified.

818 \def\Gin@PS@raw#1{}

PostScript code, to be surrounded by save/restore by the driver. Coordinate system standard PostScript, but with origin at current (TEX) position.

819 \def\Gin@PS@restored#1{}

PostScript code to be inserted in the Header section of the final PostScript. Must be issued on the first page of a document.

820 \def\Gin@PS@literal@header#1{}

Name of external file, the contents of which are to be inserted in the Header section of the final PostScript. Must be issued on the first page of a document.

821 \def\Gin@PS@file@header#1{}

822 ⟨/nops⟩

28 Grahics Inclusion Rules

823 ⟨∗psrules⟩

824 \def\Gin@extensions{.eps,.ps}
825 \@namedef{Gin@rule@.ps}#1{{eps}{.ps}{#1}}
826 \@namedef{Gin@rule@.eps}#1{{eps}{.eps}{#1}}
827 \@namedef{Gin@rule@*}#1{{eps}{\Gin@ext}{#1}}

828 ⟨/psrules⟩ 829 ⟨∗psrulesZ⟩

830 \def\Gin@extensions{.eps,.ps,.eps.gz,.ps.gz,.eps.Z}
831 \@namedef{Gin@rule@.ps}#1{{eps}{.ps}{#1}}
832 \@namedef{Gin@rule@.eps}#1{{eps}{.eps}{#1}}
833 \@namedef{Gin@rule@.pz}#1{{eps}{.bb}{`gunzip -c #1}}
834 \@namedef{Gin@rule@.eps.Z}#1{{eps}{.eps.bb}{`gunzip -c #1}}
835 \@namedef{Gin@rule@.ps.Z}#1{{eps}{.ps.bb}{`gunzip -c #1}}
836 \@namedef{Gin@rule@.ps.gz}#1{{eps}{.ps.bb}{`gunzip -c #1}}
837 \@namedef{Gin@rule@.eps.gz}#1{{eps}{.eps.bb}{`gunzip -c #1}}
838 \@namedef{Gin@rule@*}#1{{eps}{\Gin@ext}{#1}}

839 ⟨/psrulesZ⟩ 840 ⟨∗dosrules⟩

841 ⟨!psrulesZ⟩\def\Gin@extensions{.eps,.ps,.pcx,.bmp}
842 \@namedef{Gin@rule@.pcx}#1{{bmp}{}{#1}}
843 \@namedef{Gin@rule@.bmp}#1{{bmp}{}{#1}}
844 \@namedef{Gin@rule@.msp}#1{{bmp}{}{#1}}

845 ⟨/dosrules⟩ 846 ⟨∗macrules⟩

847 \def\Gin@extensions{{},.ps,.eps,.pict}
848 \@namedef{Gin@rule@.ps}#1{{eps}{.ps}{#1}}

849 \@namedef{Gin@rule@.eps}#1{{eps}{.eps}{#1}}
850 \@namedef{Gin@rule@.pict}#1{{pict}{}{#1}}
851 \@namedef{Gin@rule@.pntg}#1{{pntg}{}{#1}}
852 \@namedef{Gin@rule@}#1{{pict}{\relax}{#1}}

853 ⟨/macrules⟩ 854 ⟨∗tiffrules⟩

855 \@namedef{Gin@rule@.tif}#1{{tiff}{}{#1}}

856 ⟨/tiffrules⟩