diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/pdfpages')
-rw-r--r-- | Master/texmf-dist/source/latex/pdfpages/pdfpages.dtx | 167 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/pdfpages/pdfpages.ins | 2 |
2 files changed, 104 insertions, 65 deletions
diff --git a/Master/texmf-dist/source/latex/pdfpages/pdfpages.dtx b/Master/texmf-dist/source/latex/pdfpages/pdfpages.dtx index d5758629917..4bf3cd54281 100644 --- a/Master/texmf-dist/source/latex/pdfpages/pdfpages.dtx +++ b/Master/texmf-dist/source/latex/pdfpages/pdfpages.dtx @@ -1,7 +1,7 @@ % % \iffalse % -%<*(package,pppdftexdef,ppluatexdef,ppvtexdef,ppxetexdef,ppdvipsdef,ppdvipdfmdef,ppnulldef)> +%<*(package,pppdftexdef,ppluatexdef,ppvtexdef,ppxetexdef,ppdvipsdef,ppdvipdfmxdef,ppnulldef)> %% Copyright (C) 2001-2015 Andreas MATTHIAS %% %% This work may be distributed and/or modified under the conditions @@ -15,7 +15,7 @@ %% The Current Maintainer of this work is %% Andreas Matthias <andreas.matthias@gmail.com>. % -%</(package,pppdftexdef,ppluatexdef,ppvtexdef,ppxetexdef,ppdvipsdef,ppdvipdfmdef,ppnulldef)> +%</(package,pppdftexdef,ppluatexdef,ppvtexdef,ppxetexdef,ppdvipsdef,ppdvipdfmxdef,ppnulldef)> %<*!installer> %% %% Please send error reports and suggestions for improvements to @@ -27,12 +27,12 @@ %<*dtx> \makeatletter %</dtx> -\def\AM@fileversion{v0.4y} +\def\AM@fileversion{v0.5a} \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: 2015-06-15 20:08:28 +0200 $ -\AM@Git@SHA@process$SHA-1: 0a165012872f360ed43fd18b01b5ea77f5f9d6b0 $ +\AM@Git@Date@process$Date: 2015-07-19 17:18:25 +0200 $ +\AM@Git@SHA@process$SHA-1: e79a333f7b4030269da1c5f48fa2c8d07b41b058 $ %</!(example1,example2,example3,installer)> % % @@ -46,7 +46,7 @@ %<ppvtexdef>\ProvidesFile{ppvtex.def} %<ppxetexdef>\ProvidesFile{ppxetex.def} %<ppdvipsdef>\ProvidesFile{ppdvips.def} -%<ppdvipdfmdef>\ProvidesFile{ppdvipdfm.def} +%<ppdvipdfmxdef>\ProvidesFile{ppdvipdfmx.def} %<ppnulldef>\ProvidesFile{ppnull.def} %<driver>\ProvidesFile{pdfpages.drv} %<*!(example1,example2,example3,installer)> @@ -72,11 +72,11 @@ % %<package> Insert pages of external PDF documents (AM)] %<pppdftexdef> Pdfpages driver for pdfTeX (AM)] -%<ppluatexdef> Pdfpages driver for luaTeX (AM)] +%<ppluatexdef> Pdfpages driver for LuaTeX (AM)] %<ppvtexdef> Pdfpages driver for VTeX (AM)] %<ppxetexdef> Pdfpages driver for XeTeX (AM)] %<ppdvipsdef> Pdfpages driver for dvips (AM)] -%<ppdvipdfmdef> Pdfpages driver for dvipdfm (AM)] +%<ppdvipdfmxdef> Pdfpages driver for dvipdfmx (AM)] %<ppnulldef> Pdfpages dummy driver (AM)] % % @@ -84,7 +84,7 @@ % % \GetFileInfo{pdfpages.dtx} % -% \CheckSum{4663} +% \CheckSum{4707} % % \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 @@ -128,18 +128,18 @@ % % \def\pdfTeX{pdfTeX} % \def\pdfLaTeX{pdfLaTeX} -% \def\luaTeX{luaTeX} +% \def\luaTeX{LuaTeX} % \def\VTeX{VTeX} % \def\XeTeX{XeTeX} % \def\dvips{dvips} -% \def\dvipdfm{dvipdfm} +% \def\dvipdfmx{dvipdfmx} % \def\PDF{{\small PDF}} % \def\PS{{\small PS}} % \def\DVI{{\small DVI}} % % \pdfstringdefDisableCommands{% % \def\pdfTeX{pdfTeX}% -% \def\luaTeX{luaTeX}% +% \def\luaTeX{LuaTeX}% % \def\VTeX{VTeX}% % \def\XeTeX{XeTeX}% % } @@ -216,6 +216,8 @@ % \item[|final|:] Inserts pages. This is the default. % \item[|draft|:] Does not insert pages, but prints a box % and the filename instead. +% \item[|demo|:] Inserts empty pages instead of the actual PDFs. +% \item[|nodemo|:] Disables `demo'. % \item[|enable-survey|:] Activates survey functionalities. % (\emph{experimental, subject to change}) % \end{description} @@ -1059,11 +1061,14 @@ % \subsection{Package Options} % \begin{macrocode} \newif\ifAM@pkg@draft \AM@pkg@draftfalse -\newif\ifAM@pkg@survey \AM@pkg@surveyfalse \DeclareOption{draft}{\AM@pkg@drafttrue} \DeclareOption{final}{\AM@pkg@draftfalse} +\newif\ifAM@pkg@survey \AM@pkg@surveyfalse \DeclareOption{enable-survey}{\AM@pkg@surveytrue} \DeclareOption{disable-survey}{\AM@pkg@surveyfalse} +\newif\ifAM@pkg@demo \AM@pkg@demofalse +\DeclareOption{demo}{\AM@pkg@demotrue} +\DeclareOption{nodemo}{\AM@pkg@demofalse} % \end{macrocode} % |\AM@ifdriverlater| checks that the driver loaded is more recent % than the given date. See |\@ifpackagelater| from the standard @@ -1084,7 +1089,7 @@ \DeclareOption{vtex}{\def\AM@driver{vtex}} \DeclareOption{xetex}{\def\AM@driver{xetex}} \DeclareOption{dvips}{\def\AM@driver{dvips}} -\DeclareOption{dvipdfm}{\def\AM@driver{dvipdfm}} +\DeclareOption{dvipdfmx}{\def\AM@driver{dvipdfmx}} \DeclareOption{null}{\def\AM@driver{null}} % \end{macrocode} % \begin{macrocode} @@ -1098,14 +1103,17 @@ % the driver was identified in the configuration files |pdfpages.cfg| % % \begin{macrocode} +\ifAM@pkg@demo + \def\AM@driver{null} +\fi \@ifundefined{AM@driver}{ \begingroup \@ifundefined{luatexversion}{% \@ifundefined{pdftexversion}{% \@ifundefined{XeTeXversion}{% \@ifundefined{OpMode}{% - \def\AM@driver{null} - }{\gdef\AM@driver{vtex}}% + \gdef\AM@driver{null} + }{\gedf\AM@driver{vtex}}% }{\gdef\AM@driver{xetex}}% }{\gdef\AM@driver{pdftex}}% }{\gdef\AM@driver{luatex}}% @@ -1116,7 +1124,11 @@ % % \begin{macrocode} \RequirePackage{ifthen, calc, eso-pic} -\RequirePackage{graphicx} +%\@ifundefined{kansuji}{% + \RequirePackage{graphicx}% +%}{% +% \RequirePackage[dvipdfmx]{graphicx}% +%} \newif\ifAM@DVIoutput\AM@DVIoutputfalse \newdimen\AM@pagewidth \newdimen\AM@pageheight @@ -1129,6 +1141,12 @@ \fi \RequirePackage{pdflscape} % \end{macrocode} +% Let's save the original meaning of |\includegraphics|, because +% graphicx.sty in demo mode (`demo' option) will overwrite |\includegraphics| +% \emph{after} |\begin{document}|. +% \begin{macrocode} +\let\AM@Ginclude@graphics\Ginclude@graphics +% \end{macrocode} % Checking for new versions of \texttt{eso-pic.sty}. % \begin{macrocode} \@ifpackagelater{eso-pic}{2001/07/20} @@ -1210,6 +1228,10 @@ % Find file and set |\AM@currentdocname|. % \begin{macrocode} \newcommand*{\AM@findfile@i}[2]{% + \ifAM@pkg@demo + \else + \let\Ginclude@graphics\AM@Ginclude@graphics + \fi \let\AM@currentdocname\relax \AM@IfFileExists{#1.#2}{\edef\AM@currentdocname{#1.#2}}{% \AM@IfFileExists{#1}{\edef\AM@currentdocname{#1}}{% @@ -3852,46 +3874,51 @@ % \iffalse %</ppdvipsdef> % -%<*ppdvipdfmdef> +%<*ppdvipdfmxdef> % \fi % -% \subsubsection{Dvipdfm driver} +% \subsubsection{Dvipdfmx driver} % -% Package |graphicx| should be loaded with the |dvipdfm| driver. -% However, \break |\RequirePackage[dvipdfm]{graphicx}| is not recommended +% Package |graphicx| should be loaded with the |dvipdfmx| driver. +% However, \break |\RequirePackage[dvipdfmx]{graphicx}| is not recommended % because it will cause an `option clash' if a user loaded |graphicx| % with additional options before. Thus, we expect the user to load -% |graphicx| with |dvipdfm| driver before loading pdfpages. +% |graphicx| with |dvipdfmx| driver before loading pdfpages. % \begin{macrocode} -\def\AM@tmp{dvipdfm.def} +\def\AM@tmp{dvipdfmx.def} \ifx\Gin@driver\AM@tmp\else \PackageWarningNoLine{pdfpages}{% - Graphicx not loaded with driver `dvipdfm'.\MessageBreak - Please, load graphicx explicitely before pdfpages,\MessageBreak + Graphicx.sty not loaded with driver `dvipdfmx'.\MessageBreak + Please, specify the driver as a class option\MessageBreak + \@spaces \string\documentclass[dvipdfmx]{...}\MessageBreak + or load graphicx explicitely before pdfpages,\MessageBreak e.g.:\MessageBreak - \@spaces \string\usepackage[dvipdfm]{graphicx}\MessageBreak - \@spaces \string\usepackage[dvipdfm]{pdfpages}\MessageBreak - This time I will try to load `dvipdfm.def' which \MessageBreak - will overwrite `Gin@driver'. Let's hope for the best}% - \input{dvipdfm.def}% + \@spaces \string\usepackage[dvipdfmx]{graphicx}\MessageBreak + \@spaces \string\usepackage[dvipdfmx]{pdfpages}\MessageBreak + This time I will try to load `dvipdfmx.def' which \MessageBreak + will overwrite `\string\Gin@driver'.\MessageBreak + Let's hope for the best}% + \input{dvipdfmx.def}% \fi % \end{macrocode} -% \begin{macrocode} -\def\AM@notsupported#1{% - \PackageWarning{pdfpages}{#1 not supported by driver dvipdfm}} -% \end{macrocode} % Get last page number. +% Unfortunately this driver cannot detect the total number of pages of a PDF. +% If `lastpage' is not given we will assume the PDF has got just one page. % \begin{macrocode} +\PackageInfo{pdfpages}{% + Driver `dvipdfmx' cannot detect the total number\MessageBreak + of pages of a PDF. Use option `lastpage' to give\MessageBreak + me a hint} \def\AM@getpagecount{% \ifx\AM@pagecount\AM@undefined - \AM@notsupported{Page selection} - \def\AM@pagecount{1}% - \gdef\AM@getpagecount{% - \def\AM@pagecount{1}% - }% + \def\AM@pagecount{1}% \fi } % \end{macrocode} +% Don't check page numbers. +% \begin{macrocode} +\newcommand*{\AM@checkpagenumber}[1]{} +% \end{macrocode} % Page dimensions. % \begin{macrocode} \def\AM@getpagedimen{% @@ -3899,19 +3926,25 @@ \AM@pageheight=\paperheight } \def\AM@setpagedimen{% - \paperwidth\AM@pagewidth - \paperheight\AM@pageheight + \special{pdf:pagesize width \the\AM@pagewidth\space height \the\AM@pageheight\space} +} +\def\AM@pagesize@boogie{% + \ifdim\AM@pagewidth=\z@ + \ifdim\AM@pageheight=\z@ + \let\AM@pagewidth\paperwidth + \let\AM@pageheight\paperheight + \fi + \fi } -\let\AM@pagesize@boogie\relax % \end{macrocode} % Rotate page. % \begin{macrocode} -\def\AM@setRotate{\AM@notsupported{Page rotation}} +\def\AM@setRotate{\special{pdf: put @thispage <</Rotate 90>>}}% \def\AM@resetRotate{} % \end{macrocode} % Change paper size. % \begin{macrocode} -\def\AM@fitpaper@special{\AM@notsupported{Option fitpaper}} +\let\AM@fitpaper@special\relax % \end{macrocode} % Find file. % \begin{macrocode} @@ -4003,7 +4036,7 @@ \ifx\x\tag \gdef\AM@view{/XYZ @xpos @ypos null}% \PackageWarningNoLine{pdfpages}{% - `linkfit=Region' is not supported by dvipdfm.}% + `linkfit=Region' is not supported by dvipdfmx.}% \else \gdef\AM@view{/Fit}% \fi @@ -4022,21 +4055,9 @@ % \begin{macrocode} \let\AM@disable@includegraphics\relax % \end{macrocode} -% Add option page for |\includegraphics|. -% \begin{macrocode} -\@ifundefined{KV@Gin@page}{% - \define@key{Gin}{page}{% - \ifnum#1=1 % - \else - \PackageError{pdfpages}{% - Multipage images are not supported by driver dvipdfm% - }\@ehc - \fi - }}{} -% \end{macrocode} % % \iffalse -%</ppdvipdfmdef> +%</ppdvipdfmxdef> % %<*ppnulldef> % \fi @@ -4047,9 +4068,12 @@ % \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} + I will use a dummy \string\includepdf\space command which\MessageBreak + will insert empty pages instead of the actual PDF,\MessageBreak + because we are running in + \ifAM@pkg@demo `demo' mode% + \else DVI mode or with\MessageBreak dvips driver% + \fi} % \end{macrocode} % Find file: the file must not exist for this dummy driver. Let's just % set \cmd{\AM@currentdocname}. @@ -4065,8 +4089,12 @@ \ifx\AM@pagecount\AM@undefined \PackageWarningNoLine{pdfpages}{% I cannot determine the number of pages of the\MessageBreak - included document, while being in DVI mode. You\MessageBreak - can use the option `lastpage' to give me a hint}% + included document, because we are running in\MessageBreak + \ifAM@pkg@demo `demo' mode. + \else DVI mode. + \fi + \MessageBreak + You can use the option `lastpage' to give me a hint}% \edef\AM@pagecount{1}% \fi } @@ -4347,6 +4375,17 @@ % \item Issue with uppercase filename extentions in ppxetex.def fixed. % \item Issue with suspending of floats, and bang floats, during output fixed. % \end{itemize} +% +% \subsection*{2015/07/06 v0.4z} +% \begin{itemize} +% \item Package option `demo' added. +% \end{itemize} +% +% \subsection*{2015/07/18 v0.5a} +% \begin{itemize} +% \item Driver dvipdfm removed. +% \item Driver dvipdfmx added. +% \end{itemize} % \Finale % % \iffalse @@ -4717,7 +4756,7 @@ This file demonstrates how to use the pdfpages package. \generate{\usepreamble\package \file{ppdvips.def}{\from{pdfpages.dtx}{ppdvipsdef}}} \generate{\usepreamble\package - \file{ppdvipdfm.def}{\from{pdfpages.dtx}{ppdvipdfmdef}}} + \file{ppdvipdfmx.def}{\from{pdfpages.dtx}{ppdvipdfmxdef}}} \generate{\usepreamble\package \file{ppnull.def}{\from{pdfpages.dtx}{ppnulldef}}} diff --git a/Master/texmf-dist/source/latex/pdfpages/pdfpages.ins b/Master/texmf-dist/source/latex/pdfpages/pdfpages.ins index aff6ac2f9c3..c3bc04dd2d9 100644 --- a/Master/texmf-dist/source/latex/pdfpages/pdfpages.ins +++ b/Master/texmf-dist/source/latex/pdfpages/pdfpages.ins @@ -52,7 +52,7 @@ This file demonstrates how to use the pdfpages package. \generate{\usepreamble\package \file{ppdvips.def}{\from{pdfpages.dtx}{ppdvipsdef}}} \generate{\usepreamble\package - \file{ppdvipdfm.def}{\from{pdfpages.dtx}{ppdvipdfmdef}}} + \file{ppdvipdfmx.def}{\from{pdfpages.dtx}{ppdvipdfmxdef}}} \generate{\usepreamble\package \file{ppnull.def}{\from{pdfpages.dtx}{ppnulldef}}} |