I am trying to iterate over a list, the delimiter of which is not a comma. The reason for not using commas as delimiters is that they are part of the payload. Is there a way to iterate over a list in which the delimiter is a semicolon (or any other delimiter)?
So far, I have tried
\documentclass{article}
\makeatletter
\newcommand{\ls}[1]{\@for\tmp:=#1 \do{\tmp}}
\makeatother
\begin{document}
\ls{(a,b);(c,d)}
\end{document}
Hence, I'd like to loop over the tuples separated by the semicolon, i.e. (a,b) and (c,d).
Edit: I was also trying to find some documentation on \@for
, but I was not able to find any.
etoolbox
\@for
is part of the latex format sotexdoc source2e
If you want to use\@for
and a comma you can hide inner commas in{}
so\ls{{a,b},{c,d}}
would iterate over the two pairs