summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/piff/onepagem.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2010-12-08 00:29:42 +0000
committerKarl Berry <karl@freefriends.org>2010-12-08 00:29:42 +0000
commitb8dac36db6bad339e035d237cfed1b86713971ce (patch)
tree90f5205c580f7e74eb7eb18297a1c0936808ad19 /Master/texmf-dist/tex/latex/piff/onepagem.sty
parentec292c03bd7f22b6c53cc292304730e8a07b10b0 (diff)
piff pd (8dec10)
git-svn-id: svn://tug.org/texlive/trunk@20676 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/piff/onepagem.sty')
-rw-r--r--Master/texmf-dist/tex/latex/piff/onepagem.sty37
1 files changed, 37 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/piff/onepagem.sty b/Master/texmf-dist/tex/latex/piff/onepagem.sty
new file mode 100644
index 00000000000..d42738c7787
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/piff/onepagem.sty
@@ -0,0 +1,37 @@
+\def\filename{onepagem.sty}
+\def\fileversion{1.01a}
+\def\filedate{28 Mar 1996 13:57:34 BST}
+%%
+%%M.Piff@sheffield.ac.uk
+%%
+%If the document has only one page, omit page number. (onepagempty)
+%The page number must be produced by means of \thepage.
+%Needs two passes through LaTeX to work, as it writes to the .aux file.
+%
+%The first version was a joke put on CTAN to illustrate how useful
+%\AtEndDocument is. This one works...
+%
+% This file is placed in the public domain. No provision is made for
+% support of the use of the facilities herein.
+%
+%
+\typeout{\filename\space v\fileversion, (C) Copyright Mike Piff, \filedate}
+\NeedsTeXFormat{LaTeX2e}[1995/12/01]
+\ProvidesPackage{onepagem}
+\ProcessOptions
+
+\let\opem@shipout\shipout
+\newcounter{opem@pagecount}
+\def\shipout{%
+ \stepcounter{opem@pagecount}% count pages in document
+ \opem@shipout% restore function of \shipout
+}
+
+\AtEndDocument{%
+ \clearpage% make sure we know we are after the last page
+ \ifnum\value{opem@pagecount}=1
+ \immediate\write\@mainaux{\string\gdef\string\thepage{}}%
+ \fi
+}
+
+\endinput