1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
|
%% luatex.def Copyright (C) 2000-2015 David Carlisle, Sebastian Rahtz,
%% Hans Hagen, Heiko Oberdiek and
%% Martin Schr\"oder
%% Copyright (C) 2016-2018 LaTeX3 project and Heiko Oberdiek
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3c
%% of this license or (at your option) any later version.
%% The latest version of this license is in
%% http://www.latex-project.org/lppl.txt
%% and version 1.3c or later is part of all distributions of LaTeX
%% version 2005/12/01 or later.
%%
%% This work has the LPPL maintenance status `maintained'.
%%
%% The Current Maintainer of this work is the LaTeX3 Project.
%%
%% https://github.com/latex3/graphics-def/issues
%%
\ProvidesFile{luatex.def}
[2018/01/08 v1.0l Graphics/color driver for luatex]
\def\GPT@space{ }
\def\c@lor@arg#1{%
\dimen@#1\p@
\ifdim\dimen@<\z@\dimen@\maxdimen\fi
\ifdim\dimen@>\p@
\PackageError{color}{Argument `#1' not in range [0,1]}\@ehd
\fi}
\def\color@gray#1#2{%
\c@lor@arg{#2}%
\edef#1{#2 g #2 G}%
}
\def\color@cmyk#1#2{\c@lor@@cmyk#2\@@#1}
\def\c@lor@@cmyk#1,#2,#3,#4\@@#5{%
\c@lor@arg{#4}%
\c@lor@arg{#1}%
\c@lor@arg{#2}%
\c@lor@arg{#3}%
\edef#5{#1 #2 #3 #4 k #1 #2 #3 #4 K}%
}
\def\color@rgb#1#2{\c@lor@@rgb#2\@@#1}
\def\c@lor@@rgb#1,#2,#3\@@#4{%
\c@lor@arg{#1}%
\c@lor@arg{#2}%
\c@lor@arg{#3}%
\edef#4{#1 #2 #3 rg #1 #2 #3 RG}%
}
\def\color@RGB#1#2{\c@lor@@RGB#2\@@#1}
\def\c@lor@@RGB#1,#2,#3\@@#4{%
\c@lor@RGB@rgb{#1}\@tempa
\c@lor@RGB@rgb{#2}\@tempb
\c@lor@RGB@rgb{#3}\@tempc
\c@lor@@rgb\@tempa,\@tempb,\@tempc\@@#4%
}
\def\c@lor@RGB@rgb#1#2{%
\dimen@#1\p@
\divide\dimen@\@cclv
\edef#2{\strip@pt\dimen@}}
\def\color@named#1#2{\c@lor@@named#2,,\@@#1}
\def\c@lor@@named#1,#2,#3\@@#4{%
\@ifundefined{col@#1}%
{\PackageError{color}{Undefined color `#1'}\@ehd}%
{\edef#4{\csname col@#1\endcsname}}%
}
\chardef\main@pdfcolorstack=0 %
\@ifundefined{@pdfcolorstack}
{\def\@pdfcolorstack{\main@pdfcolorstack}}{}
\def\current@color{0 g 0 G}
\def\set@color{%
\pdfextension colorstack\@pdfcolorstack push{\current@color}%
\aftergroup\reset@color}
\def\reset@color{\pdfextension colorstack\@pdfcolorstack pop\relax}
\newif\ifGPT@pagecolor
\begingroup\expandafter\expandafter\expandafter\endgroup
\def\set@page@color{%
\global\GPT@pagecolortrue
\global\let\current@page@color\current@color
\@ifundefined{GPT@outputbox}{%
% \newbox is outer in plain
\csname newbox\endcsname\GPT@outputbox
}{}%
\@ifundefined{GPTorg@shipout}{%
\global\let\GPTorg@shipout\shipout
\gdef\shipout{%
\edef\GPT@saved@grouplevel{\number\currentgrouplevel}%
\afterassignment\GPT@shipout
\global\setbox\GPT@outputbox=%
}%
\gdef\GPT@shipout{%
\ifnum\GPT@saved@grouplevel=\currentgrouplevel
\else
\expandafter\aftergroup
\fi
\GPT@@shipout
}%
\gdef\GPT@@shipout{%
\ifvoid\GPT@outputbox\relax
\PackageInfo{luatex.def}{Ignoring void output box}%
\else
\setbox\GPT@outputbox=\vbox{%
\GPT@pageliteral
\box\GPT@outputbox
}%
\GPTorg@shipout\box\GPT@outputbox\relax
\fi
}%
\gdef\GPT@pageliteral{%
\ifGPT@pagecolor
\pdfextension literal page{%
q % gsave
\current@page@color\GPT@space
n % newpath
0 0 \strip@pt\pagewidth\GPT@space
\strip@pt\pageheight\GPT@space re % rectangle
% there is no need to convert to bp
f % fill
Q% grestore
}%
\fi
}%
}{}%
}
\def\define@color@named#1#2{%
\expandafter\edef\csname col@#1\endcsname{#2}}
\def\no@page@color{%
\global\GPT@pagecolorfalse
}
\AtBeginDocument{%
\def\KV@Gin@bbllx{%
\PackageError{luatex.def}{%
Options `bblly', `bblly', `bburx', `bbury',\MessageBreak
`natheight' and `natwidth' are not\MessageBreak
supported by luatex driver:\MessageBreak
use `viewport' instead%
}\@ehc
}%
\let\KV@Gin@bblly\KV@Gin@bbllx
\let\KV@Gin@bburx\KV@Gin@bbllx
\let\KV@Gin@bbury\KV@Gin@bbllx
\let\KV@Gin@natwidth\KV@Gin@bbllx
\let\KV@Gin@natheight\KV@Gin@bbllx
\def\KV@Gin@bb{%
\PackageInfo{luatex.def}%
{Option `bb' equivalent to `viewport' for luatex driver}%
\KV@Gin@viewport
}%
}
\def\Gread@pdftex#1{%
% Use low level test here not \IfFileExists to match \Gread@pdftex in
% pdftex.def and \Gread@eps test in graphics.
% (IfFileExists might be modified by packages and
% #1 has already been "processed" by \input@path.)
\openin\@inputcheck"#1" %
\ifeof\@inputcheck
\closein\@inputcheck
\expandafter\@secondoftwo
\else
\expandafter\@firstoftwo
\fi
{\Gread@@pdftex{#1}}%
{%
\def\Gin@llx{0}%
\let\Gin@lly\Gin@llx
\def\Gin@urx{72}%
\let\Gin@ury\Gin@urx
\ifGin@draft
\else
\PackageError{luatex.def}{File `#1' not found: using draft setting}%
\@ehc
\Gin@drafttrue
\fi
}%
}
\let\Gin@attr@hash\@empty
\@ifundefined{Gin@decode}
{\let\Gin@decode\@empty}
{}
\@ifundefined{Gin@log}
{\let\Gin@log\wlog}
{}
\@ifundefined{Gin@page}
{\let\Gin@page\@empty}
{}
\@ifundefined{Gin@pagebox}
{\def\Gin@pagebox{cropbox}}
{}
\def\GPT@cropbox{cropbox}
\@ifundefined{Gin@interpolate}
{\csname newif\endcsname\ifGin@interpolate}
{}
\def\Gread@@pdftex#1{%
\edef\Gin@attr@hash{%
\ifx\Gin@pagebox\@empty
\else
:\Gin@pagebox
\fi
\ifx\Gin@page\@empty
\else
:P\Gin@page
\fi
\ifx\Gin@decode\@empty\else
:D[\Gin@decode]%
\fi
\ifGin@interpolate
:I%
\fi
}%
\@ifundefined{#1 image\Gin@attr@hash}%
{%
\saveimageresource
\ifnum0%
\ifx\Gin@decode\@empty\else 1\fi
\ifGin@interpolate 1\fi
>0 %
attr{%
\ifx\Gin@decode\@empty\else/Decode[\Gin@decode]\fi
\ifGin@interpolate/Interpolate true\fi
}%
\fi
\ifx\Gin@page\@empty\else page \Gin@page\fi
\Gin@pagebox
{#1}%
\setbox\@tempboxa=\hbox{\useimageresource\lastsavedimageresourceindex}%
\def\Gin@llx{0}\let\Gin@lly\Gin@llx
\Gin@defaultbp\Gin@urx{\wd\@tempboxa}%
\Gin@defaultbp\Gin@ury{\ht\@tempboxa}%
\expandafter\xdef\csname #1 image\Gin@attr@hash\endcsname
{\useimageresource\the\lastsavedimageresourceindex}%
\expandafter\xdef\csname #1 height\Gin@attr@hash\endcsname
{\the\ht\@tempboxa}%
\expandafter\xdef\csname #1 width\Gin@attr@hash\endcsname
{\the\wd\@tempboxa}%
\Gin@log{%
<#1, %
id=\the\lastsavedimageresourceindex, %
\ifx\Gin@page\@empty\else page=\Gin@page , \fi
\ifx\Gin@pagebox\@empty\else\ifx\Gin@pagebox\GPT@cropbox\else
pagebox=\Gin@pagebox , \fi\fi
\ifx\Gin@decode\@empty\else decode=[\Gin@decode], \fi
\ifGin@interpolate interpolate=true, \fi
\the\wd\@tempboxa\GPT@space x \the\ht\@tempboxa
>%
}%
}{%
\def\Gin@llx{0}\let\Gin@lly\Gin@llx
\Gin@defaultbp\Gin@urx{\csname #1 width\Gin@attr@hash\endcsname}%
\Gin@defaultbp\Gin@ury{\csname #1 height\Gin@attr@hash\endcsname}%
}%
}
\def\Gread@png#1{%
\let\Gin@page\@empty
\Gread@pdftex{#1}%
}
\let\Gread@jpg\Gread@png
\expandafter\let\csname Gread@jbig2\endcsname\Gread@png
\def\Gread@pdf#1{%
\let\Gin@decode\@empty
\Gin@interpolatefalse
\Gread@pdftex{#1}%
}
\let\Gread@mps\Gread@eps
\def\GPT@setup@scale{%
\def\@tempa{!}%
\ifx\Gin@scaley\@tempa
\let\Gin@scaley\Gin@scalex
\else
\ifx\Gin@scalex\@tempa\let\Gin@scalex\Gin@scaley\fi
\fi
}
\def\Ginclude@pdftex#1{%
\GPT@setup@scale
\Gin@log{%
<use #1%
\ifx\Gin@page\@empty\else, page \Gin@page\fi
>%
}%
\PackageInfo{luatex.def}{%
#1 \ifx\Gin@page\@empty\else, page\Gin@page\fi
\GPT@space used\on@line.\MessageBreak
Requested size: %
\the\Gin@req@width\GPT@space x \the\Gin@req@height
\ifx\documentclass\@undefined\else\expandafter\@gobble\fi
}%
\Ginclude@@pdftex{\@nameuse{#1 image\Gin@attr@hash}}%
}
\def\Ginclude@mps#1{%
\GPT@setup@scale
\Ginclude@@pdftex{\convertMPtoPDF{#1}{1}{1}}%
}
\def\Ginclude@@pdftex#1{%
\hbox{%
\Gscale@box{\Gin@scalex}[\Gin@scaley]{%
\@ifundefined{Gin@vllx}{%
\GPT@viewportfalse
% without viewport/trim clipping does not make sense
% for pdfTeX
\Gin@clipfalse
}{}%
\ifGin@clip
\if!\Gin@vllx\Gin@vlly\Gin@vurx\Gin@vury!%
\else
\let\GPT@clipend\GPT@DoClipEnd
\setbox\@tempboxa\hbox\bgroup
\fi
\fi
\ifGPT@viewport
\ifdim\Gin@vlly\p@=\z@
\else
\lower\Gin@vlly bp\hbox\bgroup
\fi
\ifdim\Gin@vllx\p@=\z@
\else
\hskip-\Gin@vllx bp\relax
\fi
\fi
#1%
\ifGPT@viewport
\ifdim\Gin@vlly\p@=\z@
\else
\egroup
\fi
\GPT@clipend
\fi
}%
}%
}
\newif\ifGPT@viewport
\GPT@viewporttrue
\let\GPT@clipend\relax
\def\GPT@DoClipEnd{%
\egroup
\dp\@tempboxa\z@
% \Gin@urx and \Gin@ury already contain the correct values,
% so both cases viewport and trim can be handled together:
\dimen@\Gin@urx\p@
\advance\dimen@ -\Gin@llx\p@
\wd\@tempboxa\strip@pt\dimen@ bp\relax
\dimen@\Gin@ury\p@
\advance\dimen@ -\Gin@lly\p@
\ht\@tempboxa\strip@pt\dimen@ bp\relax
\saveboxresource\@tempboxa
\useboxresource\lastsavedboxresourceindex
}
\let\Ginclude@png\Ginclude@pdftex
\let\Ginclude@jpg\Ginclude@pdftex
\let\Ginclude@pdf\Ginclude@pdftex
\expandafter\let\csname Ginclude@jbig2\endcsname\Ginclude@pdftex
\def\GPT@MatrixIdentity{1 0 0 1}
\def\GPT@Zero{0}
\def\GPT@Minus{-}
\def\GPT@NormalizeNumber#1{%
\edef#1{#1}%
\edef#1{\expandafter\zap@space#1 \@empty}%
\edef#1{\expandafter\GPT@ZapPlus#1+\@nil}%
\edef#1{\expandafter\GPT@ZapMinusMinus#1--\@nil}%
\expandafter\GPT@Split#1..\@nil
\ifx\GPT@frac\@empty
\else
\edef\GPT@frac{%
\expandafter\GPT@Reverse\expandafter{\expandafter}\GPT@frac\@nil
}%
\edef\GPT@frac{%
\expandafter\GPT@ZapLeadingZeros\GPT@frac\@empty
}%
\ifx\GPT@frac\@empty
\else
\edef\GPT@frac{%
\expandafter\GPT@Reverse\expandafter{\expandafter}\GPT@frac\@nil
}%
\fi
\fi
\edef\GPT@sign{\expandafter\@car\GPT@int\@empty\@nil}%
\ifx\GPT@sign\GPT@Minus
\edef\GPT@int{\expandafter\@cdr\GPT@int\@nil}%
\else
\def\GPT@sign{}%
\fi
\edef\GPT@int{%
\expandafter\GPT@ZapLeadingZeros\GPT@int\@empty
}%
\edef\GPT@temp{\GPT@int\GPT@frac}%
\ifx\GPT@temp\@empty
\def#1{0}%
\else
\edef#1{%
\GPT@sign
\GPT@int
\ifx\GPT@frac\@empty
\else
.\GPT@frac
\fi
}%
\fi
}
\def\GPT@ZapPlus#1+#2\@nil{%
#1%
\ifx\@empty#2\@empty
\expandafter\@gobble
\else
\expandafter\@firstofone
\fi
{%
\GPT@ZapPlus#2\@nil
}%
}
\def\GPT@ZapMinusMinus#1--#2\@nil{%
#1%
\ifx\@empty#2\@empty
\expandafter\@gobble
\else
\expandafter\@firstofone
\fi
{%
\GPT@ZapMinusMinus#2\@nil
}%
}
\def\GPT@Split#1.#2.#3\@nil{%
\def\GPT@int{#1}%
\ifx\@empty#2\@empty
\let\GPT@frac\@empty
\else
\def\GPT@frac{#2}%
\fi
}
\def\GPT@Reverse#1#2#3\@nil{%
\ifx\@empty#3\@empty
#2#1%
\expandafter\@gobble
\else
\expandafter\@firstofone
\fi
{%
\GPT@Reverse{#2#1}#3\@nil
}%
}
\def\GPT@ZapLeadingZeros#1{%
\ifx0#1%
\expandafter\GPT@ZapLeadingZeros
\else
#1%
\fi
}
\def\Grot@start{%
\GPT@NormalizeNumber\Grot@sin
\GPT@NormalizeNumber\Grot@cos
\edef\GPT@temp{%
\Grot@cos\GPT@space\Grot@sin\GPT@space
\if-\Grot@sin
\else
\ifx\Grot@sin\GPT@Zero
\GPT@Zero
\else
-\Grot@sin
\fi
\fi
\GPT@space\Grot@cos
}%
\ifx\GPT@temp\GPT@MatrixIdentity
\def\Grot@end{}%
\else
\pdfextension save\relax
\pdfextension setmatrix{\GPT@temp}%
% Slightly hacky, but set width of box 0 to 0pt otherwise
% the CTM gets restored in the wrong place
\wd\z@\z@
\fi
}
\def\Grot@end{\pdfextension restore\relax}
\def\Gscale@start{%
\GPT@NormalizeNumber\Gscale@x
\GPT@NormalizeNumber\Gscale@y
\edef\GPT@temp{%
\Gscale@x\GPT@space0 0 \Gscale@y
}%
\ifx\GPT@temp\GPT@MatrixIdentity
\def\Gscale@end{}%
\else
\pdfextension save\relax
\pdfextension setmatrix{\GPT@temp}%
\fi
}
\def\Gscale@end{\pdfextension restore\relax}
\@ifundefined{ifGin@setpagesize}
{\expandafter\let\csname ifGin@setpagesize\expandafter\endcsname
\csname iftrue\endcsname}
{}
\ifGin@setpagesize
\ifx\paperwidth\@undefined\else
\AtBeginDocument{%
% If a package has changed \mag, assume it knows what it is doing
% and leave page size alone
\ifnum\mag=\@m
\@ifundefined{stockwidth}{%
\@ifundefined{paperwidth}{%
}{%
\ifdim\paperwidth>0pt\relax
\ifdim\paperheight>0pt\relax
\pagewidth=\paperwidth
\pageheight=\paperheight
\fi
\fi
}%
}{%
\ifdim\stockwidth>0pt\relax
\ifdim\stockheight>0pt\relax
\pagewidth=\stockwidth
\pageheight=\stockheight
\fi
\fi
}%
\fi
}
\fi
\fi
\def\Gin@extensions{%
.pdf,.png,.jpg,.mps,.jpeg,.jbig2,.jb2,%
.PDF,.PNG,.JPG,.JPEG,.JBIG2,.JB2%
}
\@namedef{Gin@rule@.jpg}#1{{jpg}{.jpg}{#1}}
\@namedef{Gin@rule@.jpeg}#1{{jpg}{.jpeg}{#1}}
\@namedef{Gin@rule@.JPG}#1{{jpg}{.JPG}{#1}}
\@namedef{Gin@rule@.JPEG}#1{{jpg}{.JPEG}{#1}}
\@namedef{Gin@rule@.jb2}#1{{jbig2}{.jb2}{#1}}%
\@namedef{Gin@rule@.jbig2}#1{{jbig2}{.jbig2}{#1}}%
\@namedef{Gin@rule@.png}#1{{png}{.png}{#1}}
\@namedef{Gin@rule@.PNG}#1{{png}{.PNG}{#1}}
\@namedef{Gin@rule@.mps}#1{{mps}{.mps}{#1}}
\@namedef{Gin@rule@.pdf}#1{{pdf}{.pdf}{#1}}
\@namedef{Gin@rule@.PDF}#1{{pdf}{.PDF}{#1}}
\@namedef{Gin@rule@.eps}#1{{eps}{.eps}{#1}}
% MPS conversion
\def\GPT@LoadSuppPdf{%
\@ifundefined{convertMPtoPDF}{%
\edef\@tempa{%
\catcode`\noexpand\<\the\catcode`\<\relax
\catcode`\noexpand\>\the\catcode`\>\relax
\catcode`\noexpand\=\the\catcode`\=\relax
}%
\@makeother\<\@makeother\>\@makeother\=%
% supp-pdf.mkii tests against \undefined:
% just in case someone has defined it ...
\let\GPT@orig@undefined\undefined
\let\undefined\@undefined
\InputIfFileExists{supp-pdf.mkii}{}{}%
\let\undefined\GPT@orig@undefined
\@tempa
}{%
% supp-pdf is probably already loaded.
}%
% If supp-pdf is not available, \convertMPtoPDF generates
% an error message. \providecommand inside the third argument
% of \InputIfFileExists will not work:
% * \InputIfFileExists has problems with parameters (#1).
% * Implementation of \providecommand is insufficient in miniltx.tex
\@ifundefined{convertMPtoPDF}{%
% 2016/05/21 v0.01c use \newcommand here not \newcommand* graphics/4472
\newcommand{\convertMPtoPDF}[3]{%
\PackageError{luatex.def}{%
Cannot convert ##1 from MPS to PDF.
The support file `supp-pdf.mkii' (supp-pdf.tex) is missing%
}{%
The graphics driver for pdfTeX needs `supp-pdf.mkii'
(or `supp-pdf.tex' and/or `supp-mis.tex')
to convert MetaPost output files to PDF.
These files are part of ConTeXt and can also be found here:%
\GPT@space\GPT@space CTAN:macros/pdftex/graphics/.
You'll get more errors if you'll continue now.%
}%
}%
}{}%
\let\GPT@LoadSuppPdf\relax
}
\AtBeginDocument{%
\GPT@LoadSuppPdf
}
% Load package epstopdf if
% a) LaTeX is running (plain TeX users are on their own),
% b) and shell escape is enabled (possibly restricted),
% c) and \DoNotLoadEpstopdf either does not exist or is not \relax,
% d) and neither pst-pdf nor pdftricks is loaded (by \begin{document}).
%
% In other words, by default .eps files will be automatically
% converted to .pdf files when outputting pdf. This can be wrong!
% If the .pdf is the source, rather than the .eps, you should put
% \newcommand{\DoNotLoadEpstopdf}{}
% before even the \documentclass line of your document.
%
% More information about the epstopdf run will be in the .log file;
% see http://ctan.org/pkg/epstopdf-pkg for more info about the
% epstopdf package itself. In turn, it calls the epstopdf script
% (http://ctan.org/pkg/epstopdf).
%
% For the first discussion and background on this, see the thread on latex-l:
% http://thread.gmane.org/gmane.comp.tex.latex.latex3/1465
%
\begingroup\expandafter\expandafter\expandafter\endgroup
\expandafter\ifx\csname DoNotLoadEpstopdf\endcsname\relax
\begingroup\expandafter\expandafter\expandafter\endgroup
\expandafter\ifx\csname AtEndOfPackage\endcsname\relax
\else
\AtEndOfPackage{%
\AtBeginDocument{%
\ifx\includegraphics\@undefined\else
\@ifpackageloaded{pst-pdf}{}{%
\@ifpackageloaded{pdftricks}{}{%
\@ifpackageloaded{graphics}{%
\ifnum\directlua{tex.sprint(status.shell_escape)}>0 %
% only add .eps to file extension list if epstopdf is loaded
\edef\Gin@extensions{\Gin@extensions,.eps}%
\RequirePackage{epstopdf-base}[2009/07/12]%
\fi}{}
}% pdftricks not loaded
}% pst-pdf not loaded
\fi
}% AtBeginDocument block
}% AtEndofPackage block
\fi % AtEndofPackage not defined
\fi % DoNotLoadEpstopdf not defined
\endinput
|