Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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

share|improve this question
    
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
    
Welcome to TeX.SE. –  Peter Grill Feb 27 at 19:02
    
Thank you very much that worked perfectly –  Edwin Kutas Feb 27 at 19:03

1 Answer 1

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

enter image description here

Code:

\documentclass{article}

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.