So, I'm working with latex for years. I have my own .sty file, and I am trying to make it "clean" and easier to use - even for myself.
One thing that annoys me is when I have to write a subset, for instance
Code: Select all
$$\mathbb C^{x\times y\times z}$$
Code: Select all
\makeatletter
\newcommand{\setf}[1]{%
\@ifnextchar({\setf@i{#1}}{\setf@i{#1}({},{},{})}%
}
\def\setf@i#1(#2,#3,#4){%
\ensuremath{\mathbb #1^{#2\times #3\times #4}
}
}
\makeatother
There is any way to define the "\setf" command such that it accepts (x,y,z) but also (x,y) and perhaps (x)?