From 0261fc078b85578551c16a76f23ebfdb8c913cd7 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Thu, 28 May 2009 00:22:45 +0000 Subject: new latex package pagecont (26may09) git-svn-id: svn://tug.org/texlive/trunk@13500 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/latex/pagecont/pagecont.sty | 59 +++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 Master/texmf-dist/tex/latex/pagecont/pagecont.sty (limited to 'Master/texmf-dist/tex/latex/pagecont') diff --git a/Master/texmf-dist/tex/latex/pagecont/pagecont.sty b/Master/texmf-dist/tex/latex/pagecont/pagecont.sty new file mode 100644 index 00000000000..d2b85739c76 --- /dev/null +++ b/Master/texmf-dist/tex/latex/pagecont/pagecont.sty @@ -0,0 +1,59 @@ +%% +%% This is file `pagecont.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% pagecont.dtx +%% +%% Copyright (C) 2007 Miguel V. S. Frasson (mvsfrasson@gmail.com) +%% +%% This file is part of the `pagecont' package. +%% +%% This package may be distributed under the terms of the LaTeX +%% Project Public License, as described in lppl.txt in the base +%% LaTeX distribution, either version 1.2 or (at your option) +%% any later version. +%% +%% This program is distributed in the hope that it will be useful, +%% but WITHOUT ANY WARRANTY; without even the implied warranty of +%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +%% +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{pagecont}% + [2009/05/26 v1 Page numbering continuation between documents] + \RequirePackage{keyval} +\newif\ifPGC@first +\PGC@firstfalse +\DeclareOption{first}{\PGC@firsttrue} +\newcommand{\PGC@savefile}{pagecont.pco} +\define@key{PGC@}{savefile}{\renewcommand{\PGC@savefile}{#1}} +\newcommand{\PGC@kvsetkeys}[1]{\setkeys{PGC@}{#1}} +\DeclareOption*{\expandafter\PGC@kvsetkeys\expandafter{\CurrentOption}} +\ProcessOptions +\newcommand{\PGC@lastfilelastpage}{0} +\newcommand{\PGC@info}[3]{% + \edef\PGC@jobname{\jobname}% + \def\PGC@jobnamesaved{#1}% + \edef\PGC@jobnamesaved{\expandafter\strip@prefix\meaning\PGC@jobnamesaved}% + \ifx\PGC@jobname\PGC@jobnamesaved + \renewcommand{\PGC@lastfilelastpage}{#2}% + \setcounter{page}{#2}% + \else + \renewcommand{\PGC@lastfilelastpage}{#3}% + \setcounter{page}{#3}% + \fi +\addtocounter{page}{1}} +\newcommand{\PGC@saveinfo}{% + \newwrite\PGC@file + \expandafter\openout\expandafter\PGC@file\PGC@savefile\relax + \write\PGC@file + {\string\PGC@info{\jobname}{\PGC@lastfilelastpage}{\arabic{page}}}} +\AtEndDocument{\PGC@saveinfo} +\ifPGC@first +\else + \IfFileExists{\PGC@savefile}{\input{\PGC@savefile}}{} +\fi +\endinput +%% +%% End of file `pagecont.sty'. -- cgit v1.2.3