3

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?

  • 2
    Welcome! No idea what you mean by 'dynamic content' but I always find the labels package 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
  • 1
    Welcome to TeX.SX! It is easier to help you if you add a minimal working example that takes the form \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. – Andrew Jul 24 '15 at 22:01
  • 2
    What's an Avery Label? – Gonzalo Medina Jul 24 '15 at 22:12
  • 1
    The documentation for the labels package is the first thing that popped up when I googled 'latex avery labels'. – Mike Renfro Jul 24 '15 at 22:25
  • 1
    @GonzaloMedina: Avery is a manufacturer (USA, I think) of self-adhesive labels, e.g. for envelopes, mail packages – user31729 Jul 24 '15 at 22:29
6

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}

labels

  • Jones is the most popular surname around these parts! – cfr Jul 24 '15 at 23:06
  • Apparently all Jones live in the Milky Way, but what about the Jones in the Andromeda Galaxy? ;-) – user31729 Jul 25 '15 at 6:11
  • @ChristianHupfer They have not, so far, enrolled for one of my classes. – cfr Jul 25 '15 at 13:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.