I want to repurpose a predefined comma separated list multiple times in the document. As a minimal example, have a look at the following code which does not work as expected:
\documentclass{article}
\usepackage{xparse}
\newcommand*{\listtotestA}{
A,
B,
C
}
\def\listtotestB{
D,
E,
F
}
\ExplSyntaxOn
\NewDocumentCommand \teslist{m}{
\clist_map_inline:nn{#1}{
Output: ##1 \\
}
}
\ExplSyntaxOff
\begin{document}
\teslist{\listtotestA}
\\
\teslist{\listtotestB}
\end{document}
Instead of
Output: A
Output: B
Output: C
Output: D
Output: E
Output: F
It produces
Output: A,B,C
Output: D,E,F
What am I missing?
\clist_map_inline:on {#1}{...}
or\clist_map_inline:Vn {#1}{...}