| 1 |
%% |
| 2 |
%% This is file `ppxetex.def', |
| 3 |
%% generated with the docstrip utility. |
| 4 |
%% |
| 5 |
%% The original source files were: |
| 6 |
%% |
| 7 |
%% pdfpages.dtx (with options: `ppxetexdef') |
| 8 |
%% |
| 9 |
%% This file is part of the pdfpages package. |
| 10 |
%% |
| 11 |
%% Copyright (C) 2001-2026 Andreas MATTHIAS |
| 12 |
%% |
| 13 |
%% This work may be distributed and/or modified under the conditions |
| 14 |
%% of the LaTeX Project Public License, either version 1.3c |
| 15 |
%% of this license or (at your option) any later version. |
| 16 |
%% The latest version of this license is in |
| 17 |
%% <http://www.latex-project.org/lppl.txt>. |
| 18 |
%% |
| 19 |
%% This work has the LPPL maintenance status `maintained'. |
| 20 |
%% |
| 21 |
%% The Current Maintainer of this work is |
| 22 |
%% Andreas Matthias <[email protected]>. |
| 23 |
%% |
| 24 |
%% Please send error reports and suggestions for improvements to |
| 25 |
%% Andreas MATTHIAS <[email protected]>. |
| 26 |
%% |
| 27 |
\def\AM@git@tag{v0.6h} |
| 28 |
\def\AM@git@date{2026/03/30} |
| 29 |
\def\AM@git@hash{8329ae0af7} |
| 30 |
\ProvidesFile{ppxetex.def} |
| 31 |
[\AM@git@date\space\AM@git@tag\space |
| 32 |
Pdfpages driver for XeTeX (AM)] |
| 33 |
\begingroup |
| 34 |
\@ifundefined{[email protected]}{% |
| 35 |
\PackageError{pdfpages} |
| 36 |
{The graphics package was loaded with driver\MessageBreak |
| 37 |
`\Gin@driver', which cannot be used with XeTeX} |
| 38 |
{Check the driver option of the graphics package.} |
| 39 |
\global\let\AM@endinput\relax |
| 40 |
\aftergroup\endinput}{} |
| 41 |
\endgroup |
| 42 |
{\catcode`\"=12 |
| 43 |
\gdef\AM@XeTeXquote{"}% |
| 44 |
} |
| 45 |
\def\AM@getpagecount{% |
| 46 |
\expandafter\filename@parse\expandafter{\AM@currentdocname}% |
| 47 |
\begingroup\edef\x{% |
| 48 |
\lowercase{\endgroup |
| 49 |
\def\noexpand\type@ext{\expandafter\scantokens\expandafter{\filename@ext\noexpand}}}}% |
| 50 |
\x |
| 51 |
\ifx\type@ext\AM@pdf@ext |
| 52 |
\ifdefined\subfix |
| 53 |
\let\AM@import@path\@empty |
| 54 |
\else |
| 55 |
\ifdefined\import@path |
| 56 |
\let\AM@import@path\import@path |
| 57 |
\else |
| 58 |
\let\AM@import@path\@empty |
| 59 |
\fi |
| 60 |
\fi |
| 61 |
\setbox\@tempboxa=\hbox{\includegraphics{\AM@currentdocname}}% |
| 62 |
\edef\AM@pagecount{\the\XeTeXpdfpagecount\AM@XeTeXquote |
| 63 |
\AM@import@path\AM@currentdocname\AM@XeTeXquote\relax}% |
| 64 |
\else |
| 65 |
\def\AM@pagecount{1}% |
| 66 |
\fi |
| 67 |
} |
| 68 |
\def\AM@pdf@ext{pdf} |
| 69 |
\begingroup |
| 70 |
\def\gobble@nil#1\@nil{} |
| 71 |
\ifnum\XeTeXversion=0 |
| 72 |
\afterassignment\gobble@nil |
| 73 |
\count@\expandafter\@gobble\XeTeXrevision.\@nil |
| 74 |
\ifnum\count@<997 |
| 75 |
\PackageError{pdfpages} |
| 76 |
{Package pdfpages requires at least XeTeX-0.997} |
| 77 |
{Update your TeX distribution!} |
| 78 |
\global\let\AM@endinput\relax |
| 79 |
\aftergroup\endinput |
| 80 |
\fi |
| 81 |
\fi |
| 82 |
\endgroup |
| 83 |
\def\AM@getpagedimen{% |
| 84 |
\AM@pagewidth=\paperwidth |
| 85 |
\AM@pageheight=\paperheight |
| 86 |
} |
| 87 |
\def\AM@setpagedimen{% |
| 88 |
\pdfpagewidth\AM@pagewidth |
| 89 |
\pdfpageheight\AM@pageheight |
| 90 |
} |
| 91 |
\def\AM@pagesize@boogie{% |
| 92 |
\ifdim\AM@pagewidth=\z@ |
| 93 |
\ifdim\AM@pageheight=\z@ |
| 94 |
\let\AM@pagewidth\paperwidth |
| 95 |
\let\AM@pageheight\paperheight |
| 96 |
\fi |
| 97 |
\fi |
| 98 |
} |
| 99 |
\let\AM@fitpaper@special\relax |
| 100 |
\def\AM@findfile#1{% |
| 101 |
\AM@findfile@i{#1}{pdf}% |
| 102 |
\AM@findfile@ii{#1}% |
| 103 |
} |
| 104 |
\long\def\AM@IfFileExists#1#2#3{% |
| 105 |
\openin\@inputcheck=\AM@XeTeXquote#1\AM@XeTeXquote\relax |
| 106 |
\ifeof\@inputcheck |
| 107 |
\ifx\input@path\@undefined |
| 108 |
\def\reserved@a{#3}% |
| 109 |
\else |
| 110 |
\def\reserved@a{\@iffileonpath{#1}{#2}{#3}}% |
| 111 |
\fi |
| 112 |
\else |
| 113 |
\closein\@inputcheck |
| 114 |
\edef\@filef@und{#1 }% |
| 115 |
\def\reserved@a{#2}% |
| 116 |
\fi |
| 117 |
\reserved@a} |
| 118 |
\ExplSyntaxOn |
| 119 |
\@ifundefined{pdfmanagement_add:nnn}{% |
| 120 |
\def\AM@setRotate{\PLS@Rotate{90}}% |
| 121 |
\def\AM@resetRotate{\PLS@Rotate{0}}% |
| 122 |
}{% |
| 123 |
\def\AM@setRotate{\pdfmanagement_add:nnn{ThisPage}{Rotate}{90}}% |
| 124 |
\def\AM@resetRotate{}% |
| 125 |
}% |
| 126 |
\ExplSyntaxOff |
| 127 |
\def\AM@linktodoc@special@begin{% |
| 128 |
\special{pdf: annot |
| 129 |
width \the\wd\@tempboxa\space |
| 130 |
height \the\ht\@tempboxa\space |
| 131 |
depth \the\dp\@tempboxa\space |
| 132 |
<< /Type /Annot |
| 133 |
/Subtype /Link /Border [0 0 0] |
| 134 |
/A << /S /GoToR |
| 135 |
/F (\AM@linkfilename) |
| 136 |
/D [\AM@linktodoc@page@m@ne \AM@linktodocfit] |
| 137 |
\ifAM@newwindow/NewWindow true\fi >> |
| 138 |
>>}% |
| 139 |
} |
| 140 |
\let\AM@linktodoc@special@end\relax |
| 141 |
\def\AM@survey@special@begin{% |
| 142 |
\special{pdf: annot |
| 143 |
width \the\wd\@tempboxa\space |
| 144 |
height \the\ht\@tempboxa\space |
| 145 |
depth \the\dp\@tempboxa\space |
| 146 |
<< /Type /Annot |
| 147 |
/Subtype /Link /Border [0 0 0] |
| 148 |
/A << /S /GoTo |
| 149 |
/D (pdfpages.\AM@linktodoc@page@m@ne) >> |
| 150 |
>>}% |
| 151 |
} |
| 152 |
\let\AM@survey@special@end\relax |
| 153 |
\def\AM@thread@special@begin{% |
| 154 |
\special{pdf: thread @\AM@threadname\space |
| 155 |
width \the\wd\@tempboxa\space |
| 156 |
height \the\ht\@tempboxa\space |
| 157 |
depth \the\dp\@tempboxa\space |
| 158 |
<<\threadinfodict>> |
| 159 |
}% |
| 160 |
} |
| 161 |
\let\AM@thread@special@end\relax |
| 162 |
\def\AM@reset@view{% |
| 163 |
\def\AM@view{/Fit}% |
| 164 |
\def\AM@view@xpos{0}% |
| 165 |
\def\AM@view@ypos{}} |
| 166 |
\def\AM@dest@special{% |
| 167 |
\special{pdf: dest (\AM@linkname.\AM@page) [ @thispage \AM@view ]}} |
| 168 |
\def\AM@anchor@special{% |
| 169 |
\special{pdf: dest (pdfpages.\the\count1) [ @thispage /Fit ]}} |
| 170 |
\def\AM@convert@dest#1{% |
| 171 |
\AM@convert@dest@i #1 0 0 0\END} |
| 172 |
\def\AM@convert@dest@i#1 #2 #3 #4\END{% |
| 173 |
\def\tag{#1}% |
| 174 |
\def\x{FitH}% |
| 175 |
\ifx\x\tag |
| 176 |
\def\AM@view{/FitH @ypos}% |
| 177 |
\def\AM@view@ypos{#2}% |
| 178 |
\else |
| 179 |
\def\x{FitBH}% |
| 180 |
\ifx\x\tag |
| 181 |
\def\AM@view{/FitBH @ypos}% |
| 182 |
\def\AM@view@ypos{#2}% |
| 183 |
\else |
| 184 |
\def\x{FitV}% |
| 185 |
\ifx\x\tag |
| 186 |
\def\AM@view{/FitV @xpos}% |
| 187 |
\def\AM@view@xpos{#2}% |
| 188 |
\else |
| 189 |
\def\x{FitBV}% |
| 190 |
\ifx\x\tag |
| 191 |
\def\AM@view{/FitBV @xpos}% |
| 192 |
\def\AM@view@xpos{#2}% |
| 193 |
\else |
| 194 |
\def\x{fitr}% |
| 195 |
\ifx\x\tag |
| 196 |
\def\AM@view{/XYZ @xpos @ypos null}% |
| 197 |
\PackageWarningNoLine{pdfpages}{% |
| 198 |
`linkfit=FitR' is not supported.}% |
| 199 |
\else |
| 200 |
\def\x{FitB}% |
| 201 |
\ifx\x\tag |
| 202 |
\def\AM@view{/FitB}% |
| 203 |
\else |
| 204 |
\def\x{XYZ}% |
| 205 |
\ifx\x\tag |
| 206 |
\def\AM@view{/XYZ @xpos @ypos #4}% |
| 207 |
\def\AM@view@xpos{#2}% |
| 208 |
\def\AM@view@ypos{#3}% |
| 209 |
\else |
| 210 |
\def\x{Region}% |
| 211 |
\ifx\x\tag |
| 212 |
\def\AM@view{/XYZ @xpos @ypos null}% |
| 213 |
\PackageWarningNoLine{pdfpages}{% |
| 214 |
`linkfit=Region' is not supported by XeTeX.}% |
| 215 |
\else |
| 216 |
\def\AM@view{/Fit}% |
| 217 |
\fi |
| 218 |
\fi |
| 219 |
\fi |
| 220 |
\fi |
| 221 |
\fi |
| 222 |
\fi |
| 223 |
\fi |
| 224 |
\fi |
| 225 |
} |
| 226 |
\let\AM@disable@includegraphics\relax |
| 227 |
\endinput |
| 228 |
%% |
| 229 |
%% End of file `ppxetex.def'. |