I am looking into adding dynamic content to a pre created template mainly for Avery labels.
I searched online and there doesn't seem to be mention of LaTeX being used to print to Avery Labels. Is this even possible?
I am looking into adding dynamic content to a pre created template mainly for Avery labels.
I searched online and there doesn't seem to be mention of LaTeX being used to print to Avery Labels. Is this even possible?
Here's an example which merges a list of 8 names and addresses from a data file into a template which uses the labels package to create a list of address labels on an A4 sheet of 16 such labels. The merging is done with textmerg. 2 labels are created for each entry from the data file, for a total of 16 labels.
For convenience here, the data file is written using the filecontents* environment although, typically, this file would presumably be prepared separately.
\documentclass[a4paper]{article}
\begin{filecontents*}{\jobname.dat}
Jones
Dai
58A High Street\\Big City\\Small Country\\Earth\\Solar System\\Milky Way
Jones
Mari
64 Low Road\\Small Village\\Vast Country\\Earth\\Solar System\\Milky Way
Jones
Gwyn
57B High Street\\Big City\\Small Country\\Earth\\Solar System\\Milky Way
Jones
Gwen
6C Low Road\\Small Village\\Vast Country\\Earth\\Solar System\\Milky Way
Jones
Blod
78D High Street\\Big City\\Small Country\\Earth\\Solar System\\Milky Way
Jones
Tomos
98Q Low Road\\Small Village\\Vast Country\\Earth\\Solar System\\Milky Way
Jones
Ian
108V High Street\\Big City\\Small Country\\Earth\\Solar System\\Milky Way
Jones
Sioned
133 Low Road\\Small Village\\Vast Country\\Earth\\Solar System\\Milky Way
\end{filecontents*}
\usepackage{textmerg}
\usepackage[newdimens]{labels}
\LabelCols=2
\LabelRows=8
\LeftPageMargin=4.5mm
\RightPageMargin=4.5mm
\TopPageMargin=13mm
\BottomPageMargin=13mm
\InterLabelColumn=2.5mm
\InterLabelRow=0mm
\RightLabelBorder=5mm
\LeftLabelBorder=5mm
\TopLabelBorder=5mm
\BottomLabelBorder=5mm
\begin{document}
% \LabelGridtrue %turn on to line stuff up; off to process final version
\numberoflabels=2
\Fields{\cyfenw\enwaucyntaf\cyfeiriad\cyfenweto\enwaucyntafeto\cyfeiriadeto}
\Merge{\jobname.dat}{%
\genericlabel{%
\begin{minipage}{90mm}
\small\enwaucyntaf\ \cyfenw\\\cyfeiriad
\end{minipage}
}
\genericlabel{%
\begin{minipage}{90mm}
\small\enwaucyntafeto\ \cyfenweto\\\cyfeiriadeto
\end{minipage}
}}
\end{document}
labelspackage works for me, whatever the brand of labels happens to be. (Not sure why this would matter, to be honest, but if you like Avery, I'm sure it'll work with those, too.) – cfr Jul 24 '15 at 21:40\documentclass{...}\usepackage{....}\begin{document}...\end{document}. If possible, it should compile and have the minimum amount of code needed to illustrate your problem. This makes it much easier for people to troubleshoot your problem - and much more likely that they will! I am sure that people will be able to help you but you first need to explain more clearly what you want and preferably give some examples. – Jul 24 '15 at 22:01labelspackage is the first thing that popped up when I googled 'latex avery labels'. – Mike Renfro Jul 24 '15 at 22:25labelshas out-of-the-box support for certain lines of Avery labels. How useful these are, I don't know. Even when I had Avery labels, I never had ones which were supported out of the box. But it is so easy to specify a custom layout that this really doesn't matter. You can configure the package for whatever labels you want (as long as they are basically equally sized rectangles arranged in a grid as is standard). But I don't know where thedynamic contentcomes in.... – cfr Jul 24 '15 at 22:47