summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/pdfpages/pdfpages.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2019-09-22 22:17:22 +0000
committerKarl Berry <karl@freefriends.org>2019-09-22 22:17:22 +0000
commit44d4827fac150f508a6985f9053579f13479b5da (patch)
treeb78c86b7f706592fa4c8cc78eff138d86a8b52cf /Master/texmf-dist/tex/latex/pdfpages/pdfpages.sty
parent225a794024fefdf5231c3931ebe747a1cd302fc8 (diff)
pdfpages (23sep19)
git-svn-id: svn://tug.org/texlive/trunk@52154 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/pdfpages/pdfpages.sty')
-rw-r--r--Master/texmf-dist/tex/latex/pdfpages/pdfpages.sty181
1 files changed, 101 insertions, 80 deletions
diff --git a/Master/texmf-dist/tex/latex/pdfpages/pdfpages.sty b/Master/texmf-dist/tex/latex/pdfpages/pdfpages.sty
index 94548fce9e1..b01853cb314 100644
--- a/Master/texmf-dist/tex/latex/pdfpages/pdfpages.sty
+++ b/Master/texmf-dist/tex/latex/pdfpages/pdfpages.sty
@@ -24,12 +24,12 @@
%% Please send error reports and suggestions for improvements to
%% Andreas MATTHIAS <andreas.matthias@gmail.com>.
%%
-\def\AM@fileversion{v0.5l}
+\def\AM@fileversion{v0.5n}
\def\AM@Git@Date@process$#1: #2 #3${\AM@Git@Date@process@i#2\END}
\def\AM@Git@Date@process@i#1-#2-#3\END{\def\AM@Git@Date{#1/#2/#3}}
\def\AM@Git@SHA@process$#1: #2${\def\AM@Git@SHA{#2}}
-\AM@Git@Date@process$Date: 2017-10-31 14:12:08 +0100 $
-\AM@Git@SHA@process$SHA-1: 9deefd6c8c22356ce47773245098390089885925 $
+\AM@Git@Date@process$Date: 2019-09-21 22:35:13 +0200 $
+\AM@Git@SHA@process$SHA-1: f6e5700ba0dc915398ae6b0f222a8cc7f0ff2eff $
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{pdfpages}
[\AM@Git@Date\space\AM@fileversion\space
@@ -146,16 +146,22 @@
\newcommand*{\AM@picturecommandstar}{}
\newsavebox{\AM@pagebox}
\newif\ifAM@integer
-\begingroup
-\@makeother_
-\gdef\AM@checkinteger#1{%
- \ifcat _\ifnum9<1#1_\else A\fi
- \AM@integertrue
+\def\AM@checkinteger#1{%
+ \expandafter\AM@checkinteger@\expandafter{#1}}
+\def\AM@checkinteger@#1{%
+ \begingroup
+ \def\do##1{\uccode`##1=`\%}%
+ \do\0\do\1\do\2\do\3\do\4\do\5\do\6\do\7\do\8\do\9%
+ \makeatletter
+ \catcode`\%=9
+ \endlinechar\m@ne
+ \uppercase{\scantokens{\def\AM@temp{#1}}}%
+ \ifx\AM@temp\@empty
+ \global\AM@integertrue
\else
- \AM@integerfalse
+ \global\AM@integerfalse
\fi
-}
-\endgroup
+ \endgroup}
\newcommand*{\AM@findfile@i}[2]{%
\ifAM@pkg@demo
\else
@@ -750,78 +756,93 @@
\def\AM@temp{#1}%
\ifx\END#1
\else
- \AM@checkrange#1-\END
+ \AM@range@or@docname{#1}%
\expandafter\AM@readlisti
\fi
}
-\newcommand{\AM@checkrange}{}
-\def\AM@checkrange#1-#2\END{%
- \edef\AM@tempi{\AM@trim@space{#1}}%
- \ifx\\#2\\%
- \AM@checkinteger{\AM@tempi}%
- \ifAM@integer
- \AM@checkpagenumber{\AM@tempi}%
- \AM@append{\AM@tempi}%
+\def\AM@range@or@docname#1{%
+ \edef\AM@arg{\AM@trim@space{#1}}%
+ \expandafter\AM@checkrange\AM@arg-\END
+ \ifAM@isrange
+ \ifx\AM@currentdocname\relax
+ \AM@setnewdocname{\AM@arg}%
\else
- \expandafter\ifx\expandafter\\\AM@tempi\\\AM@append{}%
- \else\AM@setnewdocname{\AM@tempi}\fi
+ \AM@expand@range\AM@i\AM@ii
\fi
\else
- \expandafter\ifx\expandafter\\\AM@tempi\\%
- \@tempcnta=1\relax
- \AM@checklast#2\END
+ \AM@setnewdocname{\AM@arg}%
+ \fi
+}
+\def\AM@last{last}
+\def\AM@empty{}
+\newif\ifAM@isrange
+\def\AM@checkrange#1-#2\END{%
+ \AM@israngefalse
+ \AM@check@valid@pagenumber{#1}%
+ \ifx\\#1\\%
+ \def\AM@i{1}%
+ \else
+ \edef\AM@i{#1}%
+ \fi
+ \def\AM@ii{}%
+ \ifAM@isrange
+ \ifx\\#2\\%
\else
- \def\AM@cmp{last}%
- \ifx\AM@cmp\AM@tempi
- \@tempcnta=\AM@pagecount\relax
- \AM@checklast#2\END
- \else
- \AM@checkinteger{\AM@tempi}%
- \ifAM@integer
- \@tempcnta=\AM@tempi\relax
- \AM@checkpagenumber{\the\@tempcnta}%
- \AM@checklast#2\END
- \else
- \AM@setnewdocname{\AM@temp}%
- \fi
+ \edef\AM@ii{\AM@strip@slash#2\END}%
+ \AM@check@valid@pagenumber{\AM@ii}%
+ \ifx\AM@ii\AM@empty
+ \let\AM@ii\AM@last
\fi
\fi
\fi
}
-\newcommand{\AM@checklast}{}
-\def\AM@checklast#1-\END{%
- \edef\AM@tempii{\AM@trim@space{#1}}%
- \expandafter\ifx\expandafter\\\AM@tempii\\
- \@tempcntb=\AM@pagecount\relax
- \ifAM@DVIoutput
- \ifnum\AM@pagecount=1
- \@tempcntb\@tempcnta
- \fi
- \fi
- \advance\@tempcntb\@ne
- \whiledo{\@tempcnta<\@tempcntb}{%
- \AM@append{\the\@tempcnta}%
- \advance\@tempcnta\@ne
- }%
+\def\AM@expand@range#1#2{%
+ \edef\AM@i{#1}%
+ \edef\AM@ii{#2}%
+ \ifx\AM@i\AM@last
+ \let\AM@i\AM@lastpage
+ \let\AM@i\AM@pagecount
+ \fi
+ \ifx\AM@ii\AM@last
+ \let\AM@ii\AM@lastpage
+ \let\AM@ii\AM@pagecount
+ \fi
+ \ifx\AM@ii\AM@empty
+ \let\AM@ii\AM@i
+ \fi
+ \@tempcnta=\AM@i\relax
+ \@tempcntb=\AM@ii\relax
+ \ifnum\@tempcnta<\@tempcntb
+ \def\AM@rel{<}%
+ \let\AM@inc\@ne
\else
- \def\AM@cmp{last}%
- \ifx\AM@cmp\AM@tempii
- \let\AM@tempii\AM@pagecount
- \fi
- \AM@checkinteger{\AM@tempii}%
- \ifAM@integer
- \@tempcntb=\AM@tempii\relax
- \AM@checkpagenumber{\the\@tempcntb}%
- \ifnum\@tempcnta<\@tempcntb \def\AM@rel{<}\def\AM@inc{\@ne}%
- \else \def\AM@rel{>}\def\AM@inc{\m@ne}\fi
- \advance\@tempcntb\AM@inc
- \whiledo{\@tempcnta\AM@rel\@tempcntb}{%
- \AM@append{\the\@tempcnta}%
- \advance\@tempcnta\AM@inc
- }%
- \else
- \AM@setnewdocname{\AM@temp}%
- \fi
+ \def\AM@rel{>}%
+ \let\AM@inc\m@ne
+ \fi
+ \advance\@tempcntb\AM@inc
+ \whiledo{\@tempcnta\AM@rel\@tempcntb}{%
+ \AM@checkpagenumber{\the\@tempcnta}%
+ \AM@append{\the\@tempcnta}%
+ \advance\@tempcnta\AM@inc
+ }%
+}
+\def\AM@check@valid@pagenumber#1{%
+ \AM@checkinteger{#1}%
+ \ifAM@integer
+ \AM@israngetrue
+ \else
+ \AM@israngefalse
+ \fi
+ \edef\AM@tmp{#1}%
+ \ifx\AM@tmp\AM@last
+ \AM@israngetrue
+ \fi
+}
+\def\AM@strip@slash#1-#2\END{%
+ \ifx\\#2\\%
+ #1%
+ \else
+ #1-#2%
\fi
}
\providecommand*{\AM@checkpagenumber}[1]{%
@@ -1330,11 +1351,11 @@
\newtoks\AM@toc@title
\newcommand{\AM@parse@toclisti}{}
\def\AM@parse@toclisti#1,#2,#3,#4,#5,#6\END{%
- \def\AM@toc@page{\AM@trim@space{#1}}%
- \def\AM@toc@section{\AM@trim@space{#2}}%
- \def\AM@toc@level{\AM@trim@space{#3}}%
+ \edef\AM@toc@page{\AM@trim@space{#1}}%
+ \edef\AM@toc@section{\AM@trim@space{#2}}%
+ \edef\AM@toc@level{\AM@trim@space{#3}}%
\AM@toc@title{\ignorespaces #4}%
- \def\AM@toc@label{\AM@trim@space{#5}}%
+ \edef\AM@toc@label{\AM@trim@space{#5}}%
\AM@checkinteger{\AM@toc@page}%
\ifAM@integer\else
\PackageError{pdfpages}
@@ -1377,10 +1398,10 @@
}
\newcommand{\AM@parse@loflisti}{}
\def\AM@parse@loflisti#1,#2,#3,#4,#5\END{%
- \def\AM@lof@page{\AM@trim@space{#1}}%
- \def\AM@lof@list{\AM@trim@space{#2}}%
+ \edef\AM@lof@page{\AM@trim@space{#1}}%
+ \edef\AM@lof@list{\AM@trim@space{#2}}%
\def\AM@lof@heading{\ignorespaces #3}%
- \def\AM@lof@label{\AM@trim@space{#4}}%
+ \edef\AM@lof@label{\AM@trim@space{#4}}%
\AM@checkinteger{\AM@lof@page}%
\ifAM@integer\else
\PackageError{pdfpages}
@@ -1470,7 +1491,7 @@
\AtBeginDocument{\AM@TeXpower@hook}
\def\AM@CheckValue#1#2{%
\ifx\\#2\\\PackageError{pdfpages}
- {Option `#1' must have a non-empty value}%
+ {Option `#1' must have a non-empty value}{}%
\fi
}
\define@key{pdfpages}{page}{\PackageWarningNoLine{pdfpages}{%
@@ -1480,7 +1501,7 @@
\AM@CheckValue{pages}{#1}%
\def\AM@pagestemp{#1}}
\define@key{pdfpages}{pages}{\AM@CheckValue{pages}{#1}%
- \def\AM@pagestemp{#1}}
+ \edef\AM@pagestemp{#1}}
\define@key{pdfpages}{nup}{\AM@parse@nup#1x\END}
\define@key{pdfpages}{deltax}{\AM@parse@deltax#1 \\}
\define@key{pdfpages}{deltay}{\AM@parse@deltay#1 \\}