Consider the MWE
\documentclass{article}
\textheight 8.25in \textwidth 4.75in
\usepackage{scalefnt}
\usepackage{amsmath,amssymb}
%\blacksquare\hspace*{.7em}
\usepackage{stackengine,xcolor,lipsum}
\let\svitem\item
\newcommand\difbox[1]{\stackengine{0pt}{\color{white}\rule{5ex}{1.15ex}}{%
$\iftrue\makeballs#1\fi$}{O}{c}{F}{F}{L} }
\def\makeballs#1#2\fi{\fi\ifx R#1\textcolor{red}{\blacksquare}\else
\ifx B#1\textcolor{blue!35}{\blacksquare}\fi\fi%
\ifx\relax#2\relax\else\makeballs#2\fi}
\newenvironment{benumerate}
{\renewcommand\item[1][1]{\def\difficulty{##1}\svitem}%
\def\labelenumi{\smash{\stackunder[5pt]{\color{blue!65!black}%
\bfseries\sffamily\theenumi}{\expandafter\difbox\expandafter{\difficulty}}}}%
\enumerate}{\endenumerate}
\begin{document}
\large
\begin{benumerate}
\setcounter{enumi}{0}
\item[RBRRBR] \lipsum[11]
\item[RRR] \lipsum[39]
\item[BRRRB] \lipsum[13]
\end{benumerate}
\end{document}
with output
I would like to widen the gap between the colored squares; but when I replace both instances of \blacksquare
with \blacksquare\hspace*{.7em}
---I get the extra spacing I want, but relative to the above enumeration, the new horizontal stack appears to be non-aligned; i.e., not lying centered beneath the above number, as follows:
Now, the alignment in the first output is not perfect, but reasonably accurate. However, the alignment in the second output is clearly not centered beneath the corresponding number.
QUESTION: How may I increase the gap between the colored boxes of the original output so that the horizontal stack of colored squares lies reasonably centered below the upper number?
Thank you.