I'm looking for best practise w.r.t. double sub/superscripts. I have a bunch of macros to denote certain subclasses, the x-component, the nth order, the outside value, etc. I would like them to be able to use them independently, in arbitrary order. At first I had macros like
\documentclass{article}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\begin{document}
\newcommand{\x}[1]{{#1}_x}
\newcommand{\n}[1]{{#1}_n}
\newcommand{\additive}[1]{{#1}^\text{a}}
\newcommand{\out}[1]{{#1}^*}
$\x{\out{\additive{\n{B}}}}$
\end{document}
But that bunches things up terribly:

Removing the curly braces
\documentclass{article}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\begin{document}
\newcommand{\x}[1]{#1_x}
\newcommand{\n}[1]{#1_n}
\newcommand{\additive}[1]{#1^\text{a}}
\newcommand{\out}[1]{#1^*}
$\x{\out{\additive{\n{B}}}}$
\end{document}
This displays correctly:

However it gives me a double superscript error. I don't mind double superscripts; on the contrary, that's what I'm going for (unless someone has a better notation suggestion, I know it's congested, but it's a long document with many intricacies...)! I know I can do this manually, but is there a way to have any arbitrary order of such macros produce the latter result without error?
Thanks.

\zz{B}{\additive\out\n\x}would be a lot easier for example. – David Carlisle Feb 21 '17 at 16:21\newcommand{\Bax}{\x{\additive{B}}}and then I use that often because I don't want to have to type the whole thing, but sometimes I take components of that, so I want to be able to do\n{\Bax}. I don't quite understand your suggestion with\zz. – bjorne Feb 21 '17 at 16:28\zzwas just a made up name that you would replace by some more semantic name. But it is easier if you have a "container" macro as then you know when you have finished so can close any opened groups etc. with it as it is,\ncan do essentially_\bgroup nso a following\xcan be in the same subscript, but it is hard to know when to close the group as you don't have any distinguished macro for the whole construct. – David Carlisle Feb 21 '17 at 16:35\x\additive\n\out \zz{B}would just flush the list of sub/superscripts ontoB? That way I wouldn't have to nest but would still be able to add one extra term to composite macros. Or is that too procedural? – bjorne Feb 21 '17 at 16:47