/ [pdftex-def] / trunk / pdftex.def
To checkout: svn checkout http://svn.gnu.org.ua/sources/pdftex-def/trunk/pdftex.def
Puszcza

Contents of /trunk/pdftex.def

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1 - (show annotations)
Wed Mar 7 12:42:12 2012 UTC (9 years, 8 months ago) by oberdiek
File size: 55431 byte(s)
* Main repository structure with trunk, tags and branches.
* Import of the available versions I have.

1 \ProvidesFile{pdftex.def}[2011/05/28 v0.06e Graphics/color for pdfTeX]
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3 %%
4 %% LaTeX Colour and Graphics support for PDFTeX
5 %%
6 %% License
7 %% =======
8 %%
9 %% Copyright (C) 2000-2011 David Carlisle, Sebastian Rahtz, Hans Hagen,
10 %% Heiko Oberdiek and Martin Schr\"oder
11 %%
12 %% This work may be distributed and/or modified under the
13 %% conditions of the LaTeX Project Public License, either version 1.3c
14 %% of this license or (at your option) any later version.
15 %% The latest version of this license is in
16 %% http://www.latex-project.org/lppl.txt
17 %% and version 1.3c or later is part of all distributions of LaTeX
18 %% version 2005/12/01 or later.
19 %%
20 %% This work has the LPPL maintenance status `maintained'.
21 %%
22 %% The Current Maintainer of this work is
23 %% Heiko Oberdiek and Martin Schr\"oder.
24 %%
25 %% This work consists of the file pdftex.def.
26 %%
27 %% Usage
28 %% =====
29 %%
30 %% It may be used by specifying the pdftex option to any of the
31 %% supported packages, for example:
32 %%
33 %% \usepackage[pdftex]{graphicx}
34 %%
35 %% * pdfTeX determines the bounding box of the images by means of
36 %% itself. Therefore the bounding box options should not be used.
37 %% In this cases a warning is issued and viewport is used instead.
38 %% * Option "page" (graphicx) for selecting a page of a multipage
39 %% PDF document.
40 %% * \pagecolor is supported. \nopagecolor disables the page color.
41 %% * Option "quiet" (graphicx/experimental): log messages are suppressed.
42 %% * Option "resolution" (graphicx/experimental): this sets
43 %% \pdfimageresolution, see pdfTeX documentation.
44 %% * Option "print" (graphicx/experimental): specifies an alternate
45 %% print image (bitmaps only), see PDF specification.
46 %% * pdftex.def can be used under plain-TeX with miniltx support.
47 %%
48 %% "Experimental" means that these features can change or vanish
49 %% in later versions.
50 %%
51 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
52 %
53 % History
54 % ...
55 % 2000/04/20 v0.02s:
56 % * gray color model directly supported (HO).
57 % 2000/05/02 v0.02t:
58 % * \pagecolor supported (HO).
59 % 2000/05/12 v0.02u:
60 % * support for multipage pdf files, option `page' added (HO).
61 % 2000/05/31 v0.02v:
62 % * Option `page' is defined at begin document,
63 % if package `keyval' is loaded after `pdftex.def'.
64 % 2000/06/16 v0.03a:
65 % * Added Heiko to author list (DPC).
66 % 2000/08/31 v0.03b:
67 % * support for alternate print images: option `print' added (HO).
68 % * This feature is not supported by Ghostscript, xpdf, or AR3.
69 % * The images should have the same dimensions/resolution.
70 % * Two experimental options added (HO):
71 % * `quiet': log messages are suppressed.
72 % * `resolution': sets \pdfimageresolution.
73 % Because these options are not supported by graphicx,
74 % they have to be set after \usepackage{graphicx}, eg.
75 % \setkeys{Gin}{quiet,resolution=300}
76 % Option `quiet' (for pdftex) can be make known to graphic{s,x}
77 % with this line in graphics.cfg:
78 % \DeclareOption{quiet}{\let\Gin@log\@gobble}
79 % Caution: both options are experimental and can be
80 % change in next versions!
81 % * \pdfpage{width,height} are only set, if \paperwidth
82 % is defined (HO).
83 % 2000/09/04 v0.03c
84 % * Redefinition of `natwidth' and `natheight' \AtBeginDocument (HO).
85 % 2000/09/14 v0.03d
86 % * Fixes for `viewport' and `trim' (HO).
87 % * Clip support added for viewport and trim (HO).
88 % 2000/09/14 v0.03e
89 % * Options `bbllx', `bblly', `bburx', `bbury' disabled,
90 % option `bb' redirected with a warning to `viewport' (HO).
91 % 2000/11/10 v0.03f
92 % * Bug, that produces an error message, if package `graphics'
93 % is used (introduced in 0.03d), fixed: If \Gin@vllx is not
94 % defined (graphics), then clipping and the moves of options
95 % viewport/trim are silently disabled (HO).
96 % 2001/05/25 v0.03g
97 % * \pdfpagewidth and \pdfpageheight are not set to zero,
98 % if \paperwidth and \paperheight are not set (HO).
99 % 2001/09/01 v0.03h
100 % * Compatibilty for miniltx.tex, problems fixed:
101 % \@ifpackageloaded, \PackageWarning, \PackageWarningNoLine,
102 % \@currname.
103 % 2001/11/29 v0.03i
104 % * Problem with \if@inlabel (plain format) fixed.
105 % 2002/06/18 v0.03j
106 % * Contribution by P\'etiard Fran\c{c}ois <petiard@math.univ-fcomte.fr>:
107 % Improvement of \Ginclude@mps (support of viewport and clip).
108 % 2002/06/19 v0.03k
109 % * Correction by P\'etiard Fran\c{c}ois for \GPT@DoEndClip.
110 % 2005/06/15 v0.03l
111 % * \usebox patch fixed (\aftergroup part removed) (HO).
112 % 2005/06/20 v0.03m
113 % * .tif support is removed for pdfTeX >= 1.10a (HO).
114 % 2006/02/23 v0.03n
115 % * Compatibility for plain-TeX: file can be loaded multiple times;
116 % colorfix is not applied for undefined macros (HO).
117 % 2006/02/24 v0.03o
118 % * Catcode protections mainly because of babel's shorthands (HO).
119 % 2006/03/02 v0.03p
120 % * \pagecolor support for plain-TeX fixed (HO).
121 % 2006/05/17 v0.03q
122 % * Error message if ConTeXt's supp-pdf.tex is missing and
123 % support of MPS files is not available (Markus Kohm = MK, HO).
124 % 2006/06/06 v0.03r
125 % * \nopagecolor/\no@page@color added (HO).
126 % 2006/07/16 v0.03s (HO)
127 % * LPPL 1.3c.
128 % * A little usage.
129 % * Test for \MessageBreak changed (comp.text.tex,
130 % message id: <44baca88$0$10529$9b4e6d93@newsread4.arcor-online.net>).
131 % 2006/08/14 v0.03t (HO)
132 % * Extensions added: .jpeg, .JPG, .JPEG, .PNG, .PDF
133 % No variants for .tif, because TIFF support is no longer available.
134 % No need for uppercase variant of .mps.
135 % 2007/01/01 v0.04a (HO)
136 % * Support of color stack, introduced in pdfTeX 1.40.0.
137 % * Support of transform matrix commands of pdfTeX 1.40.0.
138 % * The argument for option `page' can be a register.
139 % 2007/01/02 v0.04b (HO)
140 % * Internal change: Switching of color stacks is easier by using
141 % \@pdfcolorstack for the stack number. Thus this command
142 % should be redefined, if someone wants to use another color stack
143 % (e.g. for footnotes). \main@pdfcolorstack should not be changed
144 % for this purpose.
145 % 2007/01/06 v0.04c (HO)
146 % * Support for JBIG2 added (pdfTeX 1.40.0).
147 % 2007/01/08 v0.04d (HO)
148 % * Bug fix: .mps forgotten for extension list if pdfTeX >= 1.40.0
149 % * .jbig2 and .jb2 are not listed in the extension list
150 % if \pdfminorversion < 4. Thus \pdfminorversion should have
151 % the correct value, if pdftex.def is loaded.
152 % 2007/03/15 v0.04e (HO)
153 % * Missing comma in \Gin@extensions added (found by Reinhard Kotucha).
154 % 2007/04/06 v0.04f (HO)
155 % * Fix for \pagecolor, text before page color can lead to an invalid
156 % page stream. Therefore "page" is now used instead of "direct"
157 % as modifier for \pdfliteral.
158 % * Boolean option `resetcolor' added (pdfTeX >= 0.12n).
159 % The current color is used for PDF or MPS images, unless
160 % the images contain their own color settings.
161 % If option `resetcolor' is set to `true', then the current color
162 % is reset to \normalcolor during image inclusion.
163 % 2007/04/17 v0.04g (HO)
164 % * Small improvement of robustness of \pagecolor
165 % and using e-TeX if available.
166 % 2007/06/12 v0.04h (HO)
167 % * Fix for \pagecolor: v0.04f uses keyword `page' for \pdfliteral,
168 % but this keyword is not available before pdfTeX 1.30.0.
169 % 2007/12/04 v0.04i (HO)
170 % * Fatal error is avoided if image file does not exists.
171 % 2007/12/06 v0.04j (HO)
172 % * Option xmpfile added for adding metadata (experimental).
173 % 2008/07/16 v0.04k (HO)
174 % * \LoadMetaPostSpecialExtensions
175 % loads additional support for MetaPost images (transparency)
176 % by loading supp-mpe.tex and supp-mis.tex
177 % (method posted in comp.text.tex by Jeremy Lea).
178 % As side effect MetaPost images are put in separate objects
179 % and are not inlined in the page stream.
180 % Status: experimental.
181 % 2008/09/08 v0.04l (HO)
182 % * Adds an error message, if pdfTeX is called in DVI mode.
183 % * Aborts loading of the package with an error message,
184 % if pdfTeX is missing.
185 % 2009/08/25 v0.04m (HO)
186 % * Catcodes are preserved and initialized for loading of
187 % pdftex.def and ConTeXt's support files.
188 % * ConTeXt's support files have now the extension `.mkii' instead
189 % of `.tex'.
190 % 2010/02/14 v0.04n (HO)
191 % * \GPT@catcodes extended for xmlTeX (pdftex.def loads
192 % supp-pdf.mkii at begin document where xmlTeX's catcodes
193 % are already active).
194 % 2010/03/11 v0.04o (HO)
195 % * Ensure that \undefined is undefined during loading of
196 % ConTeXt files.
197 % 2010/03/12 v0.04p (HO)
198 % * \undefined is also undefined during conversion of MPS.
199 % 2010/04/14 v0.04q (HO)
200 % * Optimizations for rotating and scaling:
201 % * remove unnecessary identity transformations
202 % * numbers are normalized
203 % 2010/04/15 v0.04r (HO)
204 % * Fix for scale values without integer part.
205 % 2010/09/09 v0.05a (HO)
206 % * Option `pagebox' added for specifying the pdf page box
207 % of the included image. Values are `mediabox', `cropbox',
208 % `bleedbox', `trimbox' and `artbox'. Default is `cropbox'. (MS/HO)
209 % * Option `interpolate' added for bitmaps, see PDF specification.
210 % Values are `true' or `false', default is `false'.
211 % * Option `decodearray' added for bitmaps, see PDF specification,
212 % key /Decode of image dictionaries. The value for option
213 % `decodearray' is the value for /Decode without `[' and ']'.
214 % * Option `maskarray' added for bitmaps, see PDF specification,
215 % key /Mask of image dictionaries with array as value.
216 % The value of `maskarray' is the array value for /Mask
217 % without `[' and ']'.
218 % * Option `intent' added for the rendering intent of bitmap
219 % images, see PDF specification, key /Intent of image
220 % dictionaries. The value is a name without a leading slash,
221 % the standard names of the PDF specification:
222 % `AbsoluteColorimetric', `RelativeColorimetric',
223 % `Saturation', `Perceptual'.
224 % * Options `ocobjnum' and `ocobjref' are hooks for those who wants
225 % to work with optional content. The options can be used for both
226 % bitmap and PDF images and are unsupported for MPS.
227 % The optional content dictionary is given by an external
228 % object. Option `ocobjnum' expects the number of that object
229 % (e.g. \pdflastobj). It's a positive integer (greater than zero).
230 % Option `ocobjref' takes the full object reference
231 % (positive integer, followed by ` 0 R' in case of pdfTeX).
232 % Other drivers might support `ocobjref' as well, in case of
233 % PostScript/pdfmark drivers, the object is usually referenced by
234 % a name in curly braces.
235 % * Tiff support removed for driver versions between 1.10a and 1.30.
236 % 2010/09/14 v0.05b (HO)
237 % * Fix, \pagecolor got broken accidentally (in v0.05a).
238 % 2010/11/26 v0.05c (HO)
239 % * \stockwidth and \stockheight of class `memoir' respected.
240 % 2011/01/28 v0.05d (HO)
241 % * Patching trig.sty is improved by doing it earlier in some
242 % cases, e.g. if one of class `memoir', package `scrlfile' or
243 % package `filehook' is loaded.
244 % 2011/04/21 v0.06a (HO)
245 % * The use info on the screen goes with an information
246 % entry in the .log file that also tells the requested
247 % width (feature request of Axel Berger).
248 % * Use of packages `infwarerr' and `ltxcmds'.
249 % 2011/04/25 v0.06b (HO)
250 % * Fix in \GPT@NormalizeNumber.
251 % * Date fixed in \ProvidesFile.
252 % 2011/05/18 v0.06c (HO)
253 % * The ConTeXt support files `supp-pdf.*' and `supp-mpe.*' do
254 % not prevent reloading. Therefore `pdftex.def' only tries to load
255 % them if \convertMPtoPDF and \assignMPStransparency are not
256 % available. This fixes a compatibilty issue with class `combine'.
257 % 2011/05/27 v0.06d (HO)
258 % * Fix for v0.06a, package `ltxcmds' was not loaded in plain TeX.
259 % 2011/05/28 v0.06e (HO)
260 % * Lonely \newcommand replaced by \def.
261 %
262 % Prefix of internal commands for this file `pdftex.def':
263 % \GPT@ (Graphics bundle PdfTex driver)
264
265 \expandafter\edef\csname GPT@AtEnd\endcsname{%
266 \expandafter\noexpand\csname GPT@restore@\endcsname
267 \catcode35 \the\catcode35\relax % #
268 \catcode64 \the\catcode64\relax % @
269 \noexpand\endinput
270 }
271 \catcode35 6 % #
272 \catcode64 11 % @
273 \def\GPT@catcodes#1{%
274 \expandafter\edef\csname GPT@restore@#1\endcsname{%
275 \let\noexpand\undefined
276 \expandafter\noexpand\csname GPTorg@#1@undefined\endcsname
277 \let\expandafter\noexpand\csname GPTorg@#1@undefined\endcsname
278 \noexpand\@undefined
279 \endlinechar \the\endlinechar
280 \catcode9 \the\catcode9 % tab
281 \catcode13 \the\catcode13 % ^^M
282 \catcode32 \the\catcode32 % space
283 \catcode33 \the\catcode33 % !
284 \catcode34 \the\catcode34 % "
285 \catcode35 \the\catcode35 % #
286 \catcode36 \the\catcode36 % $
287 \catcode37 \the\catcode37 % %
288 \catcode38 \the\catcode38 % &
289 \catcode39 \the\catcode39 % '
290 \catcode40 \the\catcode40 % (
291 \catcode41 \the\catcode41 % )
292 \catcode42 \the\catcode42 % *
293 \catcode43 \the\catcode43 % +
294 \catcode44 \the\catcode44 % ,
295 \catcode45 \the\catcode45 % -
296 \catcode46 \the\catcode46 % .
297 \catcode47 \the\catcode47 % /
298 \catcode58 \the\catcode58 % :
299 \catcode59 \the\catcode59 % ;
300 \catcode60 \the\catcode60 % <
301 \catcode61 \the\catcode61 % =
302 \catcode62 \the\catcode62 % >
303 \catcode63 \the\catcode63 % ?
304 \catcode64 \the\catcode64 % @
305 \catcode91 \the\catcode91 % [
306 \catcode92 \the\catcode92 % \
307 \catcode93 \the\catcode93 % ]
308 \catcode94 \the\catcode94 % ^
309 \catcode95 \the\catcode95 % _
310 \catcode96 \the\catcode96 % `
311 \catcode123 \the\catcode123 % {
312 \catcode124 \the\catcode124 % |
313 \catcode125 \the\catcode125 % }
314 \catcode126 \the\catcode126 % ~
315 }%
316 \endlinechar 13 %
317 \catcode9 10 % tab
318 \catcode13 5 % ^^M (end of line)
319 \catcode64 11 %
320 \catcode61 12 % =
321 \catcode32 10 % space
322 \catcode33 12 % !
323 \catcode34 12 % "
324 \catcode35 6 % #
325 \catcode36 3 % $
326 \catcode37 14 % %
327 \catcode38 4 % &
328 \catcode39 12 % '
329 \catcode40 12 % (
330 \catcode41 12 % )
331 \catcode42 12 % *
332 \catcode43 12 % +
333 \catcode44 12 % ,
334 \catcode45 12 % -
335 \catcode46 12 % .
336 \catcode47 12 % /
337 \catcode58 12 % :
338 \catcode59 12 % ;
339 \catcode60 12 % <
340 \catcode61 12 % =
341 \catcode62 12 % >
342 \catcode63 12 % ?
343 \catcode64 11 % @
344 \catcode91 12 % [
345 \catcode92 0 % \
346 \catcode93 12 % ]
347 \catcode94 7 % ^
348 \catcode95 8 % _
349 \catcode96 12 % `
350 \catcode123 1 % {
351 \catcode124 12 % |
352 \catcode125 2 % }
353 \catcode126 13 % ~
354 \expandafter\let\csname GPTorg@#1@undefined\endcsname\undefined
355 \let\undefined\@undefined
356 }
357 \GPT@catcodes{}
358
359 % 1.10a: .tif support was dropped
360 % 1.10a: keywords mediabox|cropbox|... for \pdfximage
361 % 1.30.0: keyword `page' for \pdfliteral added.
362 % 1.40.0: JBIG2 support added in pdfTeX 1.40.0
363
364 \ifx\pdftexversion\@undefined
365 \def\driver@release{1}%
366 \else
367 \ifnum\pdftexversion<12 %
368 \def\driver@release{2}%
369 \else
370 \ifnum\pdftexversion<13 %
371 \ifnum\expandafter`\pdftexrevision<`n %
372 \def\driver@release{3}%
373 \else
374 \def\driver@release{4}%
375 \fi
376 \else
377 \ifnum\pdftexversion=13 %
378 \def\driver@release{5}%
379 \else
380 \ifnum\pdftexversion=14 %
381 \def\driver@release{6}%
382 \else
383 \ifnum\pdftexversion<110 %
384 \def\driver@release{7}%
385 \else
386 \ifnum\pdftexversion<130 %
387 \def\driver@release{8}%
388 \else
389 \ifnum\pdftexversion<140 %
390 \def\driver@release{9}%
391 \else
392 \def\driver@release{10}%
393 \fi
394 \fi
395 \fi
396 \fi
397 \fi
398 \fi
399 \fi
400 \fi
401
402 \begingroup\expandafter\expandafter\expandafter\endgroup
403 \expandafter\ifx\csname RequirePackage\endcsname\relax
404 \input infwarerr.sty\relax
405 \input ltxcmds.sty\relax
406 \else
407 \RequirePackage{infwarerr}[2007/09/09]%
408 \RequirePackage{ltxcmds}[2010/12/07]%
409 \fi
410
411 \def\GPT@error{\@PackageError{pdftex.def}}%
412 \def\GPT@warn{\@PackageWarning{pdftex.def}}%
413 \ifx\Gin@log\@undefined
414 \def\Gin@log{\message}%
415 \fi
416 \def\GPT@info{\@PackageInfoNoLine{pdftex.def}}%
417
418 % Are we running under PDFTeX?
419 \ltx@IfUndefined{pdftexversion}{%
420 \GPT@error{%
421 Option `pdftex' requires pdfTeX,\MessageBreak
422 but pdfTeX features are missing.\MessageBreak
423 Loading of this driver file is aborted%
424 }\@ehc
425 \expandafter\GPT@AtEnd
426 }{}
427
428 % Ensure PDF mode
429 \ifnum\pdfoutput<1 %
430 \GPT@error{%
431 PDF mode expected, but DVI mode detected!\MessageBreak
432 If you are using `latex', then call `pdflatex'.\MessageBreak
433 Otherwise check and correct the driver options.\MessageBreak
434 Error recovery by switching to PDF mode%
435 }\@ehc
436 \pdfoutput=1 %
437 \fi
438
439 \ltx@IfUndefined{stockwidth}{%
440 \ltx@IfUndefined{paperwidth}{%
441 }{%
442 \ifdim\paperwidth>0pt\relax
443 \ifdim\paperheight>0pt\relax
444 \pdfpagewidth=\paperwidth
445 \pdfpageheight=\paperheight
446 \fi
447 \fi
448 }%
449 }{%
450 \ifdim\stockwidth>0pt\relax
451 \ifdim\stockheight>0pt\relax
452 \pdfpagewidth=\stockwidth
453 \pdfpageheight=\stockheight
454 \fi
455 \fi
456 }
457
458 % Colour Support. The following models may be used.
459 % * cmyk supported directly.
460 % * rgb supported directly.
461 % * RGB converted to rgb by this file.
462 % * gray supported directly.
463 % * named converted to cmyk by this file.
464 %
465 \def\c@lor@arg#1{%
466 \dimen@#1\p@
467 \ifdim\dimen@<\z@\dimen@\maxdimen\fi
468 \ifdim\dimen@>\p@
469 \PackageError{color}{Argument `#1' not in range [0,1]}\@ehd
470 \fi
471 }
472 \def\color@cmyk#1#2{\c@lor@@cmyk#2\@@#1}
473 \def\c@lor@@cmyk#1,#2,#3,#4\@@#5{%
474 \c@lor@arg{#4}%
475 \c@lor@arg{#1}%
476 \c@lor@arg{#2}%
477 \c@lor@arg{#3}%
478 \edef#5{#1 #2 #3 #4 k #1 #2 #3 #4 K}%
479 }
480 \def\color@gray#1#2{%
481 \c@lor@arg{#2}%
482 \edef#1{#2 g #2 G}%
483 }
484 \def\color@rgb#1#2{\c@lor@@rgb#2\@@#1}
485 \def\c@lor@@rgb#1,#2,#3\@@#4{%
486 \c@lor@arg{#1}%
487 \c@lor@arg{#2}%
488 \c@lor@arg{#3}%
489 \edef#4{#1 #2 #3 rg #1 #2 #3 RG}%
490 }
491 \def\color@RGB#1#2{\c@lor@@RGB#2\@@#1}
492 \def\c@lor@@RGB#1,#2,#3\@@#4{%
493 \c@lor@RGB@rgb{#1}\@tempa
494 \c@lor@RGB@rgb{#2}\@tempb
495 \c@lor@RGB@rgb{#3}\@tempc
496 \c@lor@@rgb\@tempa,\@tempb,\@tempc\@@#4%
497 }
498 \def\c@lor@RGB@rgb#1#2{%
499 \dimen@#1\p@
500 \divide\dimen@\@cclv
501 \edef#2{\strip@pt\dimen@}%
502 }
503
504 \def\color@named#1#2{\c@lor@@named#2,,\@@#1}
505 \def\c@lor@@named#1,#2,#3\@@#4{%
506 \ltx@IfUndefined{col@#1}{%
507 \PackageError{color}{Undefined color `#1'}\@ehd
508 }{%
509 \edef#4{\csname col@#1\endcsname}%
510 }%
511 }
512
513 \ltx@IfUndefined{pdfcolorstack}{%
514 \def\set@color{%
515 \pdfliteral{\current@color}%
516 \aftergroup\reset@color
517 }%
518 \def\reset@color{%
519 \pdfliteral{\current@color}%
520 }%
521 }{%
522 \chardef\main@pdfcolorstack=0 %
523 \ltx@ifundefined{@pdfcolorstack}{%
524 \def\@pdfcolorstack{\main@pdfcolorstack}%
525 }{}%
526 \def\set@color{%
527 \pdfcolorstack\@pdfcolorstack push{\current@color}%
528 \aftergroup\reset@color
529 }%
530 \def\reset@color{%
531 \pdfcolorstack\@pdfcolorstack pop\relax
532 }%
533 }
534 \def\define@color@named#1#2{%
535 \expandafter\edef\csname col@#1\endcsname{#2}%
536 }
537 \def\current@color{0 g 0 G}
538
539 % v0.02t: support for \pagecolor
540 % fixed in v0.02p by using a box register, see
541 % http://tug.org/pipermail/pdftex/2005-August/005916.html
542 %
543 % v0.03r: \nopagecolor/\no@page@color added.
544 \ltx@newglobalif\ifGPT@pagecolor
545 \ltx@ifundefined{nopagecolor}{%
546 \def\nopagecolor{\no@page@color}%
547 }{}
548 \def\no@page@color{%
549 \GPT@pagecolorfalse
550 }
551 \begingroup\expandafter\expandafter\expandafter\endgroup
552 \expandafter\ifx\csname currentgrouplevel\endcsname\relax
553 \catcode`X=9 % ignore
554 \catcode`E=14 % comment
555 \else
556 \catcode`X=14 % comment
557 \catcode`E=9 % ignore
558 \fi
559 \def\set@page@color{%
560 \GPT@pagecolortrue
561 \global\let\current@page@color\current@color
562 \ltx@ifundefined{GPT@outputbox}{%
563 % \newbox is outer in plain
564 \csname newbox\endcsname\GPT@outputbox
565 }{}%
566 \ltx@ifundefined{GPTorg@shipout}{%
567 \global\let\GPTorg@shipout\shipout
568 \gdef\shipout{%
569 X % ensure \GPT@outputbox is really void
570 X \begingroup
571 X \setbox\GPT@outputbox=\box\GPT@outputbox
572 X \endgroup
573 E \edef\GPT@saved@grouplevel{\number\currentgrouplevel}%
574 \afterassignment\GPT@shipout
575 \global\setbox\GPT@outputbox=%
576 }%
577 \gdef\GPT@shipout{%
578 X \ifvoid\GPT@outputbox\relax
579 E \ifnum\GPT@saved@grouplevel=\currentgrouplevel
580 E \else
581 \expandafter\aftergroup
582 \fi
583 \GPT@@shipout
584 }%
585 \gdef\GPT@@shipout{%
586 \ifvoid\GPT@outputbox\relax
587 \GPT@warn{Ignoring void output box}%
588 \else
589 \setbox\GPT@outputbox=\vbox{%
590 \GPT@pageliteral
591 \box\GPT@outputbox
592 }%
593 \GPTorg@shipout\box\GPT@outputbox\relax
594 \fi
595 }%
596 \gdef\GPT@pageliteral{%
597 \ifGPT@pagecolor
598 \pdfliteral\ifnum\driver@release>8 page\else direct\fi{%
599 q % gsave
600 \current@page@color\ltx@space
601 n % newpath
602 0 0 \strip@pt\pdfpagewidth\ltx@space
603 \strip@pt\pdfpageheight\ltx@space re % rectangle
604 % there is no need to convert to bp
605 f % fill
606 Q% grestore
607 }%
608 \fi
609 }%
610 }{}%
611 }
612 \catcode`\X=11 %
613 \catcode`\E=11 %
614
615 % Need the `colorfix' modifications as no internal colour stack
616 % is maintained
617 %<*colorfix>
618 \begingroup\expandafter\expandafter\expandafter\endgroup
619 \expandafter\ifx\csname pdfcolorstack\endcsname\relax
620 \AtBeginDocument{%
621 \begingroup\expandafter\expandafter\expandafter\endgroup
622 \expandafter\ifx\csname color\endcsname\relax
623 % Without color we don't need any fixes.
624 \else
625 \ltx@ifundefined{@ldc@l@r}{%
626 \let\@ldc@l@r\color
627 \def\color{%
628 \ltx@IfUndefined{if@inlabel}{}{%
629 \csname if@inlabel\expandafter\endcsname
630 \expandafter\leavevmode\csname fi\endcsname
631 }%
632 \@ldc@l@r
633 }%
634 }{}%
635 \ltx@ifundefined{@lduseb@x}{%
636 \ltx@IfUndefined{usebox}{}{%
637 \let\@lduseb@x\usebox
638 \def\usebox#1{\@lduseb@x{#1}\reset@color}%
639 }%
640 }{}%
641 \fi
642 }%
643 \fi
644 %</colorfix>
645
646 %
647 % Graphic inclusion. Currently supports .png, .jpg, .mps and .pdf inclusion;
648 % .tif support is dropped since pdfTeX 1.10a.
649 % .mps is MetaPost output.
650 % .mps inclusion depends on loading a CONTEXT module by Hans Hagen;
651 % .pdf also needs a Context module unless pdftex 0.12n or later.
652 %
653 % PNG bitmaps may be scaled/rotated as usual
654 % by the graphics commands or keyword arguments.
655 %
656 % Note the magic in front of the file name after \pdfimage, to
657 % prevent it fouling up with file names starting with "depth".
658 \def\Gread@png{%
659 \GPT@read\Gread@@png
660 }
661 \def\Gread@@png#1{%
662 \setbox\@tempboxa\hbox{%
663 \pdfimage\noexpand\noexpand\noexpand\ltx@empty#1\relax
664 }%
665 \def\Gin@llx{0}\let\Gin@lly\Gin@llx
666 \Gin@defaultbp\Gin@urx{\wd\@tempboxa}%
667 \Gin@defaultbp\Gin@ury{\ht\@tempboxa}%
668 }
669
670 %
671 % support for
672 % * multipage pdf images (pdfTeX v0.14+)
673 % * alternate print image (bitmaps only)
674 % * driver version>=5 (0.14)
675 % * printed image can be resused, but not the base image,
676 % because it's dictionary contains the additional key /Alternates.
677 % * not supported by Ghostscript or xpdf.
678 % * option quiet
679 % * option resetcolor
680 % * option xmpfile
681 %
682 % \GPT@page: page number of pdf image or \ltx@empty otherwise.
683 \let\GPT@page\ltx@empty
684 % \GPT@print: file name for alternate image or \ltx@empty otherwise.
685 \let\GPT@print\ltx@empty
686 \let\GPT@xmpfile\ltx@empty
687 \let\GPT@pagebox\ltx@empty
688 \let\GPT@pagebox@\ltx@empty
689 \let\GPT@interpolate\ltx@empty
690 \let\GPT@decodearray\ltx@empty
691 \let\GPT@mask\ltx@empty
692 \let\GPT@intent\ltx@empty
693 \let\GPT@ocobjnum\ltx@empty
694 \ltx@newif\ifGPT@ResetColor
695 \let\GPT@ResetColorEnd\relax
696 \def\GPT@ResetColorBegin{%
697 \ifGPT@ResetColor
698 \ifGPT@IsBitmap
699 \else
700 \begingroup
701 \normalcolor
702 \let\GPT@ResetColorEnd\endgroup
703 \fi
704 \fi
705 }
706 \begingroup\expandafter\expandafter\expandafter\endgroup
707 \expandafter\ifx\csname pdfmatch\endcsname\relax
708 \def\GPT@match#1#2#3#4{}%
709 \def\GPT@pat@real/{}%
710 \else
711 \def\GPT@match#1#2{%
712 \ifnum\pdfmatch{#2}{#1}=1 %
713 \expandafter\ltx@firstoftwo
714 \else
715 \expandafter\ltx@secondoftwo
716 \fi
717 }%
718 \def\GPT@pat@real/{%
719 (%
720 0(\ltx@backslashchar.[0-9]*)?|%
721 \ltx@backslashchar.[0-9]+|%
722 1(\ltx@backslashchar.0*)?%
723 )%
724 }%
725 \fi
726 \begingroup
727 \toks@{%
728 \define@key{Gin}{resetcolor}[true]{%
729 \csname GPT@ResetColor%
730 \expandafter\ifx\csname iftrue\expandafter\endcsname
731 \csname if#1\endcsname
732 true%
733 \else
734 false%
735 \fi
736 \endcsname
737 }%
738 \ifnum\driver@release>5 %
739 \define@key{Gin}{page}{%
740 \def\GPT@page{#1}%
741 \ifx\GPT@page\ltx@empty
742 \else
743 \edef\GPT@page{\number\GPT@page}%
744 \fi
745 }%
746 \define@key{Gin}{print}{%
747 \def\GPT@print{#1}%
748 }%
749 \else
750 \define@key{Gin}{page}{%
751 \GPT@warn{%
752 pdfTeX >= 0.14 required for option\MessageBreak `page'%
753 }%
754 }%
755 \define@key{Gin}{print}{%
756 \GPT@warn{%
757 pdfTeX >= 0.14 required for option\MessageBreak `print'%
758 }%
759 }%
760 \fi
761 \ifnum\driver@release>7 %
762 % option pagebox
763 \define@key{Gin}{pagebox}{%
764 \expandafter\let\expandafter\GPT@pagebox
765 \csname GPT@pagebox@#1\endcsname
766 \ifx\GPT@pagebox\relax
767 \let\GPT@pagebox\ltx@empty
768 \GPT@warn{%
769 Unknown value `#1' for `pagebox'.\MessageBreak
770 Supported values:\MessageBreak
771 mediabox, cropbox, bleedbox, trimbox, artbox%
772 }%
773 \fi
774 }%
775 \def\GPT@pagebox@mediabox{mediabox}%
776 \let\GPT@pagebox@cropbox\ltx@empty
777 \def\GPT@pagebox@bleedbox{bleedbox}%
778 \def\GPT@pagebox@trimbox{trimbox}%
779 \def\GPT@pagebox@artbox{artbox}%
780 % option interpolate
781 \define@key{Gin}{interpolate}[true]{%
782 \expandafter\let\expandafter\GPT@interpolate
783 \csname GPT@interpolate@#1\endcsname
784 \ifx\GPT@interpolate\relax
785 \let\GPT@interpolate\ltx@empty
786 \GPT@warn{%
787 Unknown value `#1' for `interpolate'.\MessageBreak
788 Supported values: true, false%
789 }%
790 \fi
791 }%
792 \let\GPT@interpolate@false\ltx@empty
793 \def\GPT@interpolate@true{1}% non-empty, value does not matter
794 % option decodearray
795 \define@key{Gin}{decodearray}{%
796 \def\GPT@decodearray{#1}%
797 \ifx\GPT@decodearray\ltx@empty
798 \else
799 \GPT@match\GPT@decodearray{%
800 ((^| )\GPT@pat@real/ \GPT@pat@real/)+$%
801 }{}{%
802 \GPT@warn{%
803 Invalid value (\GPT@decodearray)\MessageBreak
804 for `decodearray' is ignored%
805 }%
806 \let\GPT@decodearray\ltx@empty
807 }%
808 \fi
809 }%
810 % option maskarray
811 \define@key{Gin}{maskarray}{%
812 \def\GPT@mask{#1}%
813 \ifx\GPT@mask\ltx@empty
814 \else
815 \GPT@match\GPT@mask{%
816 ((^| )[0-9]+ [0-9]+)+$%
817 }{}{%
818 \GPT@warn{%
819 Invalid value (\GPT@mask)\MessageBreak
820 for `maskarray' is ignored%
821 }%
822 \let\GPT@mask\ltx@empty
823 }%
824 \ifx\GPT@mask\ltx@empty
825 \else
826 \edef\GPT@mask{[\GPT@mask]}%
827 \fi
828 \fi
829 }%
830 % option intent
831 \define@key{Gin}{intent}{%
832 \def\GPT@intent{#1}%
833 \ifx\GPT@intent\ltx@empty
834 \else
835 \GPT@match\GPT@intent{%
836 ^((Absolute|Relative)Colorimetric|Saturation|Perceptual)$%
837 }{}{%
838 \GPT@match\GPT@intent{%
839 ^[A-Za-z0-9_]+$%
840 }{%
841 \GPT@warn{%
842 Rendering intent `\GPT@intent'\MessageBreak
843 is not a standard name of the PDF specification%
844 }%
845 }{%
846 \GPT@warn{%
847 Ignoring intent `\GPT@intent'\MessageBreak
848 with unusual characters%
849 }%
850 \let\GPT@intent\ltx@empty
851 }%
852 }%
853 \fi
854 }%
855 % option ocobjnum
856 \define@key{Gin}{ocobjnum}{%
857 \edef\GPT@ocobjnum{#1}%
858 \ifx\GPT@ocobjnum\ltx@empty
859 \else
860 \edef\GPT@ocobjnum{\number\GPT@ocobjnum}%
861 \GPT@match\GPT@ocobjnum{^[1-9]+[0-9]*$}{%
862 }{%
863 \GPT@warn{%
864 Invalid value (\GPT@ocobjnum)\MessageBreak
865 for `ocobjnum' is ignored%
866 }%
867 \let\GPT@ocobjnum\ltx@empty
868 }%
869 \ifx\GPT@ocobjnum\ltx@empty
870 \else
871 \edef\GPT@ocobjnum{\number\GPT@ocobjnum}%
872 \fi
873 \fi
874 }%
875 % option ocobjref
876 \define@key{Gin}{ocobjref}{%
877 \edef\GPT@ocobjnum{#1}%
878 \ifx\GPT@ocobjnum\ltx@empty
879 \else
880 \edef\GPT@ocobjnum{%
881 \expandafter\strip@prefix\meaning\GPT@ocobjnum
882 }%
883 \GPT@match\GPT@ocobjnum{^[1-9]+[0-9]* 0 R$}{%
884 }{%
885 \GPT@warn{%
886 Invalid value (\GPT@ocobjnum)\MessageBreak
887 for `ocobjref' is ignored%
888 }%
889 \let\GPT@ocobjnum\ltx@empty
890 }%
891 \ifx\GPT@ocobjnum\ltx@empty
892 \else
893 \begingroup
894 \def\GPT@temp##1 ##2\@nil{\endgroup
895 \def\GPT@ocobjnum{##1}%
896 }%
897 \expandafter\GPT@temp\GPT@ocobjnum\@nil
898 \edef\GPT@ocobjnum{\number\GPT@ocobjnum}%
899 \fi
900 \fi
901 }%
902 \else
903 \def\GPT@temp#1{%
904 \define@key{Gin}{#1}{%
905 \GPT@warn{%
906 pdfTeX >= 1.10a required for option `#1'%
907 }%
908 }%
909 }%
910 \GPT@temp{pagebox}%
911 \GPT@temp{interpolate}%
912 \GPT@temp{decodearray}%
913 \GPT@temp{maskarray}%
914 \GPT@temp{intent}%
915 \GPT@temp{ocobjnum}%
916 \GPT@temp{ocobjref}%
917 \fi
918 \define@key{Gin}{quiet}[]{%
919 \let\Gin@log\ltx@gobble
920 }%
921 \define@key{Gin}{resolution}{%
922 \pdfimageresolution#1\relax
923 }%
924 \define@key{Gin}{xmpfile}[\Gin@base.xmp]{%
925 \def\GPT@xmpfile{#1}%
926 }%
927 }%
928 \ltx@IfUndefined{define@key}{%
929 \edef\x{\endgroup
930 \noexpand\AtBeginDocument{%
931 \noexpand\ltx@IfUndefined{define@key}{}{\the\toks@}%
932 }%
933 }\x
934 }{%
935 \expandafter\endgroup\the\toks@
936 }%
937
938 % redefinitions of some graphicx options:
939 \def\GPT@disable#1{%
940 \GPT@warn{%
941 Option `#1' is not supported, use\MessageBreak
942 option `viewport' instead%
943 }%
944 }
945 \def\GPT@fix{%
946 \begingroup\expandafter\expandafter\expandafter\endgroup
947 \expandafter\ifx\csname define@key\endcsname\relax
948 \else
949 \def\KV@Gin@bb{%
950 \GPT@warn{%
951 Option `bb' does not make sense,\MessageBreak
952 using `viewport' instead%
953 }%
954 \KV@Gin@viewport
955 }%
956 \define@key{Gin}{bbllx}{\GPT@disable{bbllx}}%
957 \define@key{Gin}{bblly}{\GPT@disable{bblly}}%
958 \define@key{Gin}{bburx}{\GPT@disable{bburx}}%
959 \define@key{Gin}{bbury}{\GPT@disable{bbury}}%
960 \fi
961 }
962 \AtBeginDocument{\GPT@fix}
963
964 %
965 % Check for image file existence
966 %
967 \begingroup\expandafter\expandafter\expandafter\endgroup
968 \expandafter\ifx\csname pdffilesize\endcsname\relax
969 \ifnum\driver@release>9 %
970 \RequirePackage{pdftexcmds}\relax
971 \fi
972 \begingroup\expandafter\expandafter\expandafter\endgroup
973 \expandafter\ifx\csname pdf@filesize\endcsname\relax
974 \def\GPT@IfFileExists#1{%
975 \IfFileExists{#1}%
976 }%
977 \else
978 \def\GPT@IfFileExists#1{%
979 \expandafter\expandafter\expandafter\ifx
980 \expandafter\expandafter\expandafter\relax\pdf@filesize{#1}\relax
981 \expandafter\ltx@secondoftwo
982 \else
983 \expandafter\ltx@firstoftwo
984 \fi
985 }%
986 \fi
987 \else
988 \def\GPT@IfFileExists#1{%
989 \expandafter\ifx\expandafter\relax\pdffilesize{#1}\relax
990 \expandafter\ltx@secondoftwo
991 \else
992 \expandafter\ltx@firstoftwo
993 \fi
994 }%
995 \fi
996
997 %
998 % Wrapper for \Gread@... that checks image existence first.
999 %
1000 \def\GPT@read#1#2{%
1001 \GPT@IfFileExists{#2}%
1002 {%
1003 #1{#2}%
1004 }{%
1005 \def\Gin@llx{0}%
1006 \let\Gin@lly\Gin@llx
1007 \def\Gin@urx{72}%
1008 \let\Gin@ury\Gin@urx
1009 \ifGin@draft
1010 \else
1011 \GPT@error{File `#2' not found}{%
1012 Using draft setting for this image.\MessageBreak
1013 \@ehc
1014 }%
1015 \Gin@drafttrue
1016 \fi
1017 }%
1018 }
1019
1020 %
1021 % mechanism for re-use of objects also
1022 % allows us to get the size by deriving it from the initial storage;
1023 % this works for all graphics types.
1024 %
1025 \ltx@ifundefined{Gread@gobject}{%
1026 \csname newcount\endcsname\Gread@gobject
1027 }{}
1028 \def\GPT@ReusedName#1{%
1029 \ifx\GPT@print\ltx@empty
1030 #1%
1031 \else
1032 \GPT@print
1033 \fi
1034 }
1035 \def\GPT@objref{ 0 R}
1036 \def\Gread@pdftex{%
1037 \GPT@read\Gread@@pdftex
1038 }
1039 \def\Gread@@pdftex#1{%
1040 % Ensure that option `print' works only on bitmap images.
1041 \let\GPT@Attr\ltx@empty
1042 \let\GPT@AttrShort\ltx@empty
1043 \ifnum\driver@release>7 %
1044 \ifx\GPT@ocobjnum\ltx@empty
1045 \else
1046 \edef\GPT@AttrShort{\GPT@AttrShort
1047 :OC\GPT@ocobjnum
1048 }%
1049 \edef\GPT@Attr{\GPT@Attr
1050 /OC \GPT@ocobjnum\GPT@objref
1051 }%
1052 \fi
1053 \fi
1054 \ifGPT@IsBitmap
1055 \let\GPT@page\ltx@empty
1056 \let\GPT@pagebox\ltx@empty
1057 \ifnum\driver@release>7 %
1058 \ifx\GPT@xmpfile\ltx@empty
1059 \else
1060 \ltx@IfUndefined{GPT@XMP@\GPT@xmpfile}{%
1061 \GPT@IfFileExists{\GPT@xmpfile}{%
1062 \begingroup
1063 \pdfcompresslevel=0 %
1064 \immediate\pdfobj stream attr{%
1065 /Type/Metadata%
1066 /Subtype/XML%
1067 }file{\GPT@xmpfile}%
1068 \expandafter\xdef\csname GPT@XMP@\GPT@xmpfile\endcsname{%
1069 \the\pdflastobj
1070 }%
1071 \endgroup
1072 }{%
1073 \GPT@warn{Missing XMP file (\GPT@xmpfile)}%
1074 }%
1075 }{}%
1076 \ltx@IfUndefined{GPT@XMP@\GPT@xmpfile}{}{%
1077 \edef\GPT@Attr{\GPT@Attr
1078 /Metadata \@nameuse{GPT@XMP@\GPT@xmpfile}\GPT@objref
1079 }%
1080 \edef\GPT@AttrShort{\GPT@AttrShort
1081 :MD\@nameuse{GPT@XMP@\GPT@xmpfile}%
1082 }%
1083 }%
1084 \fi
1085 \ifx\GPT@interpolate\ltx@empty
1086 \else
1087 \edef\GPT@Attr{\GPT@Attr
1088 /Interpolate true%
1089 }%
1090 \edef\GPT@AttrShort{\GPT@AttrShort
1091 :I%
1092 }%
1093 \fi
1094 \ifx\GPT@decodearray\ltx@empty
1095 \else
1096 \edef\GPT@Attr{\GPT@Attr
1097 /Decode[\GPT@decodearray]%
1098 }%
1099 \edef\GPT@AttrShort{\GPT@AttrShort
1100 :D[\GPT@decodearray]%
1101 }%
1102 \fi
1103 \ifx\GPT@mask\ltx@empty
1104 \else
1105 \edef\GPT@Attr{\GPT@Attr
1106 /Mask\GPT@mask
1107 }%
1108 \edef\GPT@AttrShort{\GPT@AttrShort
1109 :M\GPT@mask
1110 }%
1111 \fi
1112 \ifx\GPT@intent\ltx@empty
1113 \else
1114 \edef\GPT@AttrShort{\GPT@AttrShort
1115 :RI\GPT@intent
1116 }%
1117 \expandafter\ifx\csname pdfescapename\endcsname\relax
1118 \expandafter\ifx\csname pdf@escapename\endcsname\relax
1119 \else
1120 \edef\GPT@intent{\pdf@escapename{\GPT@intent}}%
1121 \fi
1122 \else
1123 \edef\GPT@intent{\pdfescapename{\GPT@intent}}%
1124 \fi
1125 \edef\GPT@Attr{\GPT@Attr
1126 /Intent/\GPT@intent
1127 }%
1128 \fi
1129 \fi
1130 \else
1131 \let\GPT@interpolate\ltx@empty
1132 \let\GPT@decodearray\ltx@empty
1133 \let\GPT@mask\ltx@empty
1134 \let\GPT@intent\ltx@empty
1135 \ifx\GPT@page\ltx@empty
1136 \else
1137 \edef\GPT@AttrShort{\GPT@AttrShort
1138 :P\GPT@page
1139 }%
1140 \fi
1141 \ifx\GPT@pagebox\ltx@empty
1142 \else
1143 \edef\GPT@AttrShort{%
1144 \GPT@AttrShort
1145 :\expandafter\ltx@car\GPT@pagebox{}\@nil b%
1146 }%
1147 \fi
1148 \ifx\GPT@print\ltx@empty
1149 \else
1150 \GPT@warn{%
1151 Option `print' can only be used\MessageBreak
1152 for bitmap images%
1153 }%
1154 \let\GPT@print\ltx@empty
1155 \fi
1156 \fi
1157 % Check if print image exists.
1158 \ifx\GPT@print\ltx@empty
1159 \else
1160 \GPT@IfFileExists{\GPT@print}{%
1161 }{%
1162 \GPT@error{Print image `\GPT@print' not found}{%
1163 The print version of the image is ignored.\MessageBreak
1164 \@ehc
1165 }%
1166 \let\GPT@print\ltx@empty
1167 }%
1168 \fi
1169 % If option `print' is set, the screen image object
1170 % will contain an additional /Alternate entry
1171 % and will not be reused.
1172 \ifx\GPT@print\ltx@empty
1173 \else
1174 \expandafter\expandafter\expandafter\ltx@firstoftwo\expandafter\ltx@gobbletwo
1175 \fi
1176 \ltx@ifundefined{#1 image\GPT@AttrShort}{%
1177 \ifnum\driver@release>4 %
1178 \ifnum\driver@release>5 %
1179 \ifx\GPT@print\ltx@empty
1180 \ifx\GPT@Attr\ltx@empty
1181 \let\GPT@RuleAttr\ltx@empty
1182 \else
1183 \edef\GPT@RuleAttr{attr{\GPT@Attr}}%
1184 \fi
1185 \else
1186 \ltx@ifundefined{\GPT@print\ltx@space image\GPT@AttrShort}{%
1187 \immediate\pdfximage{\GPT@print}%
1188 \setbox\@tempboxa=\hbox{\pdfrefximage\pdflastximage}%
1189 \edef\GPT@PrintObj{\the\pdflastximage}%
1190 \expandafter\xdef\csname\GPT@print\ltx@space
1191 image\GPT@AttrShort\endcsname{%
1192 \pdfrefximage\GPT@PrintObj\relax
1193 }%
1194 \immediate\pdfobj{%
1195 [<<%
1196 /Image \GPT@PrintObj\GPT@objref
1197 /DefaultForPrinting true%
1198 >>]%
1199 }%
1200 \def\GPT@RuleAttr{%
1201 width\wd\@tempboxa height\ht\@tempboxa
1202 attr{%
1203 \GPT@Attr
1204 /Alternates \the\pdflastobj\GPT@objref
1205 }%
1206 }%
1207 }{%
1208 \edef\GPT@PrintObj{%
1209 \expandafter\expandafter\expandafter\ltx@gobble
1210 \csname\GPT@print\ltx@space image\GPT@AttrShort\endcsname
1211 }%
1212 \immediate\pdfobj{%
1213 [<<%
1214 /Image \GPT@PrintObj\GPT@objref
1215 /DefaultForPrinting true%
1216 >>]%
1217 }%
1218 \def\GPT@RuleAttr{%
1219 width \csname\GPT@print\ltx@space width\GPT@AttrShort\endcsname
1220 height \csname\GPT@print\ltx@space height\GPT@AttrShort\endcsname
1221 attr{%
1222 \GPT@Attr
1223 /Alternates \the\pdflastobj\GPT@objref
1224 }%
1225 }%
1226 }%
1227 \fi
1228 \pdfximage\GPT@RuleAttr
1229 \ifx\GPT@page\ltx@empty
1230 \else
1231 page \GPT@page
1232 \fi
1233 \GPT@pagebox
1234 {#1}%
1235 \setbox\@tempboxa=\hbox{\pdfrefximage\pdflastximage}%
1236 \else
1237 \setbox\@tempboxa=\hbox{\pdfimage{#1}}%
1238 \fi
1239 \else
1240 \setbox\@tempboxa=\hbox{%
1241 \pdfimage\noexpand\noexpand\noexpand\ltx@empty#1\relax
1242 }%
1243 \fi
1244 \def\Gin@llx{0}\let\Gin@lly\Gin@llx
1245 \Gin@defaultbp\Gin@urx{\wd\@tempboxa}%
1246 \Gin@defaultbp\Gin@ury{\ht\@tempboxa}%
1247 \expandafter\xdef\csname\GPT@ReusedName{#1} width\GPT@AttrShort\endcsname{%
1248 \the\wd\@tempboxa
1249 }%
1250 \expandafter\xdef\csname\GPT@ReusedName{#1} height\GPT@AttrShort\endcsname{%
1251 \the\ht\@tempboxa
1252 }%
1253 \ifnum\driver@release>5 %
1254 \expandafter\xdef\csname #1 image\GPT@AttrShort
1255 \ifx\GPT@print\ltx@empty\else!\fi\endcsname{%
1256 \pdfrefximage\the\pdflastximage
1257 }%
1258 \else
1259 \pdfform\@tempboxa
1260 \Gread@gobject=\pdflastform
1261 \expandafter\xdef\csname#1 image\endcsname{%
1262 \pdfrefform\the\Gread@gobject
1263 }%
1264 \fi
1265 \Gin@log{%
1266 <#1, id=%
1267 \ifnum\driver@release>5 %
1268 \the\pdflastximage
1269 \ifx\GPT@page\ltx@empty\else , page=\GPT@page\fi
1270 \ifx\GPT@pagebox\ltx@empty\else, pagebox=\GPT@pagebox\fi
1271 \ifx\GPT@interpolate\ltx@empty\else, interpolate=true\fi
1272 \ifx\GPT@print\ltx@empty
1273 \else
1274 , print=\GPT@print, id=\GPT@PrintObj
1275 \fi
1276 \else
1277 \the\Gread@gobject
1278 \fi
1279 , \the\wd\@tempboxa\ltx@space x \the\ht\@tempboxa
1280 >%
1281 }%
1282 }{%
1283 \def\Gin@llx{0}\let\Gin@lly\Gin@llx
1284 \Gin@defaultbp\Gin@urx{\csname#1 width\GPT@AttrShort\endcsname}%
1285 \Gin@defaultbp\Gin@ury{\csname#1 height\GPT@AttrShort\endcsname}%
1286 }%
1287 }
1288 \def\Ginclude@pdftex#1{%
1289 \def\@tempa{!}%
1290 \ifx\Gin@scaley\@tempa
1291 \let\Gin@scaley\Gin@scalex
1292 \else
1293 \ifx\Gin@scalex\@tempa\let\Gin@scalex\Gin@scaley\fi
1294 \fi
1295 \Gin@log{%
1296 <use #1%
1297 \ifx\GPT@page\ltx@empty\else, page \GPT@page\fi
1298 >%
1299 }%
1300 \GPT@info{%
1301 #1\ifx\GPT@page\ltx@empty\else, page\GPT@page\fi
1302 \ltx@space used\on@line.\MessageBreak
1303 Requested size: %
1304 \the\Gin@req@width\ltx@space x \the\Gin@req@height
1305 }%
1306 \hbox{%
1307 \GPT@ResetColorBegin
1308 \Gscale@box{\Gin@scalex}[\Gin@scaley]{%
1309 \ltx@IfUndefined{Gin@vllx}{%
1310 \GPT@viewportfalse
1311 % without viewport/trim clipping does not make sense
1312 % for pdfTeX
1313 \Gin@clipfalse
1314 }{}%
1315 \ifGin@clip
1316 \ifnum\driver@release<6 %
1317 \GPT@warn{No clipping support in pdfTeX < 0.14}%
1318 \else
1319 \if!\Gin@vllx\Gin@vlly\Gin@vurx\Gin@vury!%
1320 \else
1321 \let\GPT@clipend\GPT@DoClipEnd
1322 \setbox\@tempboxa\hbox\bgroup
1323 \fi
1324 \fi
1325 \fi
1326 \ifGPT@viewport
1327 \ifdim\Gin@vlly\p@=\z@
1328 \else
1329 \lower\Gin@vlly bp\hbox\bgroup
1330 \fi
1331 \ifdim\Gin@vllx\p@=\z@
1332 \else
1333 \hskip-\Gin@vllx bp\relax
1334 \fi
1335 \fi
1336 \csname#1 image\GPT@AttrShort
1337 \ifx\GPT@print\ltx@empty\else!\fi
1338 \endcsname
1339 \ifGPT@viewport
1340 \ifdim\Gin@vlly\p@=\z@
1341 \else
1342 \egroup
1343 \fi
1344 \GPT@clipend
1345 \fi
1346 }%
1347 \GPT@ResetColorEnd
1348 }%
1349 }
1350 \ltx@newif\ifGPT@viewport
1351 \GPT@viewporttrue
1352 \let\GPT@clipend\relax
1353 \def\GPT@DoClipEnd{%
1354 \egroup
1355 \dp\@tempboxa\z@
1356 % \Gin@urx and \Gin@ury already contain the correct values,
1357 % so both cases viewport and trim can be handled together:
1358 \dimen@\Gin@urx\p@
1359 % v0.03k \Gin@vllx replaced by \Gin@llx
1360 \advance\dimen@ -\Gin@llx\p@
1361 \wd\@tempboxa\strip@pt\dimen@ bp\relax
1362 \dimen@\Gin@ury\p@
1363 % v0.03k \Gin@vlly replaced by \Gin@lly
1364 \advance\dimen@ -\Gin@lly\p@
1365 \ht\@tempboxa\strip@pt\dimen@ bp\relax
1366 \let\GPT@temp\ltx@empty
1367 \ifnum\driver@release>7 %
1368 \ifx\GPT@ocobjnum\ltx@empty
1369 \else
1370 \edef\GPT@temp{attr{/OC \GPT@ocobjnum\GPT@objref}}%
1371 \fi
1372 \fi
1373 \expandafter\pdfxform\GPT@temp\@tempboxa
1374 \pdfrefxform\pdflastxform
1375 }
1376 \ltx@newif\ifGPT@IsBitmap
1377 \def\Gread@pdfbitmap#1{%
1378 \GPT@IsBitmaptrue
1379 \Gread@pdftex{#1}%
1380 \GPT@IsBitmapfalse
1381 }
1382
1383 \edef\Gread@MBox{/MediaBox}
1384 \def\Gread@pdf{%
1385 \GPT@read\Gread@@pdf
1386 }
1387 \def\Gread@@pdf#1{%
1388 \begingroup
1389 \@tempcnta\z@
1390 \loop
1391 \ifnum\@tempcnta<\@xxxii
1392 \catcode\@tempcnta14 %
1393 \advance\@tempcnta\@ne
1394 \repeat
1395 \catcode127=14 %
1396 \let\do\@makeother\dospecials\catcode`\ 10 %
1397 \catcode\endlinechar5 %
1398 \immediate\openin\@inputcheck#1 %
1399 \ifeof\@inputcheck
1400 \@latex@error{File `#1' not found}\@ehc
1401 \else
1402 \Gread@true
1403 \let\@tempb\Gread@false
1404 \loop
1405 % v0.02e: use \. not \@tempa so the space is preserved before [
1406 \read\@inputcheck to\.%
1407 \ifeof\@inputcheck
1408 \Gread@false
1409 \else
1410 \expandafter\Gread@find@mbox\. []\\%
1411 \fi
1412 \ifGread@
1413 \repeat
1414 \immediate\closein\@inputcheck
1415 \fi
1416 \ifGin@bbox
1417 \else
1418 \@latex@error
1419 {Cannot determine size of graphic in #1 (no BoundingBox)}%
1420 \@ehc
1421 \gdef\@gtempa{0 0 72 72 }%
1422 \fi
1423 \endgroup
1424 \expandafter\Gread@parse@bb\@gtempa\\%
1425 }
1426 \long\def\Gread@find@mbox#1 [#2]#3\\{% hash-ok
1427 \def\@tempa{#1}%
1428 \ifx\@tempa\Gread@MBox
1429 \gdef\@gtempa{#2 }%
1430 \@tempb
1431 \Gin@bboxtrue
1432 \fi
1433 }
1434 \def\Ginclude@png#1{%
1435 \hbox{%
1436 % v0.02f add \@depth\z@ (from Sebastian)
1437 \pdfimage
1438 \@height\Gin@req@height \@width\Gin@req@width \@depth\z@
1439 \noexpand\noexpand\noexpand\ltx@empty#1\relax
1440 }%
1441 }
1442
1443 \def\Ginclude@mps#1{%
1444 \def\@tempa{!}%
1445 \ifx\Gin@scaley\@tempa
1446 \let\Gin@scaley\Gin@scalex
1447 \else
1448 \ifx\Gin@scalex\@tempa\let\Gin@scalex\Gin@scaley\fi
1449 \fi
1450 \hbox{%
1451 \GPT@ResetColorBegin
1452 \Gscale@box{\Gin@scalex}[\Gin@scaley]{%
1453 \ltx@IfUndefined{Gin@vllx}{%
1454 \GPT@viewportfalse
1455 % without viewport/trim clipping does not make sense
1456 % for pdfTeX
1457 \Gin@clipfalse
1458 }{}%
1459 \ifGin@clip
1460 \ifnum\driver@release<6 %
1461 \GPT@warn{No clipping support in pdfTeX < 0.14}%
1462 \else
1463 \if!\Gin@vllx\Gin@vlly\Gin@vurx\Gin@vury!%
1464 \else
1465 \let\GPT@clipend\GPT@DoClipEnd
1466 \setbox\@tempboxa\hbox\bgroup
1467 \fi
1468 \fi
1469 \fi
1470 \ifGPT@viewport
1471 \ifdim\Gin@vlly\p@=\z@
1472 \else
1473 \lower\Gin@vlly bp\hbox\bgroup
1474 \fi
1475 \ifdim\Gin@vllx\p@=\z@
1476 \else
1477 \hskip-\Gin@vllx bp\relax
1478 \fi
1479 \fi
1480 \GPT@catcodes{mps}%
1481 \convertMPtoPDF{#1}{1}{1}%
1482 \GPT@restore@mps
1483 \ifGPT@viewport
1484 \ifdim\Gin@vlly\p@=\z@
1485 \else
1486 \egroup
1487 \fi
1488 \GPT@clipend
1489 \fi
1490 }%
1491 \GPT@ResetColorEnd
1492 }%
1493 }
1494 \def\Gread@mps{%
1495 \GPT@read\Gread@eps
1496 }
1497 \ifnum\driver@release>3 %
1498 \let\Ginclude@png\Ginclude@pdftex
1499 \let\Ginclude@jpg\Ginclude@pdftex
1500 \let\Ginclude@pdf\Ginclude@pdftex
1501 \let\Gread@pdf\Gread@pdftex
1502 \let\Gread@png\Gread@pdfbitmap
1503 \let\Gread@jpg\Gread@pdfbitmap
1504 \ifnum\driver@release>5 %
1505 \ifnum\driver@release<8 %
1506 \let\Gread@tif\Gread@pdfbitmap
1507 \let\Ginclude@tif\Ginclude@pdftex
1508 \else
1509 \ifnum\driver@release>9 %
1510 \expandafter\let\csname Gread@jbig2\endcsname\Gread@pdfbitmap
1511 \expandafter\let\csname Ginclude@jbig2\endcsname\Ginclude@pdftex
1512 \fi
1513 \fi
1514 \fi
1515 \else
1516 \def\Ginclude@pdf#1{%
1517 \def\@tempa{!}%
1518 \ifx\Gin@scaley\@tempa
1519 \let\Gin@scaley\Gin@scalex
1520 \else
1521 \ifx\Gin@scalex\@tempa\let\Gin@scalex\Gin@scaley\fi
1522 \fi
1523 \hbox{%
1524 \GPT@catcodes{pdf}%
1525 \convertPDFtoPDF{#1}{\Gin@scalex}{\Gin@scaley} {0bp} {0bp}%
1526 {\Gin@req@width}{\Gin@req@height}%
1527 \GPT@restore@pdf
1528 }%
1529 }%
1530 \fi
1531
1532 % v0.02e: restrict the rules to just the types that pdftex can currently
1533 % deal with.
1534 \ifnum\driver@release>3 %
1535 \def\Gin@extensions{.png,.pdf,.jpg,.mps,.jpeg,.PNG,.PDF,.JPG,.JPEG}%
1536 \@namedef{Gin@rule@.jpg}#1{{jpg}{.jpg}{#1}}%
1537 \@namedef{Gin@rule@.jpeg}#1{{jpg}{.jpeg}{#1}}%
1538 \@namedef{Gin@rule@.JPG}#1{{jpg}{.JPG}{#1}}%
1539 \@namedef{Gin@rule@.JPEG}#1{{jpg}{.JPEG}{#1}}%
1540 \ifnum\driver@release>5 %
1541 \ifnum\driver@release<8 %
1542 \def\Gin@extensions{%
1543 .png,.pdf,.jpg,.mps,.tif,.jpeg,%
1544 .PNG,.PDF,.JPG,.JPEG%
1545 }%
1546 \@namedef{Gin@rule@.tif}#1{{tif}{.tif}{#1}}%
1547 \else
1548 \ifnum\driver@release>9 %
1549 \ifnum\pdfminorversion>3 %
1550 \def\Gin@extensions{%
1551 .png,.pdf,.jpg,.mps,.jpeg,.jbig2,.jb2,%
1552 .PNG,.PDF,.JPG,.JPEG,.JBIG2,.JB2%
1553 }%
1554 \fi
1555 \@namedef{Gin@rule@.jb2}#1{{jbig2}{.jb2}{#1}}%
1556 \@namedef{Gin@rule@.jbig2}#1{{jbig2}{.jbig2}{#1}}%
1557 \fi
1558 \fi
1559 \fi
1560 \else
1561 \def\Gin@extensions{.png,.pdf,.mps,.PNG,.PDF}%
1562 \fi
1563 \@namedef{Gin@rule@.png}#1{{png}{.png}{#1}}
1564 \@namedef{Gin@rule@.PNG}#1{{png}{.PNG}{#1}}
1565 \@namedef{Gin@rule@.mps}#1{{mps}{.mps}{#1}}
1566 \@namedef{Gin@rule@.pdf}#1{{pdf}{.pdf}{#1}}
1567 \@namedef{Gin@rule@.PDF}#1{{pdf}{.PDF}{#1}}
1568
1569
1570 % Rotation
1571 % slightly hacky, but set width of box 0 to 0pt otherwise
1572 % the CTM gets restored in the wrong place.
1573
1574 \def\GPT@MatrixIdentity{1 0 0 1}
1575 \def\GPT@Zero{0}
1576 \def\GPT@Minus{-}
1577 \def\GPT@NormalizeNumber#1{%
1578 \edef#1{#1}%
1579 \edef#1{\expandafter\ltx@zapspace\expandafter{#1}}%
1580 \edef#1{\expandafter\GPT@ZapPlus#1+\@nil}%
1581 \edef#1{\expandafter\GPT@ZapMinusMinus#1--\@nil}%
1582 \expandafter\GPT@Split#1..\@nil
1583 \ifx\GPT@frac\ltx@empty
1584 \else
1585 \edef\GPT@frac{%
1586 \expandafter\GPT@Reverse\expandafter{\expandafter}\GPT@frac\@nil
1587 }%
1588 \edef\GPT@frac{%
1589 \expandafter\GPT@ZapLeadingZeros\GPT@frac\ltx@empty
1590 }%
1591 \ifx\GPT@frac\ltx@empty
1592 \else
1593 \edef\GPT@frac{%
1594 \expandafter\GPT@Reverse\expandafter{\expandafter}\GPT@frac\@nil
1595 }%
1596 \fi
1597 \fi
1598 \edef\GPT@sign{\expandafter\ltx@car\GPT@int\ltx@empty\@nil}%
1599 \ifx\GPT@sign\GPT@Minus
1600 \edef\GPT@int{\expandafter\ltx@cdr\GPT@int\@nil}%
1601 \else
1602 \def\GPT@sign{}%
1603 \fi
1604 \edef\GPT@int{%
1605 \expandafter\GPT@ZapLeadingZeros\GPT@int\ltx@empty
1606 }%
1607 \edef\GPT@temp{\GPT@int\GPT@frac}%
1608 \ifx\GPT@temp\ltx@empty
1609 \def#1{0}%
1610 \else
1611 \edef#1{%
1612 \GPT@sign
1613 \GPT@int
1614 \ifx\GPT@frac\ltx@empty
1615 \else
1616 .\GPT@frac
1617 \fi
1618 }%
1619 \fi
1620 }
1621 \def\GPT@ZapPlus#1+#2\@nil{%
1622 #1%
1623 \ifx\ltx@empty#2\ltx@empty
1624 \expandafter\ltx@gobble
1625 \else
1626 \expandafter\@firstofone
1627 \fi
1628 {%
1629 \GPT@ZapPlus#2\@nil
1630 }%
1631 }
1632 \def\GPT@ZapMinusMinus#1--#2\@nil{%
1633 #1%
1634 \ifx\ltx@empty#2\ltx@empty
1635 \expandafter\ltx@gobble
1636 \else
1637 \expandafter\@firstofone
1638 \fi
1639 {%
1640 \GPT@ZapMinusMinus#2\@nil
1641 }%
1642 }
1643 \def\GPT@Split#1.#2.#3\@nil{%
1644 \def\GPT@int{#1}%
1645 \ifx\ltx@empty#2\ltx@empty
1646 \let\GPT@frac\ltx@empty
1647 \else
1648 \def\GPT@frac{#2}%
1649 \fi
1650 }
1651 \def\GPT@Reverse#1#2#3\@nil{%
1652 \ifx\ltx@empty#3\ltx@empty
1653 #2#1%
1654 \expandafter\ltx@gobble
1655 \else
1656 \expandafter\ltx@firstofone
1657 \fi
1658 {%
1659 \GPT@Reverse{#2#1}#3\@nil
1660 }%
1661 }
1662 \def\GPT@ZapLeadingZeros#1{%
1663 \ifx0#1%
1664 \expandafter\GPT@ZapLeadingZeros
1665 \else
1666 #1%
1667 \fi
1668 }
1669 \begingroup\expandafter\expandafter\expandafter\endgroup
1670 \expandafter\ifx\csname pdfsetmatrix\endcsname\relax
1671 % Patrick Daly found an error here with doubled minus signs when
1672 % \Grot@sin is negative. Fixed.
1673 \def\Grot@start{%
1674 \GPT@NormalizeNumber\Grot@sin
1675 \GPT@NormalizeNumber\Grot@cos
1676 \edef\GPT@temp{%
1677 \Grot@cos\ltx@space\Grot@sin\ltx@space
1678 \if-\GPT@sin
1679 \else
1680 % avoid negative zero
1681 \ifx\Grot@sin\GPT@Zero
1682 \GPT@Zero
1683 \else
1684 -\Grot@sin
1685 \fi
1686 \fi
1687 \ltx@space\Grot@cos
1688 }%
1689 \ifx\GPT@temp\GPT@MatrixIdentity
1690 \def\Grot@end{}%
1691 \else
1692 \pdfliteral{ q \GPT@temp\ltx@space 0 0 cm}%
1693 \wd\z@\z@
1694 \fi
1695 \wd\z@\z@
1696 }%
1697 \def\Grot@end{%
1698 \pdfliteral{ Q}%
1699 }%
1700 % Scaling is OK, as graphics package does it right here.
1701 \def\Gscale@start{%
1702 \GPT@NormalizeNumber\Gscale@x
1703 \GPT@NormalizeNumber\Gscale@y
1704 \edef\GPT@temp{%
1705 \Gscale@x\ltx@space0 0 \Gscale@y
1706 }%
1707 \ifx\GPT@temp\GPT@MatrixIdentity
1708 \def\Gscale@end{}%
1709 \else
1710 \pdfliteral{ q \GPT@temp\ltx@space 0 0 cm}%
1711 \fi
1712 }%
1713 \else
1714 \def\Grot@start{%
1715 \GPT@NormalizeNumber\Grot@sin
1716 \GPT@NormalizeNumber\Grot@cos
1717 \edef\GPT@temp{%
1718 \Grot@cos\ltx@space\Grot@sin\ltx@space
1719 \if-\Grot@sin
1720 \else
1721 \ifx\Grot@sin\GPT@Zero
1722 \GPT@Zero
1723 \else
1724 -\Grot@sin
1725 \fi
1726 \fi
1727 \ltx@space\Grot@cos
1728 }%
1729 \ifx\GPT@temp\GPT@MatrixIdentity
1730 \def\Grot@end{}%
1731 \else
1732 \pdfsave
1733 \pdfsetmatrix{\GPT@temp}%
1734 \wd\z@\z@
1735 \fi
1736 }%
1737 \def\Grot@end{\pdfrestore}%
1738 \def\Gscale@start{%
1739 \GPT@NormalizeNumber\Gscale@x
1740 \GPT@NormalizeNumber\Gscale@y
1741 \edef\GPT@temp{%
1742 \Gscale@x\ltx@space0 0 \Gscale@y
1743 }%
1744 \ifx\GPT@temp\GPT@MatrixIdentity
1745 \def\Gscale@end{}%
1746 \else
1747 \pdfsave
1748 \pdfsetmatrix{\GPT@temp}%
1749 \fi
1750 }%
1751 \fi
1752 \let\Gscale@end\Grot@end
1753
1754 % undo the trig.sty `optimization' so that these 0 1 and -1 values
1755 % get written out as digits, not unexpandable TeX primitives.
1756 % 0.04q: space added to remain consistent with trig.sty.
1757 \def\GPT@PatchTrig{%
1758 \def\GPT@temp##1(##2)=##3 {%
1759 \expandafter\def\csname ##1(##2)\endcsname{##3 }%
1760 }%
1761 \GPT@temp sin(0)=0 %
1762 \GPT@temp cos(0)=1 %
1763 \GPT@temp sin(90)=1 %
1764 \GPT@temp cos(90)=0 %
1765 \GPT@temp sin(-90)=-1 %
1766 \GPT@temp cos(-90)=0 %
1767 \GPT@temp sin(180)=0 %
1768 \GPT@temp cos(180)=-1 %
1769 % added in 0.04q
1770 \GPT@temp sin(270)=-1 %
1771 \GPT@temp cos(270)=0 %
1772 \GPT@temp sin(360)=0 %
1773 \GPT@temp cos(360)=1 %
1774 \GPT@temp sin(-180)=0 %
1775 \GPT@temp cos(-180)=-1 %
1776 \GPT@temp sin(-270)=1 %
1777 \GPT@temp cos(-270)=0 %
1778 \GPT@temp sin(-360)=0 %
1779 \GPT@temp cos(-360)=1 %
1780 \ltx@ifpackageloaded{trig}{%
1781 \let\GPT@PatchTrig\relax
1782 }{}%
1783 }
1784 \AtBeginDocument{\GPT@PatchTrig}
1785 \ltx@ifpackageloaded{trig}{\GPT@PatchTrig}{}
1786 \ltx@IfUndefined{AfterPackage}{}{% scrlfile.sty
1787 \AfterPackage{trig}{\GPT@PatchTrig}%
1788 }
1789 \ltx@IfUndefined{AtEndOfPackageFile}{}{% filehook.sty
1790 \AtEndOfPackageFile{trig}{\GPT@PatchTrig}%
1791 }
1792 \ltx@IfUndefined{AtEndPackage}{}{% memoir.cls
1793 \AtEndPackage{trig}{\GPT@PatchTrig}%
1794 }
1795
1796 % v0.02e: Restore catcodes of context letters.
1797 % Not needed with current version of supp-pdf
1798 % but protects against older versions.
1799 % v0.03o: Catcode protection of '=' because of turkish.ldf.
1800 \def\GPT@LoadSuppPdf{%
1801 \ltx@IfUndefined{convertMPtoPDF}{%
1802 \GPT@catcodes{supp}%
1803 \InputIfFileExists{supp-pdf.mkii}{}{%
1804 \InputIfFileExists{supp-pdf}{}{}%
1805 }%
1806 \GPT@restore@supp
1807 }{%
1808 % supp-pdf is probably already loaded.
1809 }%
1810 % If supp-pdf is not available, \convertMPtoPDF generates
1811 % an error message. \providecommand inside the third argument
1812 % of \InputIfFileExists will not work:
1813 % * \InputIfFileExists has problems with parameters (#1).
1814 % * Implementation of \providecommand is insufficient in miniltx.tex
1815 \ltx@ifundefined{convertMPtoPDF}{%
1816 \def\convertMPtoPDF##1##2##3{%
1817 \GPT@error{%
1818 Cannot convert ##1 from MPS to PDF.\MessageBreak
1819 The support file `supp-pdf.mkii' (supp-pdf.tex) is missing%
1820 }{%
1821 The graphics driver for pdfTeX needs `supp-pdf.mkii'\MessageBreak
1822 (or `supp-pdf.tex' and/or `supp-mis.tex')\MessageBreak
1823 to convert MetaPost output files to PDF.\MessageBreak
1824 These files are part of ConTeXt and can also be found here:%
1825 \MessageBreak
1826 \ltx@space\ltx@space CTAN:macros/pdftex/graphics/\MessageBreak
1827 You'll get more errors if you'll continue now.%
1828 }%
1829 }%
1830 }{}%
1831 \let\GPT@LoadSuppPdf\relax
1832 }
1833 \AtBeginDocument{%
1834 \GPT@LoadSuppPdf
1835 }
1836
1837 % Adds support for extended MetaPost features (transparency)
1838 \def\LoadMetaPostSpecialExtensions{%
1839 \AtBeginDocument{%
1840 \ltx@IfUndefined{assignMPStransparency}{%
1841 \GPT@catcodes{mpe}%
1842 \let\GPT@found=N%
1843 \IfFileExists{supp-pdf.mkii}{\let\GPT@found=Y}{%
1844 \IfFileExists{supp-pdf}{\let\GPT@found=Y}{}%
1845 }%
1846 \ifx Y\GPT@found
1847 \InputIfFileExists{supp-mis.mkii}{}{%
1848 \InputIfFileExists{supp-mis}{}{\let\GPT@found=N}%
1849 }%
1850 \ifx Y\GPT@found
1851 \InputIfFileExists{supp-mpe.mkii}{}{%
1852 \InputIfFileExists{supp-mpe}{}{\let\GPT@found=N}%
1853 }%
1854 \ifx Y\GPT@found
1855 \MPcmykcolorstrue
1856 \MPspotcolorstrue
1857 \chardef\makeMPintoPDFobject=1 %
1858 \else
1859 \GPT@warn{%
1860 Cannot enable MetaPost Special Extensions,\MessageBreak
1861 because `supp-mpe.mkii' (or `supp-mpe.tex')\MessageBreak
1862 is missing%
1863 }%
1864 \fi
1865 \else
1866 \GPT@warn{%
1867 Cannot enable MetaPost Special Extensions,\MessageBreak
1868 because `supp-mis.mkii' (or `supp-mis.tex')\MessageBreak
1869 is missing%
1870 }%
1871 \fi
1872 \else
1873 \GPT@warn{%
1874 Cannot enable support for MetaPost images,\MessageBreak
1875 because `supp-pdf.mkii' (or `supp-pdf.tex')\MessageBreak
1876 is missing%
1877 }%
1878 \fi
1879 \GPT@restore@mpe
1880 }{}%
1881 }%
1882 \let\LoadMetaPostSpecialExtensions\relax
1883 }
1884 \ltx@IfUndefined{@onlypreamble}{%
1885 }{%
1886 \@onlypreamble\LoadMetaPostSpecialExtensions
1887 }
1888
1889 % these seem to upset pdftex. ignore them. SPQR 1999/08/02
1890 % allow for plain graphics, not graphicx.
1891 % pdftex.def is loaded before the definition in graphicx,
1892 % so do all the stuff \AtBeginDocument:
1893 \AtBeginDocument{%
1894 \ltx@IfUndefined{define@key}{}{%
1895 \define@key{Gin}{natwidth}{}%
1896 \define@key{Gin}{natheight}{}%
1897 }%
1898 }%
1899 \GPT@AtEnd

Send suggestions and bug reports to Sergey Poznyakoff
ViewVC Help
Powered by ViewVC 1.1.20