I am learning \foreach to see if it will work for what I want to do. I can't figure why the following does not generate the expected output.
MWE
\documentclass[12pt,titlepage]{article}
\usepackage{pgffor}
\setlength\parindent{0pt}
\def\mydata{
{1,2},
{3,4}
}
\begin{document}
\foreach \x in \mydata
{
now starting new entry....\\
\foreach \y in \x
{
\y \\
}
}
\end{document}
The above generate

I was expecting the second list {3,4} to also show on a separate line.
What Am I doing wrong?
TL 2014
Update
I found that the problem is that the last entry has to be on same line as the closing }, like this
\def\mydata{
{1,2},
{3,4},
{5,6}}
If the above was written as
\def\mydata{
{1,2},
{3,4},
{5,6}
}
Then same problem will show up.



}. I'll add an example now. – Nasser Jun 25 '15 at 00:47\def\mydata{{1,2} , {3,4}}). – Manuel Jun 25 '15 at 00:49