I've looked all over and can't seem to find a succinct answer to this question. Is it possible (and if so, how) to create a command that will iterate through its `arguments' of comma-separated values and act upon them?
Example mostly stolen from "For loop" in newcommand:
\newcommand{\pdfappendix}[1]{
for \image in #1
{
\includegraphics[scale=0.6]{\image.pdf}
}
}
The goal here is to create a command that can print a file menu structure (or some arbitrary path) like so:
\ppath{Command,TeXing Options,Generate PDF (C-c C-t C-p)}
potentially with an optional argument for a delimiter (defaulting to \to
or something)
which would produce
Command -> TeXing Options -> Generate PDF (C-c C-t C-p)
In the words of holy ed
, ?
Best Answer
etoolbox
's list processing capabilities are straight forward:The separator
\nextitem
is defined to do nothing during its first use.\do
defines how each item is processed, while\docsvlist
processes a comma-separated list. See Cunning (La)TeX tricks for a short discussion on the use of\nextitem
.