Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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

share|improve this question
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? –  Hans-Peter E. Kristiansen Mar 22 at 10:13

2 Answers 2

up vote 16 down vote accepted

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

share|improve this answer
1  
Very beautiful! –  Uwe Ziegenhagen Mar 22 at 11:22
1  
I agree with Uwe. It's really beautiful. –  Gonzalo Medina Mar 22 at 14:11
    
Thanks Uwe, Gonzalo :) –  Claudio Fiandrino Mar 22 at 14:27
\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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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