summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/jlabels
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2011-08-20 16:04:21 +0000
committerKarl Berry <karl@freefriends.org>2011-08-20 16:04:21 +0000
commite2c98c9e8f8051f4ad79a2015a0cd1288dd39310 (patch)
tree1db619627f82577ba47baba45fa5bc53554b4140 /Master/texmf-dist/tex/latex/jlabels
parent4641151851175ac5754b7fa0a304067d70ae30a1 (diff)
new latex package jlabels (5jun11)
git-svn-id: svn://tug.org/texlive/trunk@23619 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/jlabels')
-rw-r--r--Master/texmf-dist/tex/latex/jlabels/jlabels.sty140
1 files changed, 140 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/jlabels/jlabels.sty b/Master/texmf-dist/tex/latex/jlabels/jlabels.sty
new file mode 100644
index 00000000000..f819061adce
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/jlabels/jlabels.sty
@@ -0,0 +1,140 @@
+%% This is jlabels.sty written by Jamal K. Tartir.
+%%
+%% jktartir@hotmail.com
+%%
+%% A latex package designed to make letter-sized pages of labels.
+%%
+%% Copyright 2011 by Jamal K. Tartir.
+%%
+%% All rights reserved.
+%%
+%% This file may be modified for individual use.
+%%
+%% A modified version of this file my not be
+%% distributed under its original name.
+
+%%%%% PACKAGES %%%%%
+
+\RequirePackage{calc}
+\RequirePackage{ifthen}
+\RequirePackage{pstricks}
+\RequirePackage{etoolbox}
+
+%%%%% NEW LENGTHS %%%%%
+
+\newlength{\jlabelHorizontalPitch}
+\newlength{\jlabelVerticalPitch}
+
+%%%%% COUNTERS %%%%%
+
+\newcounter{jlabelxcoordinate}
+\newcounter{jlabelycoordinate}
+\newcounter{jlabelNumberOfRowsPerPage}
+\newcounter{jlabelNumberOfColumnsPerPage}
+\newcounter{jlabelNumberOfLabelsPerPage}
+\newcounter{jlabelNumberOfLabelsOnThisPage}
+\newcounter{jlabelNumberOfTimesThisLabel}
+
+%%%%% DEFINITIONS %%%%%
+
+\def\jlabeljustify{l}
+
+\def\jlabelfillstylec{%
+\gdef\setjlabelcoordinates{%
+\setcounter{jlabelxcoordinate}{%
+\value{jlabelNumberOfLabelsOnThisPage}/\value{jlabelNumberOfRowsPerPage}}%
+\setcounter{jlabelycoordinate}{%
+(\value{jlabelxcoordinate}*\value{jlabelNumberOfRowsPerPage})
+-\value{jlabelNumberOfLabelsOnThisPage}}}}
+
+\def\jlabelfillstyler{%
+\gdef\setjlabelcoordinates{%
+\setcounter{jlabelycoordinate}{%
+-\value{jlabelNumberOfLabelsOnThisPage}/\value{jlabelNumberOfColumnsPerPage}}
+\setcounter{jlabelxcoordinate}{%
+(\value{jlabelycoordinate}*\value{jlabelNumberOfColumnsPerPage})
++\value{jlabelNumberOfLabelsOnThisPage}}}}
+
+%%%%% COMMANDS %%%%%
+
+\newcommand{\jlabelLengths}[9][1in]{%
+%% #1: Units
+%% #2: Left Margin
+%% #3: Top Margin
+%% #4: Label Width
+%% #5: Label Height
+%% #6: Number of Rows
+%% #7: Number of Columns
+%% #8: Horizontal Gap
+%% #9: Vertical Gap
+%
+\setlength{\voffset}{-1in}
+\setlength{\hoffset}{-1in}
+\setlength{\textwidth}{8in}
+\setlength{\oddsidemargin}{0pt}
+\setlength{\evensidemargin}{0pt}
+\setlength{\headheight}{0pt}
+\setlength{\marginparsep}{0pt}
+\setlength{\footskip}{0pt}
+\setlength{\topmargin}{0pt}
+\setlength{\headsep}{0pt}
+\setlength{\marginparwidth}{0pt}
+\setlength{\marginparpush}{0pt}
+%
+\setlength{\unitlength}{#1}%
+%
+\setlength{\jlabelHorizontalPitch}{#4\unitlength}
+\setlength{\jlabelVerticalPitch}{#5\unitlength}
+%
+\addtolength{\hoffset}{#2\unitlength}
+\addtolength{\hoffset}{.5\jlabelHorizontalPitch}
+\setlength{\textheight}{#3\unitlength}
+\addtolength{\textheight}{.5\jlabelVerticalPitch}
+\addtolength{\jlabelHorizontalPitch}{#8\unitlength}
+\addtolength{\jlabelVerticalPitch}{#9\unitlength}
+%
+\setcounter{jlabelNumberOfRowsPerPage}{#6}
+\setcounter{jlabelNumberOfColumnsPerPage}{#7}
+\setcounter{jlabelNumberOfLabelsPerPage}{#6*#7}
+%
+\psset{xunit=\jlabelHorizontalPitch}
+\psset{yunit=\jlabelVerticalPitch}}
+
+\newcommand{\beginjlabels}[1][c]{%
+\csexpandonce{jlabelfillstyle#1}%
+\xdef\thisjlabelfillstyle{#1}%
+\thispagestyle{empty}%
+
+\setcounter{jlabelNumberOfLabelsOnThisPage}{0}
+
+\text{ }
+
+\vfill
+
+\noindent%
+\begin{pspicture}(0,0)}
+
+\def\endjlabels{\end{pspicture}}
+
+\newcommand{\jlabelt}[2][1]{%
+%
+\setcounter{jlabelNumberOfTimesThisLabel}{0}%
+\whiledo{\value{jlabelNumberOfTimesThisLabel}<#1}{%
+%
+\ifthenelse{%
+\value{jlabelNumberOfLabelsOnThisPage}<\value{jlabelNumberOfLabelsPerPage}}%
+{}{\endjlabels\newpage\beginjlabels[\thisjlabelfillstyle]}%
+%
+\setjlabelcoordinates%
+%
+\rput(\value{jlabelxcoordinate},\value{jlabelycoordinate})%
+{\begin{tabular}{\jlabeljustify}#2\end{tabular}}%
+%
+\addtocounter{jlabelNumberOfLabelsOnThisPage}{1}%
+%
+\addtocounter{jlabelNumberOfTimesThisLabel}{1}}%% end whiledo
+}
+
+\newcommand{\myjlabel}[2]{\csgdef{myjlabeladdress#1}{#2}}
+
+\newcommand{\jlabel}[2][1]{\jlabelt[#1]{\csexpandonce{myjlabeladdress#2}}}