2

Consider the MWE

\documentclass{article}
\usepackage{tcolorbox}
\usepackage{scalefnt}
\usepackage{xcolor}
\usepackage{lipsum}

\newtcbox{\logo}{nobeforeafter, notitle, %sharpcorners,
    colframe=blue,
    colback=blue!30,
    fontupper=\sffamily\bfseries,
    tcbox raise base}

\begin{document}

\Large
\begin{enumerate}
\item I would like to have LateX automatically replace the default item number by $\logo{1}$
\\[10pt]
\item I would like to have LateX automatically replace the default item number by $\logo{2}$
\\[10pt]
\item I would like to have LateX automatically replace the default item number by $\logo{3}$
\\[10pt]
\item And so on \ldots\
\end{enumerate}
\end{document}

which produces the output

enter image description here

QUESTION: I would like to replace the default enumerate item numbers 1., 2., 3., ... by the enumerated tcolorbox logos as shown. How may I accomplish this?

Thank you.

1 Answer 1

1

With the enumitem package and \begin{enumerate}[label=\logo{\arabic*}]:

enter image description here

\documentclass{article}

\usepackage{enumitem}

\usepackage{tcolorbox}
\usepackage{scalefnt}
\usepackage{xcolor}
\usepackage{lipsum}

\newtcbox{\logo}{nobeforeafter, notitle, %sharpcorners,
    colframe=blue,
    colback=blue!30,
    fontupper=\sffamily\bfseries,
    tcbox raise base}


\begin{document}
\Large
\begin{enumerate}[label=\logo{\arabic*}]
\item I would like to have LateX automatically replace the default item number by $\logo{1}$
\\[10pt]
\item I would like to have LateX automatically replace the default item number by $\logo{2}$
\\[10pt]
\item I would like to have LateX automatically replace the default item number by $\logo{3}$
\\[10pt]
\item And so on \ldots\
\end{enumerate}

\end{document}
3
  • In your code, may I presume that the a beneath \Large should be replaced by \begin{enumerate}[label=\logo{\arabic*}]?
    – DDS
    Commented Sep 17, 2021 at 14:41
  • @Garfunkel: Thanks for making me aware of this copy-past-error. I have corrected my answer accordingly.
    – leandriis
    Commented Sep 17, 2021 at 14:58
  • Thank you for this very helpful answer.
    – DDS
    Commented Sep 17, 2021 at 16:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .