1

Running the following through LaTeX gives me a "Missing number" error:

\documentclass[12pt]{letter}
\usepackage[c5envelope,noprintreturnaddress,capaddress]{envlab}
\usepackage[latin1]{inputenc}
\usepackage{datatool}
\makelabels
\begin{document}
\startlabels
\DTLloaddb{recipients}{recipients.csv}
\DTLforeach*{recipients}{\firstname=Vorname,%
 \surname=Nachname,%
 \address1=Adresszeile1,%
 \address2=Adresszeile2,%
 \city=Ort,%
 \postcode=PLZ}{%
\mlabel{Dummy}{%
 \firstname \surname\\
 \address1\\
 \address2\\
 \city \postcode}}
\end{document}

This is my recipients.csv file:

Vorname,Nachname,Adresszeile1,Adresszeile2,PLZ,Ort
Wolfang,Ingeborg,Im Wiengert,Baumgartnerstrasse 11,8800,Biel

Do yo see what I'm doing wrong?

4
  • Can you use \address1 and \address2 as macros? Try changing them to \addressone and \addresstwo to see if that fixes things. In general, you can't use numbers in macro names.
    – Seamus
    Jan 25, 2012 at 12:30
  • @quagmire This works for me. Have you considered upgrading your packages?
    – user10274
    Jan 25, 2012 at 12:33
  • @MarcvanDongen No, it doesn't work. Two lines are printed the same.
    – egreg
    Jan 25, 2012 at 13:06
  • @egreg OK. Now I understand what was meant with "it doesn't work". I thought the poster got a runtime error:-)
    – user10274
    Jan 25, 2012 at 13:22

1 Answer 1

5

You are defining twice the \address macro and not macros \address1 and \address2. Only letters can appear in macro names

\DTLforeach*{recipients}{\firstname=Vorname,%
 \surname=Nachname,%
 \addressA=Adresszeile1,%
 \addressB=Adresszeile2,%
 \city=Ort,%
 \postcode=PLZ}{%
\mlabel{Dummy}{%
 \firstname \surname\\
 \addressA\\
 \addressB\\
 \city \postcode}}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .