# Variable number of arguments for newcommand, to create a set containing all of them

I am relatively new to LaTeX and I am trying to come up with a way of a creating a command, call it \Set, such that

\Set{#1,#2, #3, ... #N} outputs \tau_{#1} = \{ #2, #3, ... #N \}


Any help would be appreciated, thanks

-
How about an interface that matches \Set{#1}{#2,#3,#4,...,#N}? –  Werner Feb 27 at 18:58
I will try that, thanks –  Edwin Kutas Feb 27 at 18:59
–  Peter Grill Feb 27 at 19:02
Thank you very much that worked perfectly –  Edwin Kutas Feb 27 at 19:03

I would recommend just using two parameters where #1 is the set name and #2 is the members of the set:

## Code:

\documentclass{article}

\newcommand{\Set}[2]{%
\tau_{#1} = \{#2\}%
}
\begin{document}
$\Set{X}{A,B,C,D}$
\end{document}

-