9

Is it possible to make an enumerated button, similar to the ones shown in the figure below? I will be using them as pictures in an external document (not TeX).

enter image description here

  • 4
    Yes it is possible. How far are you? Can you post your code, so it can be used as a starting point for those who wish to help you? What conceptual problems do you have? – hpekristiansen Mar 22 '14 at 10:13
16

Another approach:

\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}

\end{document}

The result:

enter image description here

| improve this answer | |
7
\documentclass[tikz,border=10pt]{standalone}
\usepackage[lining]{libertine}
\usetikzlibrary{shadows}
\begin{document}
\foreach \x/\Color in {1/red,2/red!50,3/orange,4/blue!50!green,5/blue}{
  \begin{tikzpicture}
    \fill[gray!20] (0.02,-0.03) circle (0.5cm);
    \node[circle,minimum width=1cm,text=white,fill=\Color,font=\sffamily] at (0,0) {\x};
    \draw[line width = 0.2pt,white!50!black] (0,0) circle (0.475cm);
  \end{tikzpicture}
}
\foreach \x/\Color in {11/black!20,12/black!40,13/black!60,14/black!80,15/black}{
  \begin{tikzpicture}
    \fill[gray!20] (0.02,-0.03) circle (0.5cm);
    \node[circle,minimum width=1cm,text=white,fill=\Color,font=\sffamily] at (0,0) {\x};
    \draw[line width = 0.2pt,white!50!black] (0,0) circle (0.475cm);
  \end{tikzpicture}
}
\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

Not the answer you're looking for? Browse other questions tagged or ask your own question.