\documentclass[border=10pt,tikz,x11names]{standalone}
\usepackage[outline]{contour}
\usetikzlibrary{shadows}
\begin{document}
\begin{tikzpicture}[button/.style 2 args={
circle,
minimum size=0.75cm,
top color=#1!30!white,
bottom color=#1,
draw=#1!90!black,
thick,
append after command={
node[circle,draw=#1!90!white,
minimum size=0.68cm,
font=\sffamily]at(\tikzlastnode.center)
{\textcolor{white}{\contour{#1}{#2}}}
},
general shadow={
shadow xshift=.2ex, shadow yshift=-.2ex,
opacity=.5, fill=black!50,
}
}]
\foreach \buttoncolor[count=\i] in {red,
DarkOrange1,Goldenrod1,Green3,blue!50!cyan,DarkOrchid2}
\node[button={\buttoncolor}{\i}] at (\i, 0){};
\foreach \buttoncolor[count=\xi,evaluate=\xi as \i using int(13-\xi)] in
{Azure2,gray!25!white,Snow3,Snow4,black!80!white,black}
\node[button={\buttoncolor}{\i}] at (\xi, -1){};
\end{tikzpicture}
\begin{itemize}
\item 54
\end{itemize}
\end{document}
- 1,634
1 Answers
This answer is based on https://tex.stackexchange.com/a/50452/90297 .
The difference from your MWE:
- Used the book document class as requested.
- Put the circled in a
newcommandas in the old answer.
Differences from previous answer:
- Notice that unlike the original, here you can take two parameters into your button, enabling you to use different colors in different levels/lists.
- Used contour and shading as in MWE.
MWE:
\documentclass{book}
\usepackage{tikz}
\usetikzlibrary{shadows}
\usepackage[outline]{contour}
\newcommand*\circled[2]{
\tikz[
baseline=(char.base)
]{%
\node[shape=circle,
minimum size=0.75cm,
top color=#1!30!white,
bottom color=#1,
draw=#1!90!black,
append after command={
node[circle,draw=#1!90!white,
minimum size=0.68cm,
font=\sffamily]at(\tikzlastnode.center)
{\textcolor{white}{\contour{#1}{#2}}}
},
thick,
general shadow={
shadow xshift=.2ex, shadow yshift=-.2ex,
opacity=.5, fill=black!50,
}
] (char) {#2};}}
\usepackage{enumitem}
\usepackage{xcolor}
\begin{document}
\begin{enumerate}[label=\protect\circled{red}{\arabic*}]
\item Step one%
\item Step two%
\item Step three%
\end{enumerate}
\end{document}
- 3,941
\node[button={\buttoncolor}{\i}] at (0, -\i){};instead of\node[button={\buttoncolor}{\i}] at (\i, 0){};should result in a vertical aligment. – leandriis Aug 04 '20 at 19:44