I have a piece of code where I'm iterating over a list of items, but I do this in several places and would like to avoid having to redefine that list every time. This is what I have working:
\foreach \f in {193, 87, 88, 85, 80, 81, 79, 89}{
\includegraphics{\f.png}
}
I'd like instead be able to something like this:
\foreach \f in \allfs{
\includegraphics{\f.png}
}
Is there a way to define \allfs such that I can iterate over it? I tried just doing a \newcommand\allfs{{193, 87, 88, 85, 80, 81, 79, 89}} but that doesn't work. It instead looks for the file {193, 87, 88, 85, 80, 81, 79, 89}.png
Sorry if this is a duplicate question, I was having trouble figure out the right way to phrase things to search