# Putting a Code to the Right of an Item in a New Enumerate Environment

Consider

I would like to present the string of 12 colored bullets a little to the right of the enumerated tcolorbox and vertically centered.

The code which produces the above picture is

\documentclass{article}
\usepackage{xcolor}
\usepackage{lipsum}
\usepackage{multicol}

\setlength{\columnsep}{1cm}
\usepackage{scalefnt}
\usepackage{xcolor}
\usepackage{amssymb}

% % The colored box that encloses the item number.
\usepackage{tcolorbox}
\newtcbox{\logo}{nobeforeafter, notitle, %sharpcorners,
colframe=red,
colback=red!35,
top=0pt,
left=0pt,
right=0pt,
bottom=0pt,
fontupper=\sffamily\bfseries,
tcbox raise base}

% % FANCY ENUMERATE positioning the enumerated colored box above the text.
\newcounter{cenum}
\newcommand\cenumsep{}
\newenvironment{cenumerate}{%
\setcounter{cenum}{0}%
\setlength\parskip\bigskipamount
%  \begin{center}%
}{%
%  \end{center}%
}
\newcommand\citem{%
\refstepcounter{cenum}%
\par\cenumsep\logo{\arabic{cenum}}%
\par\nobreak\vskip-\parskip\medskip\noindent\ignorespaces% \medskip is the distance between label and text, change as needed
}

% NEW SYMBOLS DEFINITION
\newcommand{\red}{\textcolor{red}{{\scalefont{1.0}{\bullet}}}}
\newcommand{\blue}{\textcolor{blue}{{\scalefont{1.0}{\bullet}}}}

\begin{document}
\large

$\red\blue\red\blue$ $\blue\red\blue\blue$ $\red\red\red\blue$

\begin{multicols}{2}
\begin{cenumerate}
\citem \lipsum[4]
\end{cenumerate}
\end{multicols}
\end{document}


I have tried replacing \citem with \citem[$\red\blue\red\blue$ $\blue\red\blue\blue$ $\red\red\red\blue$], and also placing $\red\blue\red\blue$ $\blue\red\blue\blue$ $\red\red\red\blue$ to the right of \citem but neither of these produce what I am looking for.

QUESTION: How may I modify the above code so that I can place a uniquely colored binary string of colored bullets to the right of each enumerated item in a "fancy" listing such as this in the manner described?

Thank you.


\end{cenumerate}
\end{multicols}
\end{document}

• Thank you for posting your answer. For some reason, the system did not notify me that your answer had been posted. Regarding your answer, how may the header, side-margin, and text boxes be eliminated. I'm not sure why they are there. Sep 21 '21 at 0:48
• I just figured out why the frames are being displayed. Thanks again. Sep 21 '21 at 0:52
• Thank you for this most helpful answer. Sep 21 '21 at 1:49
• @mlchristians Sorry I did not mention showframe Sep 21 '21 at 13:01
• No problem. It didn't take me long to figure it out once I took a closer look at the code. Thanks again for your answer. Sep 21 '21 at 13:28