% This file is part of stubs. % % stubs is free software; you can redistribute it and/or modify % it under the terms of the GNU General Public License as published by % the Free Software Foundation; either version 2 of the License, or % (at your option) any later version. % % Stubs 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. See the % GNU General Public License for more details. % % You should have received a copy of the GNU General Public License % along with Foobar; if not, write to the Free Software % Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA % % % Version 0.1.1 % % Changelog: % % see changelog.txt % \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{stubs}[2005/12/16 Stubs 0.1.1 by N. Stuhrmann] \RequirePackage[absolute]{textpos}[2005/10/13] \RequirePackage{graphicx}[1999/02/16] \DeclareOption{addmargin}{\newcommand*\st@addmargin{\relax}}% \ProcessOptions \newlength{\stubbmargin} \setlength{\stubbmargin}{5mm} \newlength{\stublmargin} \setlength{\stublmargin}{5mm} \newlength{\stubrmargin} \setlength{\stubrmargin}{5mm} \newcommand{\stubs}[2][0]{% \def\st@number{#1}% \def\st@size{#2}% \st@b } \newcommand{\st@b}[2][\empty]{% {% \unitlength=1pt\relax \@tempdima=\paperheight\relax \@tempdimb=\paperwidth\relax \advance\@tempdimb by -\stublmargin\relax \advance\@tempdimb by -\stubrmargin\relax \textblockorigin{\stublmargin}{\paperheight}\relax \setbox\@tempboxa=\vbox{\parbox[b]{\st@size}{#1}\parbox[b]{\st@size}{#2}}\relax \count@=\st@number\relax \@ifundefined{st@addmargin}% {}% {\enlargethispage{-\st@size}}% %\ifnum\count@=0\relax % \dimen@=\ht\@tempboxa\relax % \advance\dimen@ by 2\fboxsep\relax % {\divide\@tempdimb by \dimen@\relax % \global\count@=\@tempdimb}% %\fi% \ifnum\count@=0\relax% \dimen@=\ht\@tempboxa\relax% \advance\dimen@ by 2\fboxsep\relax% {\divide\@tempdimb by \dimen@\relax% \expandafter}\expandafter\count@\expandafter=\number\@tempdimb \fi% \divide\@tempdimb by \count@\relax \setbox\@tempboxa=\vtop to \@tempdimb % {\vfill\hbox{\kern\fboxsep\parbox{\st@size}{#2}\kern\fboxsep}\vfill\hrule}\relax \advance\@tempdima by -\wd\@tempboxa\relax \begin{textblock}{0}(0,0)% \noindent \begin{picture}(0,0)% \put(0,\strip@pt\stubbmargin){\vrule height \wd\@tempboxa} \multiput(0,\strip@pt\stubbmargin)(\strip@pt\@tempdimb,0){\number\count@}{% \rotatebox{90}{\copy\@tempboxa}% }% \end{picture}% \end{textblock}\leavevmode% \ifx\empty#1\else% \newpage% \thispagestyle{empty}% \@ifundefined{st@addmargin}% {}% {\enlargethispage{-\st@size}}% \textblockorigin{\stubrmargin}{\paperheight}\relax \setbox\@tempboxa=\vtop to \@tempdimb % {\vfill\hbox{\kern\fboxsep\parbox{\st@size}{#1}\kern\fboxsep}\vfill}\relax \begin{textblock}{0}(0,0)% \noindent \begin{picture}(0,0)% %\put(0,\strip@pt\stubbmargin){\vrule height \wd\@tempboxa} \multiput(0,\strip@pt\stubbmargin)(\strip@pt\@tempdimb,0){\number\count@}{% \rotatebox{90}{\copy\@tempboxa}% }% \end{picture}% \end{textblock}\leavevmode% \fi% }% \ignorespaces% } \endinput