I have a problem with foreach loop. When I pass parameters as list with '/' used as separator it works really well. However when any element in that list is defined with \def the separator seems to not work and the strings are concatenated.
\newcommand{\testme}[1]{
\foreach \aa/\bb in {#1} {
|\aa| |\bb| \newline
}
}
\def\testmedef{{xyz}/{XYZ}}
\testme{
{abc}/{CDE},
\testmedef%
}
Result:
|abc|CDE|
|xyz/XYZ|xyz/XYZ|
Thank you for your kind help!
which is probably the best in this case as long as the inner content is unexpandable https://tex.stackexchange.com/a/648813/250119 ■ Or use
ExpandArgspstricks - How do I have to invoke \expandafter for a macro with multiple arguments? - TeX - LaTeX Stack Exchange – user202729 Jul 13 '22 at 01:41%at exactly the wrong locations. See symbols - What is the use of percent signs (%) at the end of lines? (Why is my macro creating extra space?) - TeX - LaTeX Stack Exchange and the linked question – user202729 Jul 13 '22 at 01:43