diff options
Diffstat (limited to 'macros/latex/contrib/jlabels')
-rw-r--r-- | macros/latex/contrib/jlabels/README | 3 | ||||
-rw-r--r-- | macros/latex/contrib/jlabels/jlabels.pdf | bin | 0 -> 29820 bytes | |||
-rw-r--r-- | macros/latex/contrib/jlabels/jlabels.sty | 143 | ||||
-rw-r--r-- | macros/latex/contrib/jlabels/jlabels.tex | 334 |
4 files changed, 480 insertions, 0 deletions
diff --git a/macros/latex/contrib/jlabels/README b/macros/latex/contrib/jlabels/README new file mode 100644 index 0000000000..47af403dd6 --- /dev/null +++ b/macros/latex/contrib/jlabels/README @@ -0,0 +1,3 @@ + +The jlabels package is designed to make letter-sized pages of labels. + diff --git a/macros/latex/contrib/jlabels/jlabels.pdf b/macros/latex/contrib/jlabels/jlabels.pdf Binary files differnew file mode 100644 index 0000000000..95e9731497 --- /dev/null +++ b/macros/latex/contrib/jlabels/jlabels.pdf diff --git a/macros/latex/contrib/jlabels/jlabels.sty b/macros/latex/contrib/jlabels/jlabels.sty new file mode 100644 index 0000000000..fa892aa595 --- /dev/null +++ b/macros/latex/contrib/jlabels/jlabels.sty @@ -0,0 +1,143 @@ +%% 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. + +%% Alternately, this work may be distributed and/or modified +%% under the conditions of the LaTeX Project Public License. + +%%%%% 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}}} diff --git a/macros/latex/contrib/jlabels/jlabels.tex b/macros/latex/contrib/jlabels/jlabels.tex new file mode 100644 index 0000000000..d9ea78acbb --- /dev/null +++ b/macros/latex/contrib/jlabels/jlabels.tex @@ -0,0 +1,334 @@ +\documentclass[12pt]{amsart} + +%%%%% MARGINS %%%%% + +\setlength{\columnsep}{50pt} +\setlength{\voffset}{-50pt} +\setlength{\textheight}{650pt} +\setlength{\hoffset}{-50pt} +\setlength{\textwidth}{465pt} +\newlength{\oldparindent} +\setlength{\oldparindent}{\parindent} +\setlength{\parindent}{0pt} +\setlength{\parskip}{\baselineskip} + +%%%%% COUNTERS %%%%% + +\newcounter{Object} +\newcounter{SubObject} + +%%%%% DEFINITIONS %%%%% + +\def\ex{\addtocounter{Object}{1}% + {\bf Example \theObject:} + \setcounter{SubObject}{0}} + +\def\exlabeljane{% +{ } +\parbox{87pt}{\text{ }\\ +Jane Smith\\ +321 Main Street\\ +City, State 54321} +{ }} + +\def\exlabeljohn{% +{ } +\parbox{87pt}{\text{ }\\ +John Smith\\ +123 Main Street\\ +City, State 12345} +{ }} + +\def\janecode{% +Jane Smith\(\backslash\)\(\backslash\)% +321 Main Street\(\backslash\)\(\backslash\)% +City, State 54321} + +\def\johncode{% +John Smith\(\backslash\)\(\backslash\)% +123 Main Street\(\backslash\)\(\backslash\)% +City, State 12345} + +\def\note{\addtocounter{Object}{1}% + {\bf Note \theObject:} + \setcounter{SubObject}{0}} + +\def\subobject{\addtocounter{SubObject}{1}% + $\boldsymbol{(\roman{SubObject})}$ } + +\def\tip{\addtocounter{Object}{1}% + {\bf Tip \theObject:} + \setcounter{SubObject}{0}} + +\def\trick{\addtocounter{Object}{1}% + {\bf Trick \theObject:} + \setcounter{SubObject}{0}} + +\begin{document} + +\begin{center} + +{\bf Latex Package jlabels} + +Jamal K. Tartir + +jktartir@hotmail.com + +\end{center} + +\vspace{15pt} + +\begin{center} + +A latex package designed to make letter-sized pages of labels. + +\end{center} + +\vspace{15pt} + +\begin{center} + +{\bf Section I: Getting Started} + +\end{center} + +\note +This package has been tested with only the amsart documentclass. + +The following six commands have been defined. + +\(\backslash\)beginjlabels[opfs] + +\(\backslash\)endjlabels + +\(\backslash\)jlabelt[opint]\{address\} + +\(\backslash\)myjlabel\{alias\}\{address\} + +\(\backslash\)jlabel[opint]\{alias\} + +\(\backslash\)jlabelLengths[oplu]% +\{leftm\}% +\{topm\}% +\{width\}% +\{height\}% +\{rows\}% +\{cols\}% +\{hgap\}% +\{vgap\} + +\note +The following command +must be placed in the preamble. + +\(\backslash\)jlabelLengths[oplu]% +\{leftm\}% +\{topm\}% +\{width\}% +\{height\}% +\{rows\}% +\{cols\}% +\{hgap\}% +\{vgap\} + +Definitions and explanations of the arguments are given below. + +oplu: optional length unit (e.g., 1in, 2cm, 3pt, etc.) + +The default value for oplu is 1in. + +The required arguments leftm, \(\ldots,\) vgap +must be numbers only +(no units are entered). +Negative numbers are permitted. + +leftm: left margin + +topm: top margin + +width: label width + +height: label height + +rows: number of rows + +cols: number of columns + +hgap: horizontal gap (space between columns) + +vgap: vertical gap (space between rows) + +\ex +The following commands are equivalent. + +\(\backslash\)jlabelLengths[1in]% +\{.1875\}\{.5\}\{2.625\}\{1\}\{10\}\{3\}\{.125\}\{0\} + +\(\backslash\)jlabelLengths% +\{.1875\}\{.5\}\{2.625\}\{1\}\{10\}\{3\}\{.125\}\{0\} + +\(\backslash\)jlabelLengths[72.27pt]% +\{.1875\}\{.5\}\{2.625\}\{1\}\{10\}\{3\}\{.125\}\{0\} + +\note +The +\(\backslash\)jlabelLengths +command +sets the page layout as necessary. +Length commands +such as +\(\backslash\)hoffset, +\(\backslash\)voffset, +\(\backslash\)textwidth, +\(\backslash\)textheight, +etc. +should not be used. + +\tip +As a way of keeping notes, +several \(\backslash\)jlabelLengths +commands can be put in the preamble with +the unused ones commented out. + +\note +Labels are created by placing +\(\backslash\)jlabelt[opint]\{Address\} +commands +between\linebreak +\(\backslash\)beginjlabels[opfs] +and +\(\backslash\)endjlabels +within the body of the document. + +The optional argument of the +\(\backslash\)beginjlabels +command determines whether the page is filled by +columns (opfs = c) or rows (opfs = r). +The default value is c. + +The optional argument +of the \(\backslash\)jlabelt command +is the number of times the label is printed +and its default value is 1. + +\ex +The following sequence of commands placed in the body +of the document +produces the label +\exlabeljohn +three times and the label +\exlabeljane +once. + +\enlargethispage{\baselineskip} + +\(\backslash\)beginjlabels + +\(\backslash\)jlabelt[3]\{\johncode\} + +\(\backslash\)jlabelt\{\janecode\} + +\(\backslash\)endjlabels + +\note +The command +\(\backslash\)jlabelt\{\} creates a blank label. + +\ex +The command +\(\backslash\)jlabelt[4]\{\} creates 4 blank labels. + +\note +The \(\backslash\)jlabelt command will create new pages as necessary. + +\note +The command +\(\backslash\)myjlabel\{alias\}\{address\} +allows +\(\backslash\)jlabel[opint]\{alias\} +to be used in place of +\(\backslash\)jlabelt[opint]\{address\}. + +\note +The \(\backslash\)myjlabel command +should be placed in the preamble (or personal sty file), +not within the document environment. + +\ex +The command shown below +allows +\(\backslash\)jlabel[3]\{home\} +to be used in place of +\(\backslash\)jlabelt[3]\{\johncode\}. + +\(\backslash\)myjlabel\{home\}\{\johncode\} + +\begin{center} + +{\bf Section II: Adjusting Labels} + +\end{center} + +\note +By default, the labels are left justified. This can +be changed by changing the definition of +\(\backslash\)jlabeljustify from l to r or c. + +\ex +To right justify [center] the labels, +place the command +\(\backslash\)def\(\backslash\)jlabeljustify\{r\} +[\(\backslash\)def\(\backslash\)jlabeljustify\{c\}] +at the appropriate place in the document. + +\note +By default, the text of the label is placed in the +center of the label. +Changing the values of +leftm and topm (negative values are allowed) +in the \(\backslash\)jlabelLengths command will shift +all labels in the document. + +\note +The text of an individual label can be shifted by +placing the text in the tabular environment and then +using the +\(\backslash\)hspace* and +\(\backslash\)raisebox commands. + +\ex +The command shown below will +move the label +\exlabeljohn +right 2 inches and down 1 inch. + +\(\backslash\)jlabelt\{\%\\ +\(\backslash\)hspace*\{4in\}\%\\ +\(\backslash\)raisebox\{-2in\}\{\%\\ +\(\backslash\)begin\{tabular\}\{\(\backslash\)jlabeljustify\}\\ +\johncode\\ +\(\backslash\)end\{tabular\}\}\} + +\note +The lengths used in the +\(\backslash\)hspace* and +\(\backslash\)raisebox commands are twice the +amount that the text will actually move. This is +because the jlabels package centers the text in the +middle of the label. + +\trick +An easy way to shift the text of a label left is to put an +\(\backslash\)hspace* command at the end of the longest line. + +\ex +The command shown below will move the label \exlabeljohn left 1 inch. + +\(\backslash\)jlabelt\{\johncode\(\backslash\)hspace*\{2in\}\} + +\tip +Adjust individual labels as little as possible. The +tediousness of this task is one of the reasons that this +package was written. + +\end{document} |