From a4f22423a8ddb08b9e03213e7ac78e0c82373158 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Wed, 20 Apr 2016 21:53:12 +0000 Subject: pdfpages (20apr16) git-svn-id: svn://tug.org/texlive/trunk@40638 c570f23f-e606-0410-a88d-b1316a301751 --- .../texmf-dist/source/latex/pdfpages/pdfpages.dtx | 105 ++++++++++++++------- 1 file changed, 71 insertions(+), 34 deletions(-) (limited to 'Master/texmf-dist/source/latex/pdfpages') diff --git a/Master/texmf-dist/source/latex/pdfpages/pdfpages.dtx b/Master/texmf-dist/source/latex/pdfpages/pdfpages.dtx index c5c9e9d51fa..a97457fcf7a 100644 --- a/Master/texmf-dist/source/latex/pdfpages/pdfpages.dtx +++ b/Master/texmf-dist/source/latex/pdfpages/pdfpages.dtx @@ -27,12 +27,12 @@ %<*dtx> \makeatletter % -\def\AM@fileversion{v0.5e} +\def\AM@fileversion{v0.5f} \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: 2016-04-13 23:07:07 +0200 $ -\AM@Git@SHA@process$SHA-1: 50fd5681f79b0951a6874e051507955fd5adce0f $ +\AM@Git@Date@process$Date: 2016-04-19 23:45:44 +0200 $ +\AM@Git@SHA@process$SHA-1: 5a5a8af44ff5d6119ea64143e5089987a1df8963 $ % % % @@ -84,7 +84,7 @@ % % \GetFileInfo{pdfpages.dtx} % -% \CheckSum{4869} +% \CheckSum{4916} % % \CharacterTable % {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z @@ -1316,14 +1316,32 @@ \fi } % \end{macrocode} +% The options |width| and |height| (of graphics.sty) have no reasonable +% meaning for |\includepdf|. Quit the contrary they spoil the calculation +% of the scaling factors and therefore should not be used with pdfpages. +% +% Nevertheless these options are very usefull for |\includegraphics| and +% some users even set these options globally: +% +% \setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio} +% +% In this way these options have an undesirable impact on pdfpages as +% well since pdfpages forwards these options to graphics. Therefore we +% kind of disable these settings by inserting |width=!,height=!| into +% |\AM@global@opts| which itself gets finally inserted into the option +% list of each |\includegraphics| call. +% +% \begin{macrocode} +\newtoks\AM@global@opts +\newcommand*{\AM@disable@width@height}{width=!,height=!} +\AM@global@opts\expandafter{\AM@disable@width@height} +% \end{macrocode} % \macro{\includepdfset} % This command sets global options for |\includepdf| % and |\includepdfmerge|. % \begin{macrocode} \newcommand*{\includepdfset}[1]{% - \AM@split@options{pdfpages}{#1}% - \edef\AM@temp{{pdfpages}{\the\@temptokena}}% - \expandafter\setkeys\AM@temp + \AM@global@opts\expandafter{\AM@disable@width@height,#1}% } % \end{macrocode} % \macro{\includepdf} @@ -1333,7 +1351,10 @@ \newcommand*{\includepdf}[2][]{% \begingroup \let\AM@threadname\relax - \AM@split@options{pdfpages}{#1}% + \def\AM@tmp{pdfpages} + \expandafter\AM@split@options + \expandafter\AM@tmp + \expandafter{\the\AM@global@opts,#1} \edef\AM@temp{{pdfpages}{\the\@temptokena}}% \expandafter\setkeys\AM@temp % \end{macrocode} @@ -1379,7 +1400,7 @@ % \begin{macrocode} \ifAM@output \expandafter\AM@readlist\expandafter{\AM@pagestemp}% - \AM@output{#1}% + \expandafter\AM@output\expandafter{\the\AM@global@opts,#1}% \fi % \end{macrocode} % \begin{macrocode} @@ -1394,11 +1415,14 @@ \newcommand*{\includepdfmerge}[2][]{% \begingroup \let\AM@currentdocname\relax - \AM@split@options{pdfpages}{#1}% + \def\AM@tmp{pdfpages} + \expandafter\AM@split@options + \expandafter\AM@tmp + \expandafter{\the\AM@global@opts,#1}% \edef\AM@temp{{pdfpages}{\the\@temptokena}}% \expandafter\setkeys\AM@temp \AM@readlist{#2}% - \AM@output{#1}% + \expandafter\AM@output\expandafter{\the\AM@global@opts,#1}% \AM@CheckAtEnd \endgroup \AM@ClearShipoutPicture @@ -1571,9 +1595,10 @@ \setbox\@tempboxa=\hbox{% \rotatebox{\AM@lscape@rot}{\copy\AM@templatesizebox}}% \else + \edef\AM@opts{[\AM@disable@width@height,\the\@temptokena, + page=\AM@page, angle=\AM@lscape@rot]}% \setbox\@tempboxa=\hbox{% - \expandafter\includegraphics\expandafter[\the\@temptokena, - page=\AM@page, angle=\AM@lscape@rot]{\AM@docname}}% + \expandafter\includegraphics\AM@opts{\AM@docname}}% \fi \fi % \end{macrocode} @@ -1631,10 +1656,11 @@ \setbox\@tempboxa=\hbox{% \rotatebox{\AM@lscape@rot}{\copy\@tempboxa}}% \else + \edef\AM@opts{[\AM@disable@width@height,\the\@temptokena, + page=\AM@page, scale=\AM@globalscale, + angle=\AM@lscape@rot]}% \setbox\@tempboxa=\hbox{% - \expandafter\includegraphics\expandafter[\the\@temptokena, - page=\AM@page, scale=\AM@globalscale, - angle=\AM@lscape@rot]{\AM@docname}}% + \expandafter\includegraphics\AM@opts{\AM@docname}}% \fi \let\@filelist\AM@filelist@save \edef\AM@templatewidth{\the\wd\@tempboxa}% @@ -1728,10 +1754,11 @@ % page template. If not, adjust the scale |\AM@localscale| and % the local offset |\AM@localxoff| and |\AM@localyoff|. % \begin{macrocode} + \edef\AM@opts{[\AM@disable@width@height,\the\@temptokena, + page=\AM@page, scale=\AM@globalscale, + angle=\AM@lscape@rot]}% \setbox\@tempboxa=\hbox{% - \expandafter\includegraphics\expandafter[\the\@temptokena, - page=\AM@page, scale=\AM@globalscale, - angle=\AM@lscape@rot]{\AM@docname}}% + \expandafter\includegraphics\AM@opts{\AM@docname}}% \edef\AM@localwd{\the\wd\@tempboxa}% \setlength{\@tempdima}{\ht\@tempboxa + \dp\@tempboxa}% \edef\AM@localht{\the\@tempdima}% @@ -1762,11 +1789,11 @@ \ifAM@rotateoversize \def\AM@rotateoversize{90}% \let\AM@filelist@save\@filelist + \edef\AM@opts{[\AM@disable@width@height,\the\@temptokena, + page=\AM@page, scale=\AM@globalscale, + angle=\AM@lscape@rot, angle=90]}% \setbox\@tempboxa=\hbox{% - \expandafter\includegraphics\expandafter - [\the\@temptokena, page=\AM@page, - scale=\AM@globalscale, - angle=\AM@lscape@rot, angle=90]{\AM@docname}}% + \expandafter\includegraphics\AM@opts{\AM@docname}}% \let\@filelist\AM@filelist@save \edef\AM@localwd{\the\wd\@tempboxa}% \setlength{\@tempdima}{\ht\@tempboxa + \dp\@tempboxa}% @@ -1808,10 +1835,11 @@ % \begin{macrocode} \let\AM@filelist@save\@filelist \AM@split@options{Gin}{#1}% + \edef\AM@opts{[\AM@disable@width@height,\the\@temptokena, + page=\AM@page, scale=\AM@globalscale, + angle=\AM@lscape@rot]}% \setbox\@tempboxa=\hbox{% - \expandafter\includegraphics\expandafter[\the\@temptokena, - page=\AM@page, scale=\AM@globalscale, - angle=\AM@lscape@rot]{\AM@docname}}% + \expandafter\includegraphics\AM@opts{\AM@docname}}% \let\@filelist\AM@filelist@save \setlength{\@tempdimc}{\ht\@tempboxa + \dp\@tempboxa}% % \end{macrocode} @@ -1880,6 +1908,13 @@ \def\AM@shippage{}% \else \AM@split@options{Gin}{#1}% + \edef\AM@opts{[\AM@disable@width@height,\the\@temptokena, + page=\AM@page, scale=\AM@globalscale, + scale=\AM@localscale, + \ifAM@sigrotate angle=180,\fi + \ifAM@doublepagestwist\ifAM@doublepagestmp + angle=180,\fi\fi + angle=\AM@rotateoversize, angle=\AM@lscape@rot]}% \edef\AM@shippage{% \noexpand\put(\AM@xpos,\AM@ypos){% \noexpand\raisebox{\dp\@tempboxa}{% @@ -1892,14 +1927,8 @@ \AM@hyper@begin@ii\noexpand\AM@fbox{% \noexpand\AM@ARBug@hook \noexpand\AM@reflectbox{% - \noexpand\includegraphics[\the\@temptokena, - page=\AM@page, scale=\AM@globalscale, - scale=\AM@localscale, - \ifAM@sigrotate angle=180,\fi - \ifAM@doublepagestwist\ifAM@doublepagestmp - angle=180,\fi\fi - angle=\AM@rotateoversize, - angle=\AM@lscape@rot]{\AM@docname}}}% + \expandafter\noexpand\expandafter + \includegraphics\AM@opts{\AM@docname}}}% \AM@hyper@end}}% }% \fi @@ -4599,6 +4628,14 @@ % \item Respect eso-pic's option |texcoord|. % \end{itemize} % +% \subsection*{2016/04/19 v0.5f} +% \begin{itemize} +% \item Use |\includegraphics[width=!,height=!,...]{...}| to (kind of) +% disable |width| and |height| options. +% \item All (really all) options can be made global with +% |\includepdfset|. (It's no more restricted to options of pdfpages.) +% \end{itemize} +% % \Finale % % \iffalse -- cgit v1.2.3