I'm curious how to automatically get a bit of spacing around symbols that are written together.
Let us assume we have symbols A and B that represent some abstract objects.
We define commands \A and \B that insert the symbols.
\newcommand\A{\mathrm{A}}
\newcommand\B{\mathrm{B}}
Now I would like to have a bit of space between these symbols when written together with other symbols. Unfortunately, with the above definitions, it is necessary to add these spaces explicitly.

How can I get the extra spacing automatically? It is especially important that not just a static amount of space is added, to prevent extra spaces between equal signs and the symbols, and between repeated symbols.
The MWE that produced above output:
\documentclass[preview,border=10pt,fleqn]{standalone}
\usepackage{amsmath}
\setlength\mathindent{0pt}
\newcommand\A{\mathrm{A}}
\newcommand\B{\mathrm{B}}
\begin{document}
Symbols with no spacing \eqref{nospaces},
explicit \texttt{\textbackslash,} spaces \eqref{spaces}.
\begin{align}
\label{nospaces}
y &= \A x &
y &= x' \A x &
\B &= \A \A &
\B &= \A' \A
\\
\label{spaces}
y &= \A \, x &
y &= x' \, \A \, x &
\B &= \A \, \A &
\B &= \A' \, \A
\end{align}
\end{document}


\mathbf{A}\,\mathbf{B}be preferred to the normal\mathbf{A}\mathbf{B}in the first place? – egreg Sep 28 '14 at 21:05