In Latex, I always use \mathbb{something0}_{something1}^{something2}
, wheres sometimes 'something1' or 'something2' can be empty. So I had the idea to create a newcommand using the \newcommand. So I tried a lot. I wanna know if is possible to create a command such that
if I use \mb{R}
it's print \mathbb{R}
;
if I use \mb[+]{R}
it's print \mathbb{R}_{+}
;
if I use \mb[n][+]{R}
it's print \mathbb{R}_{+}^{n}
.
Or a newcommand that do something like that.
This is one of my attempts:
\newcommand{\mb}[3][ ]{\mathbb{#3}_{#2}^{#1}}
but when I try \mb[n][+]{R}
the command only print \mathbb{R}^b+
.
Thanks