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.

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?

share|improve this question
    
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 '12 at 12:30
    
@quagmire This works for me. Have you considered upgrading your packages? –  Marc van Dongen Jan 25 '12 at 12:33
    
@MarcvanDongen No, it doesn't work. Two lines are printed the same. –  egreg Jan 25 '12 at 13:06
    
@egreg OK. Now I understand what was meant with "it doesn't work". I thought the poster got a runtime error:-) –  Marc van Dongen Jan 25 '12 at 13:22
add comment

1 Answer

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}}
share|improve this answer
add comment

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.