diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/oberdiek/pagesel.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/oberdiek/pagesel.dtx | 535 |
1 files changed, 436 insertions, 99 deletions
diff --git a/Master/texmf-dist/source/latex/oberdiek/pagesel.dtx b/Master/texmf-dist/source/latex/oberdiek/pagesel.dtx index 2f9636d734c..93f0674b29f 100644 --- a/Master/texmf-dist/source/latex/oberdiek/pagesel.dtx +++ b/Master/texmf-dist/source/latex/oberdiek/pagesel.dtx @@ -1,67 +1,173 @@ % \iffalse meta-comment % -% pagesel.dtx -% -% This file is part of the package `pagesel' for use with LaTeX2e. -% -% Function: Selecting shipout output pages. -% -% Copyright (C) 1999, 2003 Heiko Oberdiek. -% -% 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 -% 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. -% -% Please send error reports and suggestions for improvements to -% Heiko Oberdiek <oberdiek@uni-freiburg.de>. -% -%<*dtx> - \ProvidesFile{pagesel.dtx} -%</dtx> -%<package>\NeedsTeXFormat{LaTeX2e} -%<package>\ProvidesPackage{pagesel} -%<driver>\ProvidesFile{pagesel.drv} -% \fi -% \ProvidesFile{pagesel.dtx} - [2003/06/05 v1.2 Selecting shipout output pages (HO)] -% -% \GetFileInfo{pagesel.dtx} -% -% \CheckSum{216} -% -%% \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 -%% Lower-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 -%% Digits \0\1\2\3\4\5\6\7\8\9 -%% Exclamation \! Double quote \" Hash (number) \# -%% Dollar \$ Percent \% Ampersand \& -%% Acute accent \' Left paren \( Right paren \) -%% Asterisk \* Plus \+ Comma \, -%% Minus \- Point \. Solidus \/ -%% Colon \: Semicolon \; Less than \< -%% Equals \= Greater than \> Question mark \? -%% Commercial at \@ Left bracket \[ Backslash \\ -%% Right bracket \] Circumflex \^ Underscore \_ -%% Grave accent \` Left brace \{ Vertical bar \| -%% Right brace \} Tilde \~} -%% -% \iffalse +% Copyright (C) 1999, 2003, 2006 by +% Heiko Oberdiek <oberdiek@uni-freiburg.de> +% +% This work may be distributed and/or modified under the +% conditions of the LaTeX Project Public License, either +% version 1.3 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.3 or later is part of all distributions of +% LaTeX version 2005/12/01 or later. +% +% This work has the LPPL maintenance status "maintained". +% +% This Current Maintainer of this work is Heiko Oberdiek. +% +% This work consists of the main source file pagesel.dtx +% and the derived files +% pagesel.sty, pagesel.pdf, pagesel.ins, pagesel.drv. +% +% Distribution: +% CTAN:macros/latex/contrib/oberdiek/pagesel.dtx +% CTAN:macros/latex/contrib/oberdiek/pagesel.pdf +% +% Unpacking: +% (a) If pagesel.ins is present: +% tex pagesel.ins +% (b) Without pagesel.ins: +% tex pagesel.dtx +% (c) If you insist on using LaTeX +% latex \let\install=y\input{pagesel.dtx} +% (quote the arguments according to the demands of your shell) +% +% Documentation: +% (a) If pagesel.drv is present: +% latex pagesel.drv +% (b) Without pagesel.drv: +% latex pagesel.dtx; ... +% The class ltxdoc loads the configuration file ltxdoc.cfg +% if available. Here you can specify further options, e.g. +% use A4 as paper format: +% \PassOptionsToClass{a4paper}{article} +% +% Programm calls to get the documentation (example): +% pdflatex pagesel.dtx +% makeindex -s gind.ist pagesel.idx +% pdflatex pagesel.dtx +% makeindex -s gind.ist pagesel.idx +% pdflatex pagesel.dtx +% +% Installation: +% TDS:tex/latex/oberdiek/pagesel.sty +% TDS:doc/latex/oberdiek/pagesel.pdf +% TDS:source/latex/oberdiek/pagesel.dtx +% +%<*ignore> +\begingroup + \def\x{LaTeX2e} +\expandafter\endgroup +\ifcase 0\ifx\install y1\fi\expandafter + \ifx\csname processbatchFile\endcsname\relax\else1\fi + \ifx\fmtname\x\else 1\fi\relax +\else\csname fi\endcsname +%</ignore> +%<*install> +\input docstrip.tex +\Msg{************************************************************************} +\Msg{* Installation} +\Msg{* Package: pagesel 2006/03/07 v1.5 Selecting shipout output pages (HO)} +\Msg{************************************************************************} + +\keepsilent +\askforoverwritefalse + +\preamble + +This is a generated file. + +Copyright (C) 1999, 2003, 2006 by + Heiko Oberdiek <oberdiek@uni-freiburg.de> + +This work may be distributed and/or modified under the +conditions of the LaTeX Project Public License, either +version 1.3 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.3 or later is part of all distributions of +LaTeX version 2005/12/01 or later. + +This work has the LPPL maintenance status "maintained". + +This Current Maintainer of this work is Heiko Oberdiek. + +This work consists of the main source file pagesel.dtx +and the derived files + pagesel.sty, pagesel.pdf, pagesel.ins, pagesel.drv. + +\endpreamble + +\generate{% + \file{pagesel.ins}{\from{pagesel.dtx}{install}}% + \file{pagesel.drv}{\from{pagesel.dtx}{driver}}% + \usedir{tex/latex/oberdiek}% + \file{pagesel.sty}{\from{pagesel.dtx}{package}}% +} + +\obeyspaces +\Msg{************************************************************************} +\Msg{*} +\Msg{* To finish the installation you have to move the following} +\Msg{* file into a directory searched by TeX:} +\Msg{*} +\Msg{* pagesel.sty} +\Msg{*} +\Msg{* To produce the documentation run the file `pagesel.drv'} +\Msg{* through LaTeX.} +\Msg{*} +\Msg{* Happy TeXing!} +\Msg{*} +\Msg{************************************************************************} + +\endbatchfile +%</install> +%<*ignore> +\fi +%</ignore> %<*driver> +\NeedsTeXFormat{LaTeX2e} +\ProvidesFile{pagesel.drv}% + [2006/03/07 v1.5 Selecting shipout output pages (HO)] \documentclass{ltxdoc} \usepackage{holtxdoc} \begin{document} - \DocInput{pagesel.dtx} + \DocInput{pagesel.dtx} \end{document} %</driver> % \fi % -% \DoNotIndex{\maxdimen,\\,\END} -% \DoNotIndex{\ifodd,\ifx,\ifnum} +% \CheckSum{393} +% +% \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 +% Lower-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 +% Digits \0\1\2\3\4\5\6\7\8\9 +% Exclamation \! Double quote \" Hash (number) \# +% Dollar \$ Percent \% Ampersand \& +% Acute accent \' Left paren \( Right paren \) +% Asterisk \* Plus \+ Comma \, +% Minus \- Point \. Solidus \/ +% Colon \: Semicolon \; Less than \< +% Equals \= Greater than \> Question mark \? +% Commercial at \@ Left bracket \[ Backslash \\ +% Right bracket \] Circumflex \^ Underscore \_ +% Grave accent \` Left brace \{ Vertical bar \| +% Right brace \} Tilde \~} +% +% \GetFileInfo{pagesel.drv} +% +% \title{The \xpackage{pagesel} package} +% \date{2006/03/07 v1.5} +% \author{Heiko Oberdiek\\\xemail{oberdiek@uni-freiburg.de}} +% +% \maketitle +% +% \begin{abstract} +% Single pages or page areas can be selected for output. +% \end{abstract} +% +% \tableofcontents % % \newenvironment{param}{^^A % \newcommand{\entry}[1]{\meta{\###1}:&}^^A @@ -72,16 +178,6 @@ % % \newcommand*{\Option}[1]{\textsf{#1}} % -% \SetupTitle{page,select,shipout,LaTeX} -% \maketitle -% -% \begin{abstract} -% With this package single pages or page areas can be selected -% for output. -% \end{abstract} -% -% \tableofcontents -% % \section{Usage} % The package \Package{pagesel} is a \LaTeXe\ package: % \begin{quote} @@ -89,8 +185,8 @@ % \end{quote} % (For plain\TeX\ and \LaTeX\,2.09 the similar package % \URL{\Package{selectp}}^^A -% {ftp://ftp.dante.de/tex-archive/macros/latex209/contrib/misc/selectp.sty} -% from \Email[Donald Arsenau]{asnd@triumf.ca} can be used.) +% {ftp://ftp.ctan.org/tex-archive/macros/latex209/contrib/misc/selectp.sty} +% from \NameEmail{Donald Arsenau}{asnd@triumf.ca} can be used.) % % Depending on the options the package works in two modes: % \begin{enumerate} @@ -153,7 +249,8 @@ % \subsubsection{Options\texorpdfstring{ for handling auxiliary files}{}} % \begin{description} % \item[\Option{nofiles}:] This is the default. Auxiliary files are -% read but not written or changed. +% read but not written or changed. Also the job is aborted +% after the last selected page for saving time. % \item[\Option{nonofiles}/\Option{files}:] Auxiliary files are % written. % \end{description} @@ -165,7 +262,7 @@ % This is harmless and can be ignored. % \item The outline auxiliary file \cmd{\jobname.out}, however, % is opened and truncated to zero bytes. -% Version \ref{Hist10} of this package had +% Version 1.0 of this package had % loaded a patch file \File{hypnofil.tex}, if it detects % \Package{hyperref} to get \cmd{\nofiles} work. % @@ -174,14 +271,16 @@ % is no longer needed and removed. % \end{itemize} % -% \Installation -% -% \StopEventually{} +% \StopEventually{ +% } % % \section{Implementation} % \subsection{Package} % \begin{macrocode} %<*package> +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{pagesel} + [2006/03/07 v1.5 Selecting shipout output pages (HO)] % \end{macrocode} % % If the package is loaded twice, the package code does not @@ -330,9 +429,26 @@ % \end{macro} % \end{macro} % +% \begin{macrocode} +\newcommand{\ps@lastpage}{\maxdimen} +\ifx\ps@nofiles\nofiles + \ifx\ps@testlist\@empty + \else + \def\ps@lastpage{0}% + \newcommand*{\ps@pagetest}[2]{% + \ifnum#2>\ps@lastpage\relax + \def\ps@lastpage{#2}% + \fi + }% + \ps@testlist + \let\ps@pagetest\relax + \fi +\fi +% \end{macrocode} +% % \begin{macro}{\ps@ifinset} % \begin{macrocode} -\newcommand{\ps@ifinset}[4]{% +\newcommand*{\ps@ifinset}[4]{% \ifnum#1>\value{ps@count}% \ps@ReturnAfterElseFi{#4}% \else @@ -359,6 +475,23 @@ % \begin{macrocode} \EveryShipout{% \stepcounter{ps@count}% + \ifnum\value{ps@count}>\ps@lastpage\relax + \global\output{% + \ps@cleanup@if + \ps@group@message + \typeout{% + Package pagesel Notice: Aborting LaTeX job % + after last selected page (\ps@lastpage).% + }% + \ps@message@ignore + \global\setbox255\box\voidb@x + \deadcycles0\relax +% \end{macrocode} +% First leave the output group before ending the job. +% \begin{macrocode} + \aftergroup\@@end + }% + \fi \let\ps@next\@empty \ifx\ps@testlist\@empty \else @@ -377,43 +510,247 @@ \else \fi \fi + \ps@begindvi \ps@next } % \end{macrocode} +% % \begin{macrocode} -%</package> +\begingroup\expandafter\expandafter\expandafter\endgroup +\expandafter\ifx\csname currentiflevel\endcsname\relax + \let\ps@cleanup@if\@empty +\else + \def\ps@cleanup@if{% + \ifnum\currentiflevel>\@ne + \csname fi\endcsname + \expandafter\ps@cleanup@if + \fi + }% +\fi +% \end{macrocode} +% Because of \cs{aftergroup} it is too dangerous to perform +% a similar cleanup for groups. +% \begin{macrocode} +\begingroup\expandafter\expandafter\expandafter\endgroup +\expandafter\ifx\csname currentgrouplevel\endcsname\relax + \let\ps@group@message\@empty + \def\ps@message@ignore{% + \typeout{% + (pagesel) \space\space\@spaces\@spaces\@spaces + Messages (\string\end\space occurred ...) can be ignored.% + }% + }% +\else + \def\ps@group@message{% + \ifnum\currentgrouplevel>\@ne + \def\ps@message@ignore{% + \typeout{% + (pagesel) \space\space\@spaces\@spaces\@spaces + Message (\string\end\space occurred ...) % + can be ignored.% + }% + }% + \else + \let\ps@message@ignore\@empty + \fi + }% +\fi % \end{macrocode} % -% \StartHistory -% \HistVersion{1999/03/01 v0.9} -% \begin{itemize} -% \item The first version was built as a response to a question -% of \Email[Dirk Kuypers]{dk@comnets.rwth-aachen.de}, +% \subsection{AtBeginDvi hook support} +% +% The material of box \cs{@begindvibox} is recorded in parallel +% in box \cs{ps@begindvibox}. +% \begin{macrocode} +\newbox\ps@begindvibox +\ifvoid\@begindvibox +\else + \global\setbox\ps@begindvibox\vbox{% + \unvbox\@begindvibox + }% +\fi +\let\ps@org@AtBeginDvi\AtBeginDvi +\def\AtBeginDvi#1{% + \global\setbox\ps@begindvibox\vbox{% + \unvbox\ps@begindvibox + #1% + }% + \ps@org@AtBeginDvi{#1}% +} +% \end{macrocode} +% +% \begin{macro}{\ps@begindvi} +% Macro \cs{ps@begindvi} is called the similar way as \cs{@begindvi}. +% If the first page is printed, then \cs{AtBeginDvi} should work +% as usual. Otherwise the contents of box \cs{ps@begindvibox} is +% set on the first selected page. +% \begin{macrocode} +\def\ps@begindvi{% + \ifx\ps@next\@empty + \global\let\ps@begindvi\@empty + \else + \global\let\ps@begindvi\ps@begindvi@do + \fi +} +\def\ps@begindvi@do{% + \ifx\ps@next\@empty + \setbox\@cclv\vbox{% + \unvbox\ps@begindvibox + \box\@cclv + }% + \global\let\ps@begindvi\@empty + \fi +} +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} +%</package> +% \end{macrocode} +% \section{Installation} +% +% \paragraph{CTAN.} This package is available on +% CTAN\footnote{\url{ftp://ftp.ctan.org/tex-archive/}}: +% \begin{description} +% \item[\CTAN{macros/latex/contrib/oberdiek/pagesel.dtx}] The source file. +% \item[\CTAN{macros/latex/contrib/oberdiek/pagesel.pdf}] Documentation. +% \end{description} +% +% \paragraph{Unpacking.} The \xfile{.dtx} file is a self-extracting +% \docstrip\ archive. The files are extracted by running the +% \xfile{.dtx} through \plainTeX: +% \begin{quote} +% \verb|tex pagesel.dtx| +% \end{quote} +% +% \paragraph{TDS.} Now the different files must be moved into +% the different directories in your installation TDS tree +% (also known as \xfile{texmf} tree): +% \begin{quote} +% \sbox0{^^A +% \begin{tabular}{@{}>{\ttfamily}l@{$\quad\rightarrow\quad$}>{\ttfamily}l@{}} +% pagesel.sty & tex/latex/oberdiek/pagesel.sty\\ +% pagesel.pdf & doc/latex/oberdiek/pagesel.pdf\\ +% pagesel.dtx & source/latex/oberdiek/pagesel.dtx\\ +% \end{tabular}^^A +% }% +% \ifdim\wd0>\linewidth +% \mbox{}\nobreak\hskip0pt minus\leftmargin +% \usebox0 +% \nobreak\hskip0pt minus\rightmargin +% \else +% \usebox0 +% \fi +% \end{quote} +% If you have a \xfile{docstrip.cfg} that configures and enables \docstrip's +% TDS installing feature, then some files can already be in the right +% place, see the documentation of \docstrip. +% +% \paragraph{Refresh file databases.} If your \TeX~distribution +% (\teTeX, \mikTeX, \dots) rely on file databases, you must refresh +% these. For example, \teTeX\ users run \verb|texhash| or +% \verb|mktexlsr|. +% +% \subsection{Some details for the interested} +% +% \paragraph{Attached source.} +% +% The PDF documentation on CTAN also includes the +% \xfile{.dtx} source file. It can be extracted by +% AcrobatReader 6 or higher. Another option is \textsf{pdftk}, +% e.g. unpack the file into the current directory: +% \begin{quote} +% \verb|pdftk pagesel.pdf unpack_files output .| +% \end{quote} +% +% \paragraph{Unpacking with \LaTeX.} +% The \xfile{.dtx} chooses its action depending on the format: +% \begin{description} +% \item[\plainTeX:] Run \docstrip\ and extract the files. +% \item[\LaTeX:] Generate the documentation. +% \end{description} +% If you insist on using \LaTeX\ for \docstrip\ (really, +% \docstrip\ does not need \LaTeX), then inform the autodetect routine +% about your intension: +% \begin{quote} +% \verb|latex \install=y\input{pagesel.dtx}| +% \end{quote} +% Do not forget to quote the argument according to the demands +% of your shell. +% +% \paragraph{Generating the documentation.} +% You can use both the \xfile{.dtx} or the \xfile{.drv} to generate +% the documentation. The process can be configured by the +% configuration file \xfile{ltxdoc.cfg}. For instance, put this +% line into this file, if you want to have A4 as paper format: +% \begin{quote} +% \verb|\PassOptionsToClass{a4paper}{article}| +% \end{quote} +% An example follows how to generate the +% documentation with pdf\LaTeX: +% \begin{quote} +%\begin{verbatim} +%pdflatex pagesel.dtx +%makeindex -s gind.ist pagesel.idx +%pdflatex pagesel.dtx +%makeindex -s gind.ist pagesel.idx +%pdflatex pagesel.dtx +%\end{verbatim} +% \end{quote} +% +% \begin{History} +% \begin{Version}{1999/03/01 v0.9} +% \item +% The first version was built as a response to a question +% of \NameEmail{Dirk Kuypers}{dk@comnets.rwth-aachen.de}, % published in the newsgroup % \href{news:de.comp.text.tex}{de.comp.text.tex}:\\ % \URL{``Re: pdflatex nur fuer bestimmte Seiten?!?''}^^A % {http://www.dejanews.com/[ST_rn=ps]/getdoc.xp?AN=450111880} -% \end{itemize} -% \HistVersion{1999/04/05 v1.0}\HistLabel{Hist10} -% \begin{itemize} -% \item Documentation added in dtx format. -% \item Copyright: LPPL (\CTAN{macros/latex/base/lppl.txt}) -% \item Options |odd|, |even| added. -% \item \cmd{\nofiles} added, bug fix for \Package{hyperref}. -% \item Abort loading of package, if nothing to do. -% \end{itemize} -% \HistVersion{1999/04/13 v1.1} -% \begin{itemize} -% \item \cmd{\nofiles} bug fix removed -% because of \Package{hyperref} 6.55. -% \item First CTAN release. -% \end{itemize} -% \HistVersion{2003/06/05 v1.2} -% \begin{itemize} -% \item \cmd{\deadcyles} is decremented for omitted pages. -% \item LPPL 1.2. -% \end{itemize} -% \hfuzz10pt +% \end{Version} +% \begin{Version}{1999/04/05 v1.0} +% \item +% Documentation added in dtx format. +% \item +% Copyright: LPPL (\CTAN{macros/latex/base/lppl.txt}) +% \item +% Options |odd|, |even| added. +% \item +% \cmd{\nofiles} added, bug fix for \Package{hyperref}. +% \item +% Abort loading of package, if nothing to do. +% \end{Version} +% \begin{Version}{1999/04/13 v1.1} +% \item +% \cs{nofiles} bug fix removed +% because of \xpackage{hyperref} 6.55. +% \item +% First CTAN release. +% \end{Version} +% \begin{Version}{2003/06/05 v1.2} +% \item +% \cs{deadcyles} is decremented for omitted pages. +% \item +% LPPL 1.2. +% \end{Version} +% \begin{Version}{2006/02/20 v1.3} +% \item +% Code is not changed. +% \item +% New DTX framework. +% \item +% LPPL 1.3 +% \end{Version} +% \begin{Version}{2006/03/02 v1.4} +% \item +% Support for \cs{AtBeginDvi} added. +% \end{Version} +% \begin{Version}{2006/03/07 v1.5} +% \item +% Job is aborted after last selected page. +% \end{Version} +% \end{History} +% % \PrintIndex % % \Finale |