Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have a number of letters created with the document class g-brief and would like to generate labels (does not have to be automatic; cut-and-paste would be ok for now) from the address used in each letter. I have had some minor success in using the labels package, but the labels do not look as good as the g-brief label, mostly I miss the sender above the recipient.

Any ideas how to "merge" these two packages? I. e. have the same "look" of the address field, just printed on labels?

Also, has anyone had any success in using the \skiplabelsoption of the labelspackage? If I use the option all labels are placed all over the page... That's why I use the double tilde in my code.

labels code I use so far:

\documentclass[a4paper,12pt]{scrartcl}
\usepackage{labels}
\usepackage[utf8]{inputenc}
\usepackage{ngerman}
%\LabelInfotrue
%\LabelGridtrue
\TopBorder=5mm
\BottomBorder=5mm
\LeftBorder=20mm
\RightBorder=2mm
\LabelRows=6
\LabelCols=2
%\numberoflabels=24
\begin{document}

\begin{labels}
~
~

{\tiny Christian Schmidt - My Address 123 - 31415 My City}
Testfirma GmbH \& Co. KG
\emph{Herrn Peter Mustermann}
Musterstrasse 12a
\hspace{1mm}
\textbf{12345 Musterhausen}
\end{labels}
\end{document}

Edit: The solution for Staples type 2x6 / 105mm x 48mm labels:

\documentclass[a4paper,12pt]{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage{ngerman}

\usepackage[]{ticket}
\usepackage[margin=2mm]{geometry}

\setlength{\unitlength}{1mm}
\ticketNumbers{2}{6}
\ticketSize{104}{44}
\ticketDistance{0}{4}

\newif\iftrennlinien

\renewcommand*{\ticketdefault}{\small
      \put(0,39){\makebox(85,4)
      {\scriptsize \textrm{\retouradresse}}}
      \iftrennlinien \put(0, 38.9){\line(1,0){85}} \fi
}
\newcommand*{\myticket}[2][]{\ticket{\small
      \put(0,39){\makebox(85,4)
      {\scriptsize \textrm{\retouradresse}}}
      \put(8,32.85){\parbox[t]{3in}{\textbf{#1} \par \vspace{2mm} #2}}
}}

\newcommand*{\retouradresse}{My Name $\cdot$ My Street 123 $\cdot$ 31415 My City}

\begin{document}
\trennlinientrue
\myticket{Testfirma GmbH \& Co. KG\\Herrn Peter Mustermann\\Musterstrasse 12a\\12345 Musterhausen}
\myticket[E I N S C H R E I B E N]{Testfirma GmbH \& Co. KG\\Herrn Peter Mustermann\\Musterstrasse 12a\\12345 Musterhausen}
\myticket{Testfirma GmbH \& Co. KG\\Herrn Peter Mustermann\\Musterstrasse 12a\\12345 Musterhausen}
\myticket[R E C H N U N G]{Testfirma GmbH \& Co. KG\\Herrn Peter Mustermann\\Musterstrasse 12a\\12345 Musterhausen}
\myticket{Testfirma GmbH \& Co. KG\\Herrn Peter Mustermann\\Musterstrasse 12a\\12345 Musterhausen}
\myticket{Testfirma GmbH \& Co. KG\\Herrn Peter Mustermann\\Musterstrasse 12a\\12345 Musterhausen}
\myticket{Testfirma GmbH \& Co. KG\\Herrn Peter Mustermann\\Musterstrasse 12a\\12345 Musterhausen}
\myticket{Testfirma GmbH \& Co. KG\\Herrn Peter Mustermann\\Musterstrasse 12a\\12345 Musterhausen}
\myticket{Testfirma GmbH \& Co. KG\\Herrn Peter Mustermann\\Musterstrasse 12a\\12345 Musterhausen}
\myticket{Testfirma GmbH \& Co. KG\\Herrn Peter Mustermann\\Musterstrasse 12a\\12345 Musterhausen}
\myticket{Testfirma GmbH \& Co. KG\\Herrn Peter Mustermann\\Musterstrasse 12a\\12345 Musterhausen}
\myticket{Testfirma GmbH \& Co. KG\\Herrn Peter Mustermann\\Musterstrasse 12a\\12345 Musterhausen}
\end{document}
share|improve this question
2  
As far as I know, g-brief is not part of the KOMA-Script bundle, which offers its own document class for letters called scrlttr2. So which one are you actually using, \documentclass{g-brief}/\documentclass{g-brief2} or \documentclass{scrlttr2}? –  diabonas Mar 27 '12 at 13:56
    
Thanks for pointing that out; but I actually do use g-brief. –  Christian Mar 27 '12 at 15:01
    
You should update your example, then. –  cgnieder Mar 27 '12 at 16:36

1 Answer 1

up vote 5 down vote accepted

Here's a solution using the ticket package - in my opinion, it is more flexible and easier to use than the labels package (e. g. you can specify the with and height of the labels directly). It reproduces the address layout of g-brief(2) exactly and should be easy to modify according to your needs.

\documentclass[a4paper,12pt]{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage{ngerman}

\usepackage[crossmark]{ticket}
\usepackage[margin=20mm]{geometry}

\setlength{\unitlength}{1mm}
\ticketNumbers{2}{6}
\ticketSize{85}{42.85}
\ticketDistance{0}{0}

\newif\iftrennlinien

\renewcommand*{\ticketdefault}{\small
      \put(0,39){\makebox(85,4)
      {\scriptsize \textrm{\retouradresse}}}
      \iftrennlinien \put(0, 38.9){\line(1,0){85}} \fi
}
\newcommand*{\myticket}[2][]{\ticket{\small
      \put(0,39){\makebox(85,4)
      {\scriptsize \textrm{\retouradresse}}}
      \put(8,32.85){\parbox[t]{3in}{\textbf{#1} \par \vspace{2mm} #2}}
}}

\newcommand*{\retouradresse}{Christian Schmidt $\cdot$ My Address 123 $\cdot$ 31415 My City}

\begin{document}
\myticket{Testfirma GmbH \& Co. KG\\Herrn Peter Mustermann\\Musterstrasse 12a\\12345 Musterhausen}
\myticket[E I N S C H R E I B E N]{Testfirma GmbH \& Co. KG\\Herrn Peter Mustermann\\Musterstrasse 12a\\12345 Musterhausen}
\myticket{Testfirma GmbH \& Co. KG\\Herrn Peter Mustermann\\Musterstrasse 12a\\12345 Musterhausen}
\myticket[R E C H N U N G]{Testfirma GmbH \& Co. KG\\Herrn Peter Mustermann\\Musterstrasse 12a\\12345 Musterhausen}
\myticket{Testfirma GmbH \& Co. KG\\Herrn Peter Mustermann\\Musterstrasse 12a\\12345 Musterhausen}
\myticket{Testfirma GmbH \& Co. KG\\Herrn Peter Mustermann\\Musterstrasse 12a\\12345 Musterhausen}
\myticket{Testfirma GmbH \& Co. KG\\Herrn Peter Mustermann\\Musterstrasse 12a\\12345 Musterhausen}
\myticket{Testfirma GmbH \& Co. KG\\Herrn Peter Mustermann\\Musterstrasse 12a\\12345 Musterhausen}
\myticket{Testfirma GmbH \& Co. KG\\Herrn Peter Mustermann\\Musterstrasse 12a\\12345 Musterhausen}
\trennlinientrue
\myticket{Testfirma GmbH \& Co. KG\\Herrn Peter Mustermann\\Musterstrasse 12a\\12345 Musterhausen}
\myticket{Testfirma GmbH \& Co. KG\\Herrn Peter Mustermann\\Musterstrasse 12a\\12345 Musterhausen}
\myticket{Testfirma GmbH \& Co. KG\\Herrn Peter Mustermann\\Musterstrasse 12a\\12345 Musterhausen}
\end{document}

Use this template as follows: The \retouradresse macro contains the the return address printed on top of every label. The recipient is added separately for each label using the custom \myticket command which expects the address as a mandatory argument. Furthermore, you can have an optional argument to add something like "Invoice" in bold letters above the address. If you want a line under the return address, use \trennlinientrue.

(I used the exact macro names and the code from g-brief, so everything should be pretty familiar.)

This is how the labels look like: labels produced by the above code

share|improve this answer
    
Perfect - Thank you! It has all the customizations I could never had hoped for ;) –  Christian Mar 28 '12 at 7:22

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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