4

Let us consider the following MWE:

\documentclass{article}

\usepackage{tikz}

\newcommand*\circled[1]{\tikz[baseline=(char.base)]{%
            \node[shape=circle,fill=blue!20,draw,inner sep=2pt] (char) {#1};}}

\usepackage{enumitem}

\begin{document}

\begin{enumerate}[label=\protect\circled{\arabic*}]
\item Step one
\item Step two
\item Step three
\end{enumerate}

\end{document}

How can we force the bullet to be automatically on two digits, ie "01", "02", "03", ...,"10".

Thanks for your help

1 Answer 1

6

Just use \int_compare:nNnTF and do not forget to add ~ between inner and sep.

\documentclass{article}

\usepackage{tikz}

\ExplSyntaxOn
\newcommand*\circled[1]{\tikz[baseline=(char.base)]{%
            \node[shape=circle,fill=blue!20,draw,inner~sep=2pt] (char)
            {
              \int_compare:nNnTF {#1} < { 10 }
                { 0#1 }
                { #1 }
            };}}
\ExplSyntaxOff
\usepackage{enumitem}

\begin{document}

\begin{enumerate}[label=\protect\circled{\arabic*}]
\item Step one
\item Step two
\item Step three
\item Step four
\item Step five
\item Step six
\item Step seven
\item Step eight
\item Step nine
\item Step ten
\item Step eleven
\end{enumerate}

\end{document}
2
  • Thx a lot Stephen! That's perfect Commented Jul 14, 2023 at 16:26
  • You’re welcome:-)
    – Stephen
    Commented Jul 14, 2023 at 16:40

You must log in to answer this question.

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