From 2607d53137ede06e9780342b225218743e100bb4 Mon Sep 17 00:00:00 2001
From: Karl Berry <karl@freefriends.org>
Date: Sun, 27 Aug 2006 22:38:54 +0000
Subject: oberdiek update from tds zip (28aug06)

git-svn-id: svn://tug.org/texlive/trunk@2054 c570f23f-e606-0410-a88d-b1316a301751
---
 Master/texmf-dist/tex/latex/oberdiek/pagesel.sty | 144 ++++++++++++++++++-----
 1 file changed, 113 insertions(+), 31 deletions(-)

(limited to 'Master/texmf-dist/tex/latex/oberdiek/pagesel.sty')

diff --git a/Master/texmf-dist/tex/latex/oberdiek/pagesel.sty b/Master/texmf-dist/tex/latex/oberdiek/pagesel.sty
index dc00d265270..434cce6ff28 100644
--- a/Master/texmf-dist/tex/latex/oberdiek/pagesel.sty
+++ b/Master/texmf-dist/tex/latex/oberdiek/pagesel.sty
@@ -6,43 +6,30 @@
 %%
 %% pagesel.dtx  (with options: `package')
 %% 
-%% This file is part of the package `pagesel' for use with LaTeX2e.
+%% This is a generated file.
 %% 
-%% Function: Selecting shipout output pages.
+%% Copyright (C) 1999, 2003, 2006 by
+%%    Heiko Oberdiek <oberdiek@uni-freiburg.de>
 %% 
-%% Copyright (C) 1999, 2003 Heiko Oberdiek.
+%% 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 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.
+%% This work has the LPPL maintenance status "maintained".
 %% 
-%% Please send error reports and suggestions for improvements to
-%%   Heiko Oberdiek <oberdiek@uni-freiburg.de>.
+%% 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.
 %% 
 \NeedsTeXFormat{LaTeX2e}
 \ProvidesPackage{pagesel}
-  [2003/06/05 v1.2 Selecting shipout output pages (HO)]
-%% \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         \~}
-%%
+  [2006/03/07 v1.5 Selecting shipout output pages (HO)]
 \@ifundefined{ps@makevoid}{}{%
   \PackageWarningNoLine{pagesel}{Package already loaded.}%
   \endinput
@@ -120,7 +107,21 @@
 \setcounter{ps@count}{0}
 \long\def\ps@ReturnAfterElseFi#1\else#2\fi{\fi#1}
 \long\def\ps@ReturnAfterFi#1\fi{\fi#1}
-\newcommand{\ps@ifinset}[4]{%
+\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
+\newcommand*{\ps@ifinset}[4]{%
   \ifnum#1>\value{ps@count}%
     \ps@ReturnAfterElseFi{#4}%
   \else
@@ -138,6 +139,20 @@
 }
 \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
+      \aftergroup\@@end
+    }%
+  \fi
   \let\ps@next\@empty
   \ifx\ps@testlist\@empty
   \else
@@ -156,8 +171,75 @@
     \else
     \fi
   \fi
+  \ps@begindvi
   \ps@next
 }
+\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
+\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
+\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}%
+}
+\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
+}
 \endinput
 %%
 %% End of file `pagesel.sty'.
-- 
cgit v1.2.3

