I would like to be able to define a macro like \newcommand{\Zs}{Z^*}
and then somewhere within the text say $\Zs^T$
and have the effect of writing $Z^{* T}$
. It should also be possible to write $\Zs$
without the subscript. Is there a simple solution to make this possible? Preferably, the solution should allow one to do this for many symbols with relative ease.
I guess one way is to define a macro with an argument like \newcommand{\Zss}[1]{Z^{* #1}}
and the use either $\Zss{}$
or $\Zss{T}$
, but this does not seem very elegant.
Can we define a blueprint command, called starred
so that whenever we want a starred symbol, we can write \newcommand\Xs{\starred{X}}
?
Best Answer
You have to be disciplined and write, if a subscript is needed,
Here's the code:
The same with LaTeX3: