When trying to nest \url
or \path
within a for-each loop (not to be confused with TikZ paths), the text from the loop is not printed:
MWE:
\documentclass{article}
\usepackage{pgffor}
\usepackage[obeyspaces]{url}
\begin{document}
\providecommand{\test}{}%
\foreach \x in {%
folder1/part_1,
folder2/part_2%
}{
\gdef\test{\path{\x}}%
\test}
\end{document}
Output:
\x \x
Desired Output:
folder1/part_1
folder2/part_2
I have nested the output within a command for use elsewhere for another function (but the problem exists even without using commands).
\x
plus you need to expand\x
inside\path