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
|
%% This is file `dvipdfmx.def' for DVIPDFMx by J.-H. Cho and S. Hirata
%% based upon `dvipdf.def' in the LaTeX `Graphics Bundle'.
%%
%% Copyright 2005-2016 LaTeX3 Project, Jin-Hwan Cho, Shunsaku Hirata
%% (with contributions from many others)
%%
%% This file is not part of the Standard LaTeX `Graphics Bundle'.
%% It may be distributed under the terms of the LaTeX Project Public
%% License, as described in lppl.txt in the base LaTeX distribution.
%% Either version 1.0 or, at your option, any later version.
%%
%% 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{dvipdfmx.def}
[2016/07/11 v4.12 LaTeX color/graphics driver for dvipdfmx (L3/ChoF)]
%
% miniltx.tex does not define \PackageWarning
\@ifundefined{PackageWarning}{%
\def\PackageWarning#1#2{%
\begingroup
\def\@spaces{\space\space\space\space}%
\ifx\on@line\@undefined\def\on@line{}\fi
\newlinechar=10 %
\def\MessageBreak{%
^^J(#1)\@spaces\@spaces\@spaces\@spaces
}%
\immediate\write16{^^JPackage #1 Warning: #2\on@line.^^J}%
\endgroup
}%
}{}
\def\GPT@warn{\PackageWarning{dvipdfmx.def}}%
\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]}{}%
\fi}
\def\color@gray#1#2{%
\c@lor@arg{#2}%
\edef#1{[#2]}%
}
\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]}%
}
\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]}%
}
\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@}}
%%
%% the following 7 lines do not work. (2016/06/22)
%%\def\color@hsb#1#2{\c@lor@@hsb#2\@@#1}
%%\def\c@lor@@hsb#1,#2,#3\@@#4{%
%% \c@lor@arg{#1}%
%% \c@lor@arg{#2}%
%% \c@lor@arg{#3}%
%% \edef#4{[#1 #2 #3] hsb}%
%% }
\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'}{}}%
{\edef#4{ #1}}%
}
\def\c@lor@to@ps#1 #2\@@{\csname c@lor@ps@#1\endcsname#2 \@@}
\def\c@lor@ps@#1 #2\@@{TeXDict begin #1 end}
\def\c@lor@ps@rgb#1\@@{#1 setrgbcolor}
\def\c@lor@ps@hsb#1\@@{#1 sethsbcolor}
\def\c@lor@ps@cmyk#1\@@{#1 setcmykcolor}
\def\c@lor@ps@gray#1\@@{#1 setgray}
\def\current@color{[0]}
\def\set@color{%
\special{pdf:bcolor \current@color
}\aftergroup\reset@color}
\def\reset@color{\special{%
pdf:ecolor}}
\def\set@page@color{\special{%
pdf:bgcolor \current@color}}
\def\define@color@named#1#2{%
\expandafter\let\csname col@#1\endcsname\@nnil}
%
% Graphics
%
\def\declareimagemask{%
\@ifnextchar[\declareimagemask@i{\declareimagemask@i[]}}
\def\declareimagemask@i[#1]#2#3{%
\special{pdf:image @#2\space hide (#3) #1}}
%
% import from pdftex.def
%
\let\GPT@pagebox@option\@empty
\begingroup
\toks@{%
\define@key{Gin}{page}{\def\Gin@page{#1}}
\define@key{Gin}{mask}{\def\Gin@mask{#1}}
\define@key{Gin}{interpolate}[true]{%
\lowercase{\Gin@boolkey{#1}}{interpolate}}
\define@key{Gin}{pagebox}{%
\expandafter\let\expandafter\GPT@pagebox%
\csname GPT@pagebox@#1\endcsname
\ifx\GPT@pagebox\relax
\let\GPT@pagebox\@empty
\GPT@warn{%
Unknown value `#1' for `pagebox'.\MessageBreak
Supported values:\MessageBreak
mediabox, cropbox, bleedbox, trimbox, artbox%
}%
\else%
\def\GPT@pagebox@option{-B \GPT@pagebox\space}%
\fi%
}%
}
\@ifundefined{define@key}{
\edef\x{\endgroup
\noexpand\AtBeginDocument{%
\noexpand\@ifundefined{define@key}{}{\the\toks@}%
}%
}\x
}{%
\expandafter\endgroup\the\toks@
}%
\def\GPT@pagebox@cropbox{cropbox}%
\def\GPT@pagebox@mediabox{mediabox}%
\def\GPT@pagebox@artbox{artbox}%
\def\GPT@pagebox@trimbox{trimbox}%
\def\GPT@pagebox@bleedbox{bleedbox}%
%
% end (import from pdftex.def)
%
% improved by N. Abe to cache BoundingBox for pdfpages package
%
\def\Gread@pdf#1{%
\edef\@tempa{pdf@bbox@cache@\Gin@page @\GPT@pagebox @#1}%
\expandafter\expandafter\expandafter\@ifundefined\expandafter{\@tempa}{\Gread@@pdf{#1}}{%
\edef\@gtempa{\csname\@tempa\endcsname}%
\expandafter\Gread@parse@bb\@gtempa\\}}
\def\Gread@@pdf#1{%
\begingroup
\@tempcnta\z@
\loop\ifnum\@tempcnta<\@xxxii
\catcode\@tempcnta14 %
\advance\@tempcnta\@ne
\repeat
\catcode`\^^?14 %
\let\do\@makeother
\dospecials
\catcode`\ 10 %
\catcode`\^^I10 %
\catcode\endlinechar5 %
\@makeother\:%
\@makeother\-%
\immediate\openin\@inputcheck"#1" % allow spaces in a name of a .xbb file
\ifeof\@inputcheck
\def\@tempc{!}%
\ifx\Gin@page\@tempc
\def\@tempc{}%
\else
\def\@tempc{-p \Gin@page\space}%
\fi
\immediate\openin\@inputcheck="|extractbb \GPT@pagebox@option \@tempc -O \Gin@base\Gin@ext"%
\fi
\Gread@true
\let\@tempb\Gread@false
\ifeof\@inputcheck
\@latex@error
{Cannot run pipe command. Try --shell-escape^^J%
(--enable-pipes in MikTeX) option}%
{}%
\else
\loop
\read\@inputcheck to\@tempa
\ifeof\@inputcheck
\Gread@false
\else
\expandafter\Gread@find@bb\@tempa:.\\%
\fi
\ifGread@
\repeat
\immediate\closein\@inputcheck
\fi
%
% If BoundingBox is not obtained, extractbb may be an old one which does not
% support the -p and/or -B options, and usage of extractbb is printed to stdout.
% Thus we retry without the -p and/or -B optons.
%
\ifGin@bbox\else
\immediate\openin\@inputcheck="|extractbb -O \Gin@base\Gin@ext"%
\message{^^JI try without the new options^^J}%
\Gread@true
\let\@tempb\Gread@false
\ifeof\@inputcheck
\@latex@error
{Cannot run pipe command. Try --shell-escape^^J%
(--enable-pipes in MikTeX) option}%
{}%
\else
\loop
\read\@inputcheck to\@tempa
\ifeof\@inputcheck
\Gread@false
\else
\expandafter\Gread@find@bb\@tempa:.\\%
\fi
\ifGread@
\repeat
\immediate\closein\@inputcheck
\aftergroup\Gin@clear@pagebox
\fi
\fi
%
% improved by N. Abe to cache BoundingBox for pdfpages package
%
\ifGin@bbox
\edef\@tempa{pdf@bbox@cache@\Gin@page @\GPT@pagebox @#1}%
\expandafter\expandafter\expandafter\xdef\expandafter\csname\@tempa\endcsname{\@gtempa}%
\else
\@latex@error
{Cannot determine size of image (no BoundingBox)}%
{}%
\gdef\@gtempa{0 0 72 72 }%
\fi
\endgroup
\expandafter\Gread@parse@bb\@gtempa\\}
\def\Gin@clear@pagebox{%
\let\GPT@pagebox\@empty}
\let\Gread@bmp\Gread@pdf
\def\Gin@page{!}
\def\Gin@mask{!}
\newif\ifGin@interpolate\Gin@interpolatefalse
\let\GPT@pagebox\@empty
\def\Ginclude@pdf#1{%
\message{<#1>}%
\bgroup
\def\@tempa{!}%
\special{pdf:epdf\space
\ifx\Gin@page\@tempa\else page\space\Gin@page\space\fi
\ifx\GPT@pagebox\@empty\else pagebox\space\GPT@pagebox\space\fi
bbox\space\Gin@llx\space\Gin@lly\space\Gin@urx\space\Gin@ury\space
clip\space\ifGin@clip 1\else 0\fi\space
\ifx\Gin@scalex\@tempa\else width\space\the\Gin@req@width\space\fi
\ifx\Gin@scaley\@tempa\else height\space\the\Gin@req@height\space\fi
(#1)\space
\ifx\Gin@mask\@tempa
\ifGin@interpolate<</Interpolate\space true>>\fi
\else
<</SMask @\Gin@mask\space%
\ifGin@interpolate/Interpolate\space true\fi>>%
\fi}%
\egroup}
\def\Ginclude@bmp#1{%
\message{<#1>}%
\bgroup
\def\@tempa{!}%
\special{pdf:image\space
\ifx\Gin@page\@tempa\else page\space\Gin@page\space\fi
% The next line was \ifGin@bbox previously. However, LaTeX can read
% BoundingBox from a .xbb file even when \Gin@bboxfalse.
% Thus, we give bbox in the cases of trim/viewport, since
% trim/viewport don't work without bbox.
\ifx\Gin@ollx\@undefined\else
bbox\space\Gin@llx\space\Gin@lly\space\Gin@urx\space\Gin@ury\space
clip\space\ifGin@clip 1\else 0\fi\space
\fi
\ifx\Gin@scalex\@tempa\else width\space\the\Gin@req@width\space\fi
\ifx\Gin@scaley\@tempa\else height\space\the\Gin@req@height\space\fi
(#1)\space
\ifx\Gin@mask\@tempa
\ifGin@interpolate<</Interpolate\space true>>\fi
\else
<</SMask @\Gin@mask\space%
\ifGin@interpolate/Interpolate\space true\fi>>%
\fi}%
\egroup}
\newif\if@trim@vport
\def\Ginclude@eps#1{%
\message{<#1>}%
\bgroup
\ifx\Undefined\Gin@vllx\else\@trim@vporttrue\fi
\def\@tempa{!}%
\dimen@\Gin@urx\p@
\advance\dimen@ -\Gin@llx\p@
\if@trim@vport
\advance\dimen@ \Gin@vllx\p@
\fi
\edef\Gin@urx{\strip@pt\dimen@}%
\dimen@\Gin@ury\p@
\advance\dimen@ -\Gin@lly\p@
\if@trim@vport
\advance\dimen@ \Gin@vlly\p@
\fi
\edef\Gin@ury{\strip@pt\dimen@}%
\dimen@\Gin@req@width
\dimen@ii.1bp%
\divide\dimen@\dimen@ii
\@tempdima\Gin@req@height
\divide\@tempdima\dimen@ii
\special{PSfile="#1"\space
\if@trim@vport
llx=\Gin@vllx\space
lly=\Gin@vlly\space
\fi
urx=\Gin@urx\space
ury=\Gin@ury\space
\ifx\Gin@scalex\@tempa\else rwi=\number\dimen@\space\fi
\ifx\Gin@scaley\@tempa\else rhi=\number\@tempdima\space\fi
\ifGin@clip clip\fi}%
\egroup}
%
% In the above \Ginclude@eps, llx, lly, urx, and ury are translated to match
% the -dEPSCrop option for Ghostscript to convert eps to pdf.
% In the case of eps files created by MetaPost, the files are included
% directly without the help of Ghostscript. That is, we have to translate
% the origin accordingly if we use \Ginclude@eps for eps files created by
% MetaPost. In TeX Live 2015, the translation of the origin was the default.
% After TeX Live 2016, however, the translation of the origin is enabled only
% if the --mvorigin option is given for dvipdfmx or xdvipdfmx.
% This may be a bit inconvenient, especially in the case of XeTeX where
% xdvipdfmx is usually called as a pipe. Therefore we introduce a new suffix
% .mps(or .MPS) to support inclusion of eps files created by MetaPost without
% the option --mvorigin.
%
\def\Ginclude@mps#1{%
\message{<#1>}%
\bgroup
\def\@tempa{!}%
\dimen@\Gin@req@width
\dimen@ii.1bp%
\divide\dimen@\dimen@ii
\@tempdima\Gin@req@height
\divide\@tempdima\dimen@ii
\special{PSfile="#1"\space
llx=\Gin@llx\space
lly=\Gin@lly\space
urx=\Gin@urx\space
ury=\Gin@ury\space
\ifx\Gin@scalex\@tempa\else rwi=\number\dimen@\space\fi
\ifx\Gin@scaley\@tempa\else rhi=\number\@tempdima\space\fi
\ifGin@clip clip\fi}%
\egroup}
%
\def\Grot@start{%
\special{pdf:btrans rotate \Grot@angle}}
\def\Grot@end{\special{pdf:etrans}}
\def\Gscale@start{%
\special{pdf:btrans}%
\special{pdf:literal \Gscale@x\space 0 0 \Gscale@y\space 0 0 cm}}
\def\Gscale@end{\special{pdf:etrans}}
\def\Gin@PS@raw#1{\special{ps: #1}}
\def\Gin@PS@restored#1{\special{" #1}}
\def\Gin@PS@literal@header#1{\AtBeginDvi{\special{! #1}}}
\def\Gin@PS@file@header#1{\AtBeginDvi{\special{header=#1}}}
\def\Gin@extensions{% order here is like xetex.def, except for PS
.pdf,.PDF,.ai,.AI,%
.png,.PNG,.jpg,.JPG,.jpeg,.JPEG,.jp2,.JP2,.jpf,.JPF,.bmp,.BMP,%
.ps,.PS,.eps,.EPS,.mps,.MPS,%
.pz,.eps.Z,.ps.Z,.ps.gz,.eps.gz}
%
\@namedef{Gin@rule@.pdf}#1{{pdf}{.xbb}{#1}}
\@namedef{Gin@rule@.PDF}#1{{pdf}{.xbb}{#1}}
%
\@namedef{Gin@rule@.ai}#1{{pdf}{.xbb}{#1}}
\@namedef{Gin@rule@.AI}#1{{pdf}{.xbb}{#1}}
%
\@namedef{Gin@rule@.jp2}#1{{bmp}{.xbb}{#1}}
\@namedef{Gin@rule@.JP2}#1{{bmp}{.xbb}{#1}}
%
\@namedef{Gin@rule@.jpf}#1{{bmp}{.xbb}{#1}}
\@namedef{Gin@rule@.JPF}#1{{bmp}{.xbb}{#1}}
%
\@namedef{Gin@rule@.png}#1{{bmp}{.xbb}{#1}}
\@namedef{Gin@rule@.PNG}#1{{bmp}{.xbb}{#1}}
%
\@namedef{Gin@rule@.jpg}#1{{bmp}{.xbb}{#1}}
\@namedef{Gin@rule@.JPG}#1{{bmp}{.xbb}{#1}}
%
\@namedef{Gin@rule@.jpeg}#1{{bmp}{.xbb}{#1}}
\@namedef{Gin@rule@.JPEG}#1{{bmp}{.xbb}{#1}}
%
\@namedef{Gin@rule@.jp2}#1{{bmp}{.xbb}{#1}}
\@namedef{Gin@rule@.JP2}#1{{bmp}{.xbb}{#1}}
%
\@namedef{Gin@rule@.jpf}#1{{bmp}{.xbb}{#1}}
\@namedef{Gin@rule@.JPF}#1{{bmp}{.xbb}{#1}}
%
\@namedef{Gin@rule@.bmp}#1{{bmp}{.xbb}{#1}}
\@namedef{Gin@rule@.BMP}#1{{bmp}{.xbb}{#1}}
%
\@namedef{Gin@rule@.ps}#1{{eps}{.ps}{#1}}
\@namedef{Gin@rule@.PS}#1{{eps}{.ps}{#1}}
%
\@namedef{Gin@rule@.eps}#1{{eps}{.eps}{#1}}
\@namedef{Gin@rule@.EPS}#1{{eps}{.eps}{#1}}
%
\@namedef{Gin@rule@.mps}#1{{mps}{.mps}{#1}}
\@namedef{Gin@rule@.MPS}#1{{mps}{.mps}{#1}}
% (don't bother with uppercase versions for these Unixish extensions)
\@namedef{Gin@rule@.pz}#1{{eps}{.xbb}{`gunzip -c #1}}
\@namedef{Gin@rule@.eps.Z}#1{{eps}{.eps.xbb}{`gunzip -c #1}}
\@namedef{Gin@rule@.ps.Z}#1{{eps}{.ps.xbb}{`gunzip -c #1}}
\@namedef{Gin@rule@.ps.gz}#1{{eps}{.ps.xbb}{`gunzip -c #1}}
\@namedef{Gin@rule@.eps.gz}#1{{eps}{.eps.xbb}{`gunzip -c #1}}
%
\@namedef{Gin@rule@*}#1{{eps}{\Gin@ext}{#1}}
% v4.10
% Support new (no)setpagesize option of graphics and color.
% v4.11
% Use \special{pdf:pagesize ...} instead of \special{papersize=...}
% to support \mag (dvipdfmx only)
\@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
\AtBeginDvi{%
\begingroup
\ifx\stockwidth\@undefined\else
\paperwidth\stockwidth
\paperheight\stockheight
\fi
\ifdim\paperwidth>\z@
\ifdim\paperheight>\z@
\special{pdf:pagesize width \the\paperwidth\space height \the\paperheight}%
\fi
\fi
\endgroup}%
\fi
}
\fi
\fi
\endinput
%%
%% End of file `dvipdfmx.def'.
|