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 am trying to process the following into Avery 5160 mailing labels, using the \skipblank code that someone else posted on this site to suppress blank lines:


\documentclass[10pt]{letter}  
\usepackage[avery5160label,noprintbarcodes]{envlab}  
\usepackage{datatool}  
\usepackage{makerobust}  
\makeatletter  
%commands to skip blank or missing fields  
%* version replaces with space only  
    \newcommand\skipblank{\@ifstar\@spskip\@nlskip}  
    \newcommand\@nlskip[1]{\ifthenelse{\DTLiseq{#1}{}}{\relax}{#1\\}}  
    \newcommand\@spskip[1]{\ifthenelse{\DTLiseq{#1}{}}{\relax}{#1\space}}  
\MakeRobustCommand{\@nlskip}  
\MakeRobustCommand{\@spskip}  
\makeatother  

\makelabels
\begin{document}
\startlabels

\DTLsetseparator{|}
\DTLloadrawdb{maillist}{sitemailmerge.csv}


\DTLforeach{maillist}    {\name=Contact,\site=SiteName,\addra=Addressa,\addrb=Addressb,\addrc=Addressc,\city=City,\st=StateProv,\zip=PostCode,\country=Country,\role=Role,\fname=Firstname,\lname=Lastname,\tit=Title}{%  


\mlabel{  
\skipblank*{\name},\ \skipblank*{\role}\\  
\skipblank{\site}  
\skipblank{\addra}  
\skipblank{\addrb}  
\skipblank{\addrc}  
\city\ \st\ \zip\ \ \country  

    }  
}  

\end{document}

But I keep getting the following LaTeX error:

"
! Missing control sequence inserted.
<inserted text>
                \inaccessible
l.43 }

?
! Missing { inserted.
<recently read> }

l.43 }

?
! Missing } inserted.
"

It was my understanding that unmatched } errors were related to fragile commands, hence the use of \MakeRobustCommand{}, but this doesn't seem to help. It is extremely frustrating. Would appreciate any suggestions.

share|improve this question

closed as not a real question by lockstep, Joseph Wright May 6 '12 at 8:22

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

    
Can you provide some entries of you csv file. Up to now we can't test your example. –  Marco Daniel Apr 14 '12 at 22:14
    
Without a complete demo, we can't hope to answer this. –  Joseph Wright May 6 '12 at 8:22

Browse other questions tagged or ask your own question.