diff options
author | Karl Berry <karl@freefriends.org> | 2006-08-14 23:00:18 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2006-08-14 23:00:18 +0000 |
commit | 29d07a8cd3db51f6eeecc9b1d2cc4d8fd9c7466b (patch) | |
tree | 44c84610dff78d9851054677fe2eb14bb7556aac /Master/texmf-dist/source/latex/pdfpages | |
parent | fcb73a12b6a02f56d67959c643719fc60f32af13 (diff) |
pdfpages 0.4a (14aug06)
git-svn-id: svn://tug.org/texlive/trunk@1958 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/pdfpages')
-rw-r--r-- | Master/texmf-dist/source/latex/pdfpages/pdfpages.dtx | 668 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/pdfpages/pdfpages.ins | 52 |
2 files changed, 545 insertions, 175 deletions
diff --git a/Master/texmf-dist/source/latex/pdfpages/pdfpages.dtx b/Master/texmf-dist/source/latex/pdfpages/pdfpages.dtx index cd7028f3eb2..a55be43f57f 100644 --- a/Master/texmf-dist/source/latex/pdfpages/pdfpages.dtx +++ b/Master/texmf-dist/source/latex/pdfpages/pdfpages.dtx @@ -1,75 +1,80 @@ % % \iffalse % -% pdfpages.dtx Copyright (C) 2001-2003 Andreas MATTHIAS -% -%<*package> -%% This program may be distributed and/or modified under the -%% conditions of the LaTeX Project Public License, either version 1.2 -%% of this license or (at your option) any later version. -%% The latest version of this license is in +%<*(package,pppdftexdef,ppvtexdef,ppnulldef)> +%% Copyright (C) 2001-2006 Andreas MATTHIAS +%% +%% 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.2 or later is part of all distributions of LaTeX -%% version 1999/12/01 or later. +%% 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 Andreas Matthias <amat@kabsi.at>. +%</(package,pppdftexdef,ppvtexdef,ppnulldef)> +%<*!installer> %% -%</package> %% Please send error reports and suggestions for improvements to %% Andreas MATTHIAS <amat@kabsi.at>. +%</!installer> %% % -%<*!package> -% =================================================================== -% @LaTeX-package-file{ -% author = {Andreas MATTHIAS}, -% version = "0.3e", -% date = "2004-01-31", -% filename = "pdfpages.sty", -% address = "", -% telephone = "", -% email = "amat@kabsi.at", -% codetable = "ISO/ASCII", -% keywords = "pdfLaTeX, PDF, include, insert, page", -% dependences = "ifthen, graphicx, eso-pic", -% supported = "yes", -% docstring = "Package for inserting pages of external -% PDF documents. (Requiring pdfLaTeX.)" -% } -% =================================================================== -%</!package> +%<*!(example1,example2,example3,installer)> +%<*dtx> +\makeatletter +%</dtx> +\def\AM@fileversion{v0.4a} +\def\AM@SVN@Date@i#1-#2-#3\END{\def\AM@filedate{#1/#2/#3}} +\def\AM@SVN@Date$Date: #1 #2${\AM@SVN@Date@i#1\END} +\AM@SVN@Date$Date: 2006-08-12 01:13:35 +0200 (Sat, 12 Aug 2006) $ +%</!(example1,example2,example3,installer)> +% % %<*dtx> - \ProvidesFile{pdfpages.dtx} +\ProvidesFile{pdfpages.dtx} %</dtx> %<package>\NeedsTeXFormat{LaTeX2e} %<package>\ProvidesPackage{pdfpages} %<pppdftexdef>\ProvidesFile{pppdftex.def} %<ppvtexdef>\ProvidesFile{ppvtex.def} +%<ppnulldef>\ProvidesFile{ppnull.def} %<driver>\ProvidesFile{pdfpages.drv} -%<*!example1&!example2&!example3> +%<*!(example1,example2,example3,installer)> % \fi % +% \makeatletter % \ProvidesFile{pdfpages.dtx} - [2004/01/31 v0.3e + [\AM@filedate\space\AM@fileversion\space % % \iffalse -%</!example1&!example2&!example3> +%</!(example1,example2,example3,installer)> %<*none> % \fi ] +% \makeatother % \iffalse %</none> +%<*!(example1,example2,example3,installer)> +%<*dtx> +\makeatother +%</dtx> +%</!(example1,example2,example3,installer)> % %<package> Insert pages of external PDF documents (AM)] %<pppdftexdef> Pdfpages driver for pdfTeX (AM)] %<ppvtexdef> Pdfpages driver for VTeX (AM)] +%<ppnulldef> Pdfpages' dummy driver (AM)] % -%<package>\def\AM@version{0.3e} % % \fi % % \GetFileInfo{pdfpages.dtx} % -% \CheckSum{3495} +% \CheckSum{3751} % % \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 @@ -92,6 +97,7 @@ %<*driver> \documentclass{ltxdoc} \usepackage{array} +\usepackage{hyperref} \OnlyDescription \begin{document} \DocInput{pdfpages.dtx} @@ -111,44 +117,54 @@ % \def\pdfLaTeX{pdf\kern.06em\LaTeX} % \def\VTeX{V\kern-.05em\TeX} % \def\PDF{{\small PDF}} +% \def\PS{{\small PS}} +% \def\DVI{{\small DVI}} +% +% \pdfstringdef{\pdfTeX}{pdfTeX} +% \pdfstringdef{\VTeX}{VTeX} % +% \makeatletter % \title{The \textsf{pdfpages} Package\thanks{This file -% has version number \fileversion, last revised \filedate.}} +% has version number \AM@fileversion, last revised \AM@filedate.}} % \author{Andreas MATTHIAS\\ \texttt{amat@kabsi.at}} -% -% -% \date{\filedate} +% \date{\AM@filedate} +% \makeatother % % \maketitle % % \begin{abstract} % \noindent -% This package makes it easy to insert pages of external -% PDF documents. It supports \pdfLaTeX\ and \VTeX\, but -% does \textit{not} work with \LaTeX. +% This package simplifies the insertion of external multi-page \PDF\ +% or \PS\ documents. It supports \pdfLaTeX\ and \VTeX. % \end{abstract} % +% \pdfbookmark[1]{\contentsname}{toc} % \tableofcontents % % % \section{Introduction} -% Creating \PDF\ documents, it is sometimes useful to insert -% pages of other, external \PDF\ documents. This can be done -% with the |\includegraphics| command from the -% \texttt{graphics} package. But a simple -% |\includegraphics{doc.pdf}| normally produces -% `|Overfull \hbox|' and `|Overfull \vbox|' warnings, -% because the size of the inserted pages does not match the -% print space. +% When creating \PDF\ documents, it is sometimes useful to insert pages +% of other, external \PDF\ documents. This can be done with the +% |\includegraphics| command from the \texttt{graphics} package. But a +% simple |\includegraphics{doc.pdf}| normally produces `|Overfull \hbox|' +% and `|Overfull \vbox|' warnings, because the size of the inserted pages +% does not match the print space. % -% The |pdfpages| package makes it easy to insert -% pages of external \PDF\ documents without worrying about -% the print space. Here are some features of the -% |pdfpages| package: Several logical pages can be arranged -% onto each sheet of paper and the layout can be changed -% individually. A lot of hypertext operations are supported, -% like links to the inserted pages, links to the original -% \PDF\ document, threads, etc. +% The |pdfpages| package makes it easy to insert pages of external \PDF\ +% documents without worrying about the print space. Here are some +% features of the |pdfpages| package: Several logical pages can be +% arranged onto each sheet of paper and the layout can be changed +% individually. A lot of hypertext operations are supported, like links +% to the inserted pages, links to the original \PDF\ document, threads, +% etc. When working with \VTeX\ the same is possible with PostScript +% documents, too. Note that PostScript documents are only supported by +% \VTeX\ and \emph{not} by \pdfLaTeX. +% +% When producing \DVI\ output |pdfpages| cannot insert pages of a \PDF\ +% documents. But instead of interrupting execution |pdfpages| will insert +% empty pages. This feature is important when using packages like +% |pst-pdf|, which need to produce \DVI\ output at the first run. +% % % \section{Usage} % \subsection{Package Options} @@ -229,7 +245,7 @@ % \par % E.g.: |pages=-| will insert \emph{all} pages % of the document, and |pages=last-1| will insert -% all pages in revers order. +% all pages in reverse order. % \par\df{pages=1} % \item[nup] Puts multiple logical pages onto each sheet % of paper. The syntax of this option is: @@ -337,12 +353,14 @@ % pages into signatures and setting % |nup=1x2| or |nup=2x1|, respectively. This option % takes one argument specifying the size of the -% signature, which should be a multiply of 4.\par +% signature, which should be a multiple of 4.\par % An example for documents in portrait orientation:\par % |\includepdf[pages=-, signature=8,|\\ % \hspace*{6em} |landscape]{portrait-doc.pdf}|\par % An example for documents in landscape orientation:\par % |\includepdf[pages=-, signature=8]{landscape-doc.pdf}| +% \item[signature*] Similar to |signature|, but now for right-edge +% binding. % \item[picturecommand] Declares picture commands which are executed % on every page within a picture environment with the % base point at the lower left corner of the page. @@ -395,6 +413,15 @@ % equivalent to `true'). \df{doublepagestwistodd*=false} % \end{description} % +% \item Miscellaneous options: +% \makeatletter\@beginparpenalty=10000\makeatother +% \begin{description} +% \item[lastpage] In \DVI\ mode pdfpages cannot determine the number of +% pages of the included document. So this option is suitable to +% specify the number of pages. This option is only used in \DVI\ mode +% and has no meaning in any other mode. The argument should be a page +% number. \df{lastpage=1} +% \end{description} % % \item Hypertext options: % @@ -640,7 +667,81 @@ % % % \begin{figure} -% \centering\input{pic.tex} +% \centering +% \setlength{\unitlength}{.7mm} +% \def\thick{.7pt} +% \def\thin{.2pt} +% ^^A\fbox{ +% \begin{picture}(145,238) +% \small +% \put(0,33){ +% \linethickness{\thick} +% \put(0,0){\framebox(145,205){}} +% \linethickness{\thin} +% \put(10,15){\dashbox(35,49){}} +% \put(55,15){\dashbox(35,49){}} +% \put(100,15){\dashbox(35,49){}} +% \put(10,78){\dashbox(35,49){}} +% \put(55,78){\dashbox(35,49){}} +% \put(100,78){\dashbox(35,49){}} +% \put(10,141){\dashbox(35,49){}} +% \put(55,141){\dashbox(35,49){}} +% \put(100,141){\dashbox(35,49){}} +% \put(5,7){ +% \put(10,15){\framebox(35,49){}} +% \put(55,15){\framebox(35,49){}} +% \put(100,15){\framebox(35,49){}} +% \put(10,78){\framebox(35,49){}} +% \put(55,78){\framebox(35,49){}} +% \put(100,78){\framebox(35,49){}} +% \put(10,141){\framebox(35,49){}} +% \put(55,141){\framebox(35,49){}} +% \put(100,141){\framebox(35,49){}} +% \put(45,36){\vector(1,0){10}} +% \put(55,36){\vector(-1,0){10}} +% \put(44.5,38){\textit{delx}} +% \put(90,36){\vector(1,0){10}} +% \put(100,36){\vector(-1,0){10}} +% \put(89.5,38){\textit{delx}} +% \put(27,64){\vector(0,1){14}} +% \put(27,78){\vector(0,-1){14}} +% \put(15,70){\textit{dely}} +% \put(27,127){\vector(0,1){14}} +% \put(27,141){\vector(0,-1){14}} +% \put(15,133){\textit{dely}} +% } +% \put(10,15){\vector(1,0){5}} +% \put(15,15){\vector(0,1){7}} +% \put(8,8){\textit{offx}} +% \put(17,17){\textit{offy}} +% } +% +% ^^A legend +% +% \setlength{\fboxsep}{4pt} +% \put(72.5,10){ +% \makebox(0,0){ +% \fbox{ +% \begin{tabular}{l@{\hskip20pt}l} +% \linethickness{\thick}^^A +% \raisebox{.8ex}{\line(1,0){5}} physical sheet of paper +% & +% |delta=|\meta{delx} \meta{dely} +% \\ +% \linethickness{\thin}^^A +% \raisebox{.8ex}{\line(1,0){5}} logical pages +% & +% |offset=|\meta{offx} \meta{offy} +% \\ +% \raisebox{.8ex}{\line(1,0){1}\hskip.55mm\line(1,0){1} +% \hskip.55mm\line(1,0){1}} centered position +% & +% \\ +% \end{tabular} +% }} +% } +% \end{picture} +% ^^A}% fbox % \caption{Layout} % \label{fig:layout} % \end{figure} @@ -867,10 +968,10 @@ % H\`an Th\^e\llap{\raise 0.5ex\hbox{\'{}}} Th\`anh, % Sebastian Rahtz, Hans Hagen, % \textit{The \pdfTeX\ user manual}, -% http://www.tug.org/applications/pdftex/pdftex-s.pdf +% \url{http://www.tug.org/applications/pdftex} % \bibitem{PDFRef} \textit{PDF Reference}, Third Edition, Version 1.4, % Adobe Systems Incorporated,\\ -% http://partners.adobe.com/asn/tech/pdf/specifications.jsp +% \url{http://partners.adobe.com/asn/tech/pdf/specifications.jsp} % \end{thebibliography} % } % @@ -906,26 +1007,20 @@ % \texttt{pdfoutput} (\verb|\let\pdfoutput\@undefined|), % if the document contains the line \verb|\pdfoutput=0|. % \begin{macrocode} -\def\AM@driver{pdftex} \begingroup \@ifundefined{pdfoutput}{% \@ifundefined{OpMode}{% - \PackageError{pdfpages} - {You are using neither pdfTeX nor VTeX.\MessageBreak - Package pdfpages does not work with other\MessageBreak - TeX implementations} - {Please, change to pdfTeX or VTeX to use this - package!}% - \aftergroup\endinput + \def\AM@driver{null} }{\gdef\AM@driver{vtex}}% -}{} +}{\gdef\AM@driver{pdftex}} \endgroup % \end{macrocode} % Required Packages. % \begin{macrocode} \RequirePackage{ifthen, graphicx, calc, eso-pic} +\newif\ifAM@DVIoutput\AM@DVIoutputfalse \input{pp\AM@driver.def} -\ifx\AM@endinput\relax\endinput\fi +\ifx\AM@endinput\relax\expandafter\endinput\fi \ifAM@pkg@survey \let\AM@setanchor\AM@anchor@special \RequirePackage{count1to}% @@ -939,6 +1034,7 @@ \def\AM@ClearShipoutPicture{\relax}} {\def\AM@AddToShipoutPicture{\AddToShipoutPicture}% \def\AM@ClearShipoutPicture{\ClearShipoutPicture}} + \let\Orig@AM@AddToShipoutPicture\AM@AddToShipoutPicture % \end{macrocode} % \subsection{Booleans} % \begin{macrocode} @@ -963,6 +1059,8 @@ \newif\ifAM@doublepagestmpi\AM@doublepagestmpifalse \newif\ifAM@linkfilename\AM@linkfilenamefalse \newif\ifAM@signature\AM@signaturefalse +\newif\ifAM@signaturestar\AM@signaturestarfalse +\newif\ifAM@booklet\AM@bookletfalse \newif\ifAM@sigrotate\AM@sigrotatefalse \newif\ifAM@newwindow\AM@newwindowtrue \newif\ifAM@rescale\AM@rescalefalse @@ -986,10 +1084,7 @@ \newcommand*{\AM@ARBug@hook}{} \newcommand*{\AM@xrprefix}{} \newcommand*{\AM@picturecommand}{}\newcommand*{\AM@picturecommandstar}{} - - \newsavebox{\AM@pagebox} - % \end{macrocode} % \macro{\AM@setlscape} % |\AM@setlscape| is defined in the driver files but may be @@ -1047,7 +1142,7 @@ \ifx\AM@currentdocname\relax \edef\AM@currentdocname{\AM@dir#1}% \fi - }% + }{}% }% }% \@tfor \fi @@ -1152,18 +1247,18 @@ % Some simple checks. % \begin{macrocode} \newcommand{\AM@CheckAtEnd}{% - \ifx\@empty\AM@toclist\else - \PackageWarning{pdfpages}{% - There's something wrong with the entries\MessageBreak - of `addtotoc'. Not all entries were\MessageBreak - processed. Check `addtotoc'}% - \fi - \ifx\@empty\AM@loflist\else - \PackageWarning{pdfpages}{% - There's something wrong with the entries\MessageBreak - of `addtolist'. Not all entries were\MessageBreak - processed. Check `addtolist'}% - \fi + \ifx\@empty\AM@toclist\else + \PackageWarning{pdfpages}{% + There's something wrong with the entries\MessageBreak + of `addtotoc'. Not all entries were\MessageBreak + processed. Check `addtotoc'}% + \fi + \ifx\@empty\AM@loflist\else + \PackageWarning{pdfpages}{% + There's something wrong with the entries\MessageBreak + of `addtolist'. Not all entries were\MessageBreak + processed. Check `addtolist'}% + \fi } % \end{macrocode} % \macro{\AM@output} @@ -1177,6 +1272,11 @@ \c@totalnumber=0 \if@twocolumn\let\AM@twocolumn\relax \onecolumn \fi % \end{macrocode} +% Some drivers, like |ppnull|, need a hook to disable +% |\includegraphics|. +% \begin{macrocode} + \AM@disable@includegraphics +% \end{macrocode} % Some macros may already be initialized by |\includepdfset|. % So do not reset them here. % \begin{macrocode} @@ -1195,11 +1295,6 @@ \else \setkeys{Gin}{draft=false}% \fi % \end{macrocode} -% Some preparations before starting the output. -% \begin{macrocode} - \ifthenelse{\boolean{AM@pkg@draft} \and \boolean{AM@survey}} - {}{\AM@getpagecount} -% \end{macrocode} % \begin{macrocode} \ifthenelse{\boolean{AM@landscape}} {\def\AM@lscape@rot{90}% @@ -1245,7 +1340,7 @@ \ifthenelse{\boolean{AM@reflect}} {\let\AM@reflectbox\reflectbox} {\let\AM@reflectbox\relax}% -\setbox\AM@pagebox\null + \setbox\AM@pagebox\null % \end{macrocode} % \begin{macrocode} \ifthenelse{\boolean{AM@column}} @@ -1281,9 +1376,13 @@ \else \AM@split@options{Gin@noscale}{#1}% \let\AM@filelist@save\@filelist - \setbox\@tempboxa=\hbox{% - \expandafter\includegraphics\expandafter[\the\@temptokena, - page=\AM@page, angle=\AM@lscape@rot]{\AM@docname}}% + \ifAM@DVIoutput + \setbox\@tempboxa=\hbox{\rule{597pt}{845pt}} + \else + \setbox\@tempboxa=\hbox{% + \expandafter\includegraphics\expandafter[\the\@temptokena, + page=\AM@page, angle=\AM@lscape@rot]{\AM@docname}}% + \fi % \end{macrocode} % Adjust the paper size. % \begin{macrocode} @@ -1575,8 +1674,7 @@ \def\AM@region{region}% \ifx\AM@linkfit\AM@region \setlength{\@tempdima}{\the\ht\@tempboxa + \the\dp\@tempboxa}% - \edef\AM@linkfit{fitr width\the\wd\@tempboxa\space - height0pt depth\the\@tempdima}% + \let\AM@linkfit\AM@linkfit@special \fi % \end{macrocode} % Ship out page. @@ -1588,9 +1686,9 @@ \edef\AM@shippage{% \noexpand\put(\AM@xpos,\AM@ypos){% \noexpand\raisebox{\dp\@tempboxa}{% -% /end{macrocode} +% \end{macrocode} % Raise the target of a link to the top of the included page. -% /begin{macrocode} +% \begin{macrocode} \noexpand\raise \ht\@tempboxa \hbox{\AM@hyper@begin@i}% % \end{macrocode} % \begin{macrocode} @@ -1618,7 +1716,7 @@ \AM@AddToShipoutPicture{\setlength{\unitlength}{\p@}% \global\let\AM@filelist@save\@filelist}% % \end{macrocode} -% |\AM@pagebox| is only use for option |reflect|, which was added +% |\AM@pagebox| is only used for option |reflect|, which was added % lately. Probabley it would be better to use |\AM@pagebox| in % all cases? % \begin{macrocode} @@ -1759,6 +1857,11 @@ \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}% @@ -1787,7 +1890,7 @@ } % \end{macrocode} % \begin{macrocode} -\newcommand*{\AM@checkpagenumber}[1]{% +\providecommand*{\AM@checkpagenumber}[1]{% \ifnum#1>\AM@pagecount\relax \ifthenelse{\boolean{AM@pkg@draft} \and \boolean{AM@survey}}{% }{% @@ -1875,6 +1978,7 @@ % \end{macrocode} % \begin{macrocode} \def\AM@ReturnAfterFi#1\fi{\fi#1} +\def\AM@ReturnAfterFiFi#1\fi\fi{\fi\fi#1} % \end{macrocode} % \begin{macrocode} \newcommand{\AM@getlasti}{} @@ -1905,6 +2009,38 @@ \edef\AM@lastnitems{\AM@templist}% } % \end{macrocode} +% \macro{\AM@split@firstn} +% Removes the first |n=#2| items from the cvs=list, which +% is specified by the name of a macro in |#1|. These |n| +% items are split into two lists with the names |#1@firstn| +% and |#1@lastn|. The latter one is sorted backwards. This +% is needed for a faster processing of the |signature| option. +% \begin{macrocode} +\newcommand{\AM@split@firstn}{} +\def\AM@split@firstn#1#2{% + \edef\AM@tmp{\expandafter\@gobble\string#1@firstn}% + \AM@getfirst{#1}% + \expandafter\edef\csname\AM@tmp\endcsname{\the\toks@}% + \@tempcnta=\@ne + \@tempcntb=#2 \divide\@tempcntb\tw@ + \loop\ifnum\@tempcnta<\@tempcntb + \AM@getfirst{#1}% + \expandafter\edef\csname\AM@tmp\endcsname + {\@nameuse{\AM@tmp},\the\toks@}% + \advance\@tempcnta\@ne + \repeat + \edef\AM@tmp{\expandafter\@gobble\string#1@lastn}% + \AM@getfirst{#1}% + \expandafter\edef\csname\AM@tmp\endcsname{\the\toks@}% + \@tempcnta=\@ne + \loop\ifnum\@tempcnta<\@tempcntb + \AM@getfirst{#1}% + \expandafter\edef\csname\AM@tmp\endcsname + {\the\toks@,\@nameuse{\AM@tmp}}% + \advance\@tempcnta\@ne + \repeat +} +% \end{macrocode} % \macro{\AM@count} % \macro{\AM@counti} % Parameter |#1| must be a macro containing a csv-list. @@ -2180,13 +2316,16 @@ \equal{doublepagestwist*}{\AM@temp}\or \equal{doublepagestwistodd*}{\AM@temp}\or \equal{signature}{\AM@temp}\or + \equal{signature*}{\AM@temp}\or + \equal{booklet}{\AM@temp}\or \equal{pagetemplate}{\AM@temp}\or \equal{rotateoversize}{\AM@temp}\or \equal{picturecommand}{\AM@temp}\or \equal{picturecommand*}{\AM@temp}\or \equal{newwindow}{\AM@temp}\or \equal{reflect}{\AM@temp}\or - \equal{reflect*}{\AM@temp}} + \equal{reflect*}{\AM@temp}\or + \equal{lastpage}{\AM@temp}} {\AM@pdfpages@optionstrue}{}% \ifthenelse{\equal{scale}{\AM@temp}}{\AM@scaletrue}{}% } @@ -2194,8 +2333,7 @@ % \macro{\AM@trim@space} % \macro{\AM@trim@spacei} % \macro{\AM@trim@spaceii} -% Removes leading and trailing spaces and save the result -% in |\AM@trimmed|. +% Removes leading and trailing spaces. % \begin{macrocode} \newcommand{\AM@trim@space}{}\newcommand{\AM@trim@spacei}{} \newcommand{\AM@trim@spaceii}{} @@ -2334,6 +2472,18 @@ \def\AM@newpagelist{}% \def\AM@newdoclist{}% % \end{macrocode} +% Calculate value of |\AM@signature| for option |booklet|. +% \begin{macrocode} +\ifAM@booklet + \AM@countpagelist + \@tempcntb=\@tempcnta + \divide\@tempcnta by 4 + \multiply\@tempcnta by 4 + \advance\@tempcntb-\@tempcnta + \ifnum\@tempcntb=0\else \advance\@tempcnta by 4\fi + \edef\AM@signature{\the\@tempcnta}% +\fi +% \end{macrocode} % Make |\AM@signature| a multiply of 4. % \begin{macrocode} \@tempcnta=\AM@signature\relax @@ -2365,34 +2515,36 @@ \def\AM@sort{% \def\AM@sigpagelist{}% \def\AM@sigdoclist{}% - \@tempcntb=\AM@signature\relax - \AM@getlastn{\AM@pagelist}{\@tempcntb}% - \edef\AM@lastnpages{\AM@lastnitems}% - \AM@getlastn{\AM@doclist}{\@tempcntb}% - \edef\AM@lastndocs{\AM@lastnitems}% - \@tempcnta=0 + \AM@split@firstn{\AM@pagelist}{\AM@signature}% + \AM@split@firstn{\AM@doclist}{\AM@signature}% \def\AM@first{% - \AM@getfirst{\AM@lastnpages}% + \AM@getfirst{\AM@pagelist@firstn}% \edef\AM@sigpagelist{\AM@sigpagelist,\the\toks@}% - \AM@getfirst{\AM@lastndocs}% + \AM@getfirst{\AM@doclist@firstn}% \edef\AM@sigdoclist{\AM@sigdoclist,\the\toks@}% }% \def\AM@last{% - \AM@getlast{\AM@lastnpages}% - \edef\AM@sigpagelist{\AM@sigpagelist,\AM@lastitem}% - \AM@getlast{\AM@lastndocs}% - \edef\AM@sigdoclist{\AM@sigdoclist,\AM@lastitem}% + \AM@getfirst{\AM@pagelist@lastn}% + \edef\AM@sigpagelist{\AM@sigpagelist,\the\toks@}% + \AM@getfirst{\AM@doclist@lastn}% + \edef\AM@sigdoclist{\AM@sigdoclist,\the\toks@}% }% - \whiledo{\@tempcnta<\@tempcntb}{% + \@tempcnta=\z@ + \@tempcntb=\AM@signature\relax + \whiledo{\@tempcnta<\@tempcntb}{% \ifAM@landscape - \AM@last\AM@first\AM@last\AM@first + \ifAM@signaturestar + \AM@first\AM@last\AM@first\AM@last + \else + \AM@last\AM@first\AM@last\AM@first + \fi \else \AM@first\AM@last\AM@first\AM@last \fi \advance\@tempcnta by 4 }% - \edef\AM@newpagelist{\AM@sigpagelist\AM@newpagelist}% - \edef\AM@newdoclist{\AM@sigdoclist\AM@newdoclist}% + \edef\AM@newpagelist{\AM@newpagelist\AM@sigpagelist}% + \edef\AM@newdoclist{\AM@newdoclist\AM@sigdoclist}% \ifx\AM@pagelist\@empty \else\expandafter\AM@sort \fi @@ -2540,7 +2692,7 @@ \def\@captype{\AM@lof@list}% \long\def\@makecaption##1##2{}% \let\@fs@capt\relax% float.sty - \caption{\AM@lof@heading}% + \expandafter\caption\expandafter{\AM@lof@heading}% \AM@addtolist@hook \@ifundefined{hyper@@anchor}{}{% \@ifundefined{float@caption}{% @@ -2563,7 +2715,7 @@ \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}}% - \def\AM@lof@heading{#3}% + \edef\AM@lof@heading{\AM@trim@leadingspace{#3}}% \def\AM@lof@label{\AM@trim@space{#4}}% \AM@checkinteger{\AM@lof@page}% \ifAM@integer\else @@ -2676,9 +2828,17 @@ } \AtBeginDocument{\AM@TeXpower@hook} % \end{macrocode} +% \begin{macrocode} +\def\AM@CheckValue#1#2{% + \ifx\\#2\\\PackageError{pdfpages} + {Option `#1' must have a non-empty value}% + \fi +} +% \end{macrocode} % \subsection{Options of \texttt{\protect\bslash includepdf}} % \begin{macrocode} -\define@key{pdfpages}{pages}{\def\AM@pagestemp{#1}} +\define@key{pdfpages}{pages}{\AM@CheckValue{pages}{#1}% + \def\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 \\} @@ -2735,7 +2895,12 @@ \AM@doublepagestmpfalse\AM@doublepagestmpitrue \AM@doublepagestwistxtrue} \define@key{pdfpages}{signature}{\def\AM@signature{#1}} -\define@key{pdfpages}{pagetemplate}{\def\AM@pagetemplate{#1}} +\define@key{pdfpages}{signature*}{\def\AM@signature{#1}% + \AM@signaturestartrue} +\define@key{pdfpages}{booklet}[true]{\setboolean{AM@booklet}{#1}% + \def\AM@signature{x}} +\define@key{pdfpages}{pagetemplate}{\AM@CheckValue{pagetemplate}{#1}% + \def\AM@pagetemplate{#1}} \define@key{pdfpages}{rotateoversize}[true]% {\setboolean{AM@rotateoversize}{#1}} \define@key{pdfpages}{picturecommand}{\def\AM@picturecommand{#1}} @@ -2743,6 +2908,7 @@ \define@key{pdfpages}{newwindow}[true]{\setboolean{AM@newwindow}{#1}} \define@key{pdfpages}{reflect*}[true]{\setboolean{AM@reflect}{#1}} \define@key{pdfpages}{reflect}[true]{\setboolean{AM@reflectall}{#1}} +\define@key{pdfpages}{lastpage}{\def\AM@pagecount{#1}} % \end{macrocode} % \macro{\AM@parse@nup} % Parsing \texttt{nup} item. @@ -2831,11 +2997,7 @@ \expandafter\endinput \fi \ifcase\pdfoutput - \PackageError{pdfpages} - {You produce DVI output but PDF output\MessageBreak - is needed for package pdfpages} - {Set output to PDF. (use: \pdfoutput = 1)} - \let\AM@endinput\relax + \input{ppnull.def} \expandafter\endinput \fi % \end{macrocode} @@ -2953,6 +3115,12 @@ % \begin{macrocode} \def\AM@dest@special{\pdfdest name {\AM@linkname.\AM@page} \AM@linkfit} \def\AM@anchor@special{\pdfdest name {pdfpages.\the\count1} fit} +\edef\AM@linkfit@special{fitr width\the\wd\@tempboxa\space + height0pt depth\the\@tempdima} +% \end{macrocode} +% Do not disable |\includegraphics|. +% \begin{macrocode} +\let\AM@disable@includegraphics\relax % \end{macrocode} % % \iffalse @@ -3052,10 +3220,107 @@ % \begin{macrocode} \def\AM@dest@special{\special{!aname \AM@linkname.\AM@page}} \def\AM@anchor@special{\special{!aname pdfpages.\the\count1}} +\edef\AM@linkfit@special{fit}%r width\the\wd\@tempboxa\space + % height0pt depth\the\@tempdima} +% \end{macrocode} +% Do not disable |\includegraphics|. +% \begin{macrocode} +\let\AM@disable@includegraphics\relax % \end{macrocode} % % \iffalse %</ppvtexdef> +% +%<*ppnulldef> +% \fi +% +% \subsubsection{Null driver} +% This is a dummy driver used when producing {\small DVI} output. +% +% \begin{macrocode} +\AM@DVIoutputtrue +\PackageWarningNoLine{pdfpages}{% + I will use a dummy \string\includepdf\space command\MessageBreak + which will NOT insert any pages, because\MessageBreak + you are producing DVI output} +% \iffalse +% \end{macrocode} +% Find file: the file must not exist for this dummy driver. Let's just +% set \cmd{\AM@currentdocname}. +% \begin{macrocode} +\def\AM@findfile#1{% + \def\AM@currentdocname{#1}% +} +% \end{macrocode} +% Get last page number. +% \begin{macrocode} +\def\AM@getpagecount{% + \ifx\AM@pagecount\AM@undefined + \PackageWarningNoLine{pdfpages}{% + I cannot determine the number of pages of the\MessageBreak + included document, while in DVI mode. You can\MessageBreak + use the option `lastpage' to give me a hint}% + \edef\AM@pagecount{1}% + \fi +} +% \end{macrocode} +% Page dimensions. +% \begin{macrocode} +\let\AM@pagewidth\paperwidth +\let\AM@pageheight\paperheight +\def\AM@setpagedimen{% + \setlength{\paperwidth}{\the\wd\@tempboxa}% + \setlength{\paperheight}{\the\ht\@tempboxa}% +} +% \end{macrocode} +% Change paper size. +% \begin{macrocode} +\let\AM@fitpaper@special\relax +% \end{macrocode} +% Find file. +% \begin{macrocode} +\def\AM@findfile#1{% + \def\AM@currentdocname{}% +} +% \end{macrocode} +% Rotate page. +% \begin{macrocode} +\let\AM@setlscape\relax +% \end{macrocode} +% Link to original document. +% \begin{macrocode} +\let\AM@linktodoc@special@begin\relax +\let\AM@linktodoc@special@end\relax +% \end{macrocode} +% Survey. +% \begin{macrocode} +\let\AM@survey@special@begin\relax +\let\AM@survey@special@end\relax +% \end{macrocode} +% Thread. +% \begin{macrocode} +\let\AM@thread@special@begin\relax +\let\AM@thread@special@end\relax +% \end{macrocode} +% Destination for links. +% \begin{macrocode} +\let\AM@dest@special\relax +\let\AM@anchor@special\relax +\let\AM@linkfit@special\relax +% \end{macrocode} +% Disable |\includegraphics|. +% \begin{macrocode} +\def\AM@disable@includegraphics{% + \renewcommand\includegraphics[2][]{}% +} +% \end{macrocode} +% Don't check page numbers. +% \begin{macrocode} +\newcommand*{\AM@checkpagenumber}[1]{} +% \end{macrocode} +% +% \iffalse +%</ppnulldef> % \fi % % @@ -3063,78 +3328,91 @@ % % \subsection*{2001/01/17 v0.1b} % \begin{itemize} -% \item The first released version. +% \item The first released version. % \end{itemize} % % \subsection*{2001/02/03 v0.1c} % \begin{itemize} -% \item Pages are being centered automatically. +% \item Pages are being centered automatically. % \end{itemize} % % \subsection*{2001/03/16 v0.1f} % \begin{itemize} -% \item Option |pages| added. +% \item Option |pages| added. % \end{itemize} % % \subsection*{2001/04/07 v0.1h} % \begin{itemize} -% \item Hypertext operations added. (Hyperlinks, threads) +% \item Hypertext operations added. (Hyperlinks, threads) % \end{itemize} % % \subsection*{2001/11/12 v0.2} % \begin{itemize} -% \item Support of |m|$\times$|n| logical pages on each -% sheet of paper. -% \item Options |column| and |columnstrict| added. -% \item New command |\inlcudepdfmerge|. +% \item Support of |m|$\times$|n| logical pages on each sheet of paper. +% \item Options |column| and |columnstrict| added. +% \item New command |\inlcudepdfmerge|. % \end{itemize} % % \subsection*{2001/12/26 v0.2c} % \begin{itemize} -% \item Option |fitpaper| added. +% \item Option |fitpaper| added. % \end{itemize} % % \subsection*{2001/03/31 v0.2g} % \begin{itemize} -% \item Option |signature| added. -% \item Options |addtotoc| and |addtolist| added. -% \item Option |doublepages| added. -% \item Options now have their own namespace |pdfpages| and -% do not extent the |Gin| (graphicx) namespace any longer. +% \item Option |signature| added. +% \item Options |addtotoc| and |addtolist| added. +% \item Option |doublepages| added. +% \item Options now have their own namespace |pdfpages| and do not extent +% the |Gin| (graphicx) namespace any longer. % \end{itemize} % % \subsection*{2002/12/14 v0.2l} % \begin{itemize} -% \item Survey functionality added. +% \item Survey functionality added. % \end{itemize} % % \subsection*{2003/06/02 v0.2m} % \begin{itemize} -% \item Support of \PDF s with mixed portrait/landscape pages. -% Options |pagetemplate| and |rotateoversize| added. -% \item Support of |\graphicspath|. -% \item Options |picturecommand| and |picturecommand*| added. -% \item Reverse page order: |pages=7-3|, |pages=last-5| +% \item Support of \PDF s with mixed portrait/landscape pages. Options +% |pagetemplate| and |rotateoversize| added. +% \item Support of |\graphicspath|. +% \item Options |picturecommand| and |picturecommand*| added. +% \item Reverse page order: |pages=7-3|, |pages=last-5| % \end{itemize} % % \subsection*{2003/06/21 v0.3a} % \begin{itemize} -% \item Support of \VTeX. -% \item Driver layer added. All driver specific macros are -% defined in |.def| driver files. +% \item Support of \VTeX. +% \item Driver layer added. All driver specific macros are defined in +% |.def| driver files. % \end{itemize} % % \subsection*{2003/07/16 v0.3b} % \begin{itemize} -% \item Option |\doublepagestwist| added. +% \item Option |\doublepagestwist| added. % \end{itemize} % % \subsection*{2003/12/08 v0.3e} % \begin{itemize} -% \item Option |reflect| added. -% \item Made |\AddToSurvey| work within TeXpower's |\stepwise|. +% \item Option |reflect| added. +% \item Made |\AddToSurvey| work within TeXpower's |\stepwise|. % \end{itemize} - +% +% \subsection*{2004/02/21 v0.3f} +% \begin{itemize} +% \item Option |signature*| (right-edge binding) added. +% \item Optimizations for a faster processing of signatures. +% \end{itemize} +% +% +% \subsection*{2006/08/05 v0.4a} +% \begin{itemize} +% \item Support of \DVI\ mode: Insertion of empty pages instead of +% interrupting execution. +% \item Option |lastpage| added. +% \end{itemize} +% % % \Finale % @@ -3474,5 +3752,77 @@ See Section \ref{sec:second} (\nameref{sec:second}) on page \end{document} %</example3> % +%<*installer> +\input docstrip +\askforoverwritefalse +\keepsilent + +\preamble +\endpreamble + +\declarepreamble\package + +This file is part of the pdfpages package. + +\endpreamble + +\declarepreamble\example + +This file demonstrates how to use the pdfpages package. +\endpreamble + +\generate{\usepreamble\package + \file{pdfpages.sty}{\from{pdfpages.dtx}{package}}} +\generate{\usepreamble\package + \file{pppdftex.def}{\from{pdfpages.dtx}{pppdftexdef}}} +\generate{\usepreamble\package + \file{ppvtex.def}{\from{pdfpages.dtx}{ppvtexdef}}} +\generate{\usepreamble\package + \file{ppnull.def}{\from{pdfpages.dtx}{ppnulldef}}} + +%% \generate{\usepreamble\package +%% \file{pdfpages.drv}{\from{pdfpages.dtx}{driver}}} + +\generate{\usepreamble\example + \file{pdf-ex.tex}{\from{pdfpages.dtx}{example1}}} +\generate{\usepreamble\example + \file{pdf-hyp.tex}{\from{pdfpages.dtx}{example2}}} +\generate{\usepreamble\example + \file{pdf-toc.tex}{\from{pdfpages.dtx}{example3}}} + + +\Msg{^^46^^75^^65^^72 ^^64^^69^^63^^68^^2c ^^41^^67^^6e^^65^^73^^21^^J} +\Msg{**************************************************************} +\Msg{*} +\Msg{* To finish the installation you have to move the following} +\Msg{* files into a directory searched by LaTeX:} +\Msg{*} +\Msg{* \space\space pdfpages.sty} +\Msg{* \space\space pppdftex.def} +\Msg{* \space\space ppvtex.def} +\Msg{* \space\space ppnull.def} +\Msg{*} +\Msg{* To produce the documentation, run the following} +\Msg{* file through LaTeX:} +\Msg{*} +\Msg{* \space\space pdfpages.dtx} +\Msg{*} +\Msg{* The following files are examples demonstrating how to use} +\Msg{* the pdfpages package.} +\Msg{*} +\Msg{* \space\space pdf-ex.tex} +\Msg{* \space\space pdf-hyp.tex} +\Msg{* \space\space pdf-toc.tex} +\Msg{*} +\Msg{* Happy TeXing!} +\Msg{*} +\Msg{**************************************************************} +\endbatchfile +%</installer> +% %\fi \endinput +%%% +%%% Local Variables: *** +%%% fill-column: 76 *** +%%% End: *** diff --git a/Master/texmf-dist/source/latex/pdfpages/pdfpages.ins b/Master/texmf-dist/source/latex/pdfpages/pdfpages.ins index 662e8e2735a..8928d1701eb 100644 --- a/Master/texmf-dist/source/latex/pdfpages/pdfpages.ins +++ b/Master/texmf-dist/source/latex/pdfpages/pdfpages.ins @@ -1,48 +1,64 @@ +%% +%% This is file `pdfpages.ins', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% pdfpages.dtx (with options: `installer') +%% +%% IMPORTANT NOTICE: +%% +%% For the copyright see the source file. +%% +%% Any modified versions of this file must be renamed +%% with new filenames distinct from pdfpages.ins. +%% +%% For distribution of the original source see the terms +%% for copying and modification in the file pdfpages.dtx. +%% +%% This generated file may be distributed as long as the +%% original source files, as listed above, are part of the +%% same distribution. (The sources need not necessarily be +%% in the same archive or directory.) +%% \input docstrip - \askforoverwritefalse \keepsilent -\declarepreamble\package +\preamble +\endpreamble -This is a package for PDFLaTeX, which makes it -easy to insert pages of external PDF documents. +\declarepreamble\package This file is part of the pdfpages package. -Copyright (C) 2001-2003 Andreas MATTHIAS. - \endpreamble \declarepreamble\example -This file is a demonstration of the pdfpages package. -Run it through pdfLaTeX. - +This file demonstrates how to use the pdfpages package. \endpreamble - \generate{\usepreamble\package \file{pdfpages.sty}{\from{pdfpages.dtx}{package}}} - \generate{\usepreamble\package \file{pppdftex.def}{\from{pdfpages.dtx}{pppdftexdef}}} - \generate{\usepreamble\package \file{ppvtex.def}{\from{pdfpages.dtx}{ppvtexdef}}} +\generate{\usepreamble\package + \file{ppnull.def}{\from{pdfpages.dtx}{ppnulldef}}} %% \generate{\usepreamble\package %% \file{pdfpages.drv}{\from{pdfpages.dtx}{driver}}} \generate{\usepreamble\example \file{pdf-ex.tex}{\from{pdfpages.dtx}{example1}}} - \generate{\usepreamble\example \file{pdf-hyp.tex}{\from{pdfpages.dtx}{example2}}} - \generate{\usepreamble\example \file{pdf-toc.tex}{\from{pdfpages.dtx}{example3}}} +\Msg{^^46^^75^^65^^72 ^^64^^69^^63^^68^^2c ^^41^^67^^6e^^65^^73^^21^^J} \Msg{**************************************************************} \Msg{*} \Msg{* To finish the installation you have to move the following} @@ -51,14 +67,15 @@ Run it through pdfLaTeX. \Msg{* \space\space pdfpages.sty} \Msg{* \space\space pppdftex.def} \Msg{* \space\space ppvtex.def} +\Msg{* \space\space ppnull.def} \Msg{*} \Msg{* To produce the documentation, run the following} \Msg{* file through LaTeX:} \Msg{*} \Msg{* \space\space pdfpages.dtx} \Msg{*} -\Msg{* To produce some examples, run the following files} -\Msg{* through pdfLaTeX:} +\Msg{* The following files are examples demonstrating how to use} +\Msg{* the pdfpages package.} \Msg{*} \Msg{* \space\space pdf-ex.tex} \Msg{* \space\space pdf-hyp.tex} @@ -68,3 +85,6 @@ Run it through pdfLaTeX. \Msg{*} \Msg{**************************************************************} \endbatchfile +\endinput +%% +%% End of file `pdfpages.ins'. |