diff options
author | Norbert Preining <preining@logic.at> | 2007-11-23 20:38:12 +0000 |
---|---|---|
committer | Norbert Preining <preining@logic.at> | 2007-11-23 20:38:12 +0000 |
commit | bb1f19307cb6423e6c9e795dc7748e1ca91244d9 (patch) | |
tree | f2efcee34b330c3647ca1ec1aad6556e6e78c754 /Master/texmf-dist/tex/latex/stubs | |
parent | 2a880d217a7d88f43b934deb51e531751dc6335f (diff) |
new package stubs (without stubs.pdf doc no source)
git-svn-id: svn://tug.org/texlive/trunk@5576 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/stubs')
-rw-r--r-- | Master/texmf-dist/tex/latex/stubs/stubs.sty | 111 |
1 files changed, 111 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/stubs/stubs.sty b/Master/texmf-dist/tex/latex/stubs/stubs.sty new file mode 100644 index 00000000000..5be03c680fc --- /dev/null +++ b/Master/texmf-dist/tex/latex/stubs/stubs.sty @@ -0,0 +1,111 @@ +% 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
\ No newline at end of file |