I'd like to print labels using the datatool and the textpos packages.
Yet as soon as I insert a paragraph inside the textbox which is inside the \DTLforeach loop, I get the "Paragraph ended before \DTLifnumeq was complete." error message.
The following example compiles without error:
File testdb.csv:
field1,field2,field3
row11,row12,row13
row21,row22,row23
File example01.tex:
\documentclass[11pt,a4paper]{article}
\usepackage[absolute]{textpos}
\usepackage{datatool}
\DTLloadrawdb{testdb}{testdb.csv}
\begin{document}
\DTLforeach*{testdb}{\addFieldi=field1}{%
\DTLifnumeq{\DTLcurrentindex}{1}{%
\begin{textblock}{3}(1,1)
\addFieldi
more text.
\end{textblock}%
}{}%
}
\end{document}
After inserting a paragraph after the \addFieldi command, the example (called example02.tex) does not compile anymore:
File example02.tex:
\documentclass[11pt,a4paper]{article}
\usepackage[absolute]{textpos}
\usepackage{datatool}
\DTLloadrawdb{testdb}{testdb.csv}
\begin{document}
\DTLforeach*{testdb}{\addFieldi=field1}{%
\DTLifnumeq{\DTLcurrentindex}{1}{%
\begin{textblock}{3}(1,1)
\addFieldi
more text.
\end{textblock}%
}{}%
}
\end{document}
I couldn't find a solution on how to circumvent the error.
Thanks a lot for your help!
\\
to terminate a line, or\endgraf
; no empty lines.