2

I would like to redesign my enumerate bullets so they just look like Beamer, e.g. square bullets with a dark background (the colour of which I would like to define).

All the answers I found do relate to the itemize environment, but I did not find any answer for the enumerate. Is there an equivalent to the \labelitemi command, but for enumerate ?

  • enumerate does not have bullets, does it? It should be numbers or letters in ascending order... – cauchy42 Sep 16 '15 at 12:33
  • I still call that a bullet, sorry if it's not clear. I would like the number to be written on a square, like in beamer – user64789 Sep 16 '15 at 12:38
  • Ah sorry, I didn't not think far enough... To answer the last part of your question: Yes, there is labelenumi. – cauchy42 Sep 16 '15 at 12:46
1

Try this:

\documentclass{article}

\usepackage{xcolor}

\renewcommand\labelenumi{\fcolorbox{black}{red}{\arabic{enumi}}}

\begin{document}


\begin{enumerate}
\item One
\item Two
\end{enumerate}


\end{document}

EDIT: Changed to \arabic, then the boxes have the same width, at least for 1 and 2... :)

| improve this answer | |
  • You can also add \color{white} (for example) inside the braces. – John Kormylo Sep 16 '15 at 16:32
1

No square boxes so far, but coloured.

Rather than to manipulate the \labelenumi macro, it's perhaps better to define a cloned list of enumerate using the enumitem package and set coloured background and foreground as label=... (see the example)

\documentclass{article}

\usepackage{xcolor}
\usepackage{enumitem}


\newlist{mycolourenumerate}{enumerate}{4}

\setlist[mycolourenumerate,1]{label={\colorbox{red!20!black}{\color{white}\arabic*}}}


\begin{document}

\begin{mycolourenumerate}
  \item First
  \item 
  \item
  \item 
  \item
  \item 
  \item
  \item 
  \item
  \item 
  \item
  \item 
  \item
\end{mycolourenumerate}


\end{document}

Some improved version

\documentclass{article}

\usepackage{ragged2e}
\usepackage{xcolor}
\usepackage{enumitem}
\usepackage{fmtcount}


\newlist{mycolourenumerate}{enumerate}{4}

\setlist[mycolourenumerate,1]{label={\makebox(\labelwidth,\labelwidth)[r]{\detokenize\colorbox{red!20!black}\hfill\color{white}\strut\arabic*}}}

\newlength\bulletboxwidth
\setlength\bulletboxwidth{12pt}

\newcommand{\bulletbackgroundcolour}{red!20!yellow}
\newcommand{\bulletforegroundcolour}{blue}

\setlist[mycolourenumerate,1]{label={\colorbox{\bulletbackgroundcolour}{\parbox[c][\bulletboxwidth][c]{\bulletboxwidth}{\protect\raggedleft\color{\bulletforegroundcolour}\strut\bfseries\arabic*}}}}

\setlist[mycolourenumerate,2]{label={\colorbox{\bulletbackgroundcolour}{\parbox[c][0.8\bulletboxwidth][r]{0.8\bulletboxwidth}{\protect\raggedright\color{\bulletforegroundcolour}\strut(\alph*)}}}}


\begin{document}

\begin{mycolourenumerate}
  \item \Ordinalstring{mycolourenumeratei}
  \item \Ordinalstring{mycolourenumeratei}
  \item \Ordinalstring{mycolourenumeratei}
  \item \Ordinalstring{mycolourenumeratei}
  \item \Ordinalstring{mycolourenumeratei}
  \item \Ordinalstring{mycolourenumeratei}
  \item \Ordinalstring{mycolourenumeratei}
  \item \Ordinalstring{mycolourenumeratei}
  \item \Ordinalstring{mycolourenumeratei}
  \item \Ordinalstring{mycolourenumeratei}
  \item \Ordinalstring{mycolourenumeratei}
  \item \Ordinalstring{mycolourenumeratei}
  \item \Ordinalstring{mycolourenumeratei}
  \item \Ordinalstring{mycolourenumeratei}
  \item \Ordinalstring{mycolourenumeratei}
  \item \Ordinalstring{mycolourenumeratei}
  \item \Ordinalstring{mycolourenumeratei}
  \item \Ordinalstring{mycolourenumeratei}
    \begin{mycolourenumerate}
    \item Other level
    \end{mycolourenumerate}
  \item \Ordinalstring{mycolourenumeratei}
  \item \Ordinalstring{mycolourenumeratei}
\end{mycolourenumerate}


\end{document}

enter image description here

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy