I want to check if there are more elements in a foreach loop. How can this be done?
This is an example for loop:
\foreach \p/\q in {a/{1,2,3}, b/{4,5,6}}
\foreach \r in \q { (\r) }
EDIT#1
An example of code in a programming language for what I want to achieve would be:
a = [3,4,5,6]
for i, val in enumerate(a):
print(val, sep='', end='')
if i < len(a)-1:
print(',', sep='', end='')
Hope that helps to clarify.
\foreach
or even mentionpgf
), but I am pleased you now have a useful answer.$sep$
just before the\and
in your Pandoc template seems to do the job. At least, that worked with my simple test.