通常,我们在一些演示文稿中经常看到数字按钮,非常精致,让文本展示更为条分缕析,如下图所示,那么我们怎么用Tikz来制作类似的按钮呢? num-button   代码如下:

\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}
选自:http://tex.stackexchange.com/questions/167013/make-enumerated-button-in-tikz

点赞(0)

评论列表 共有 0 条评论

暂无评论
立即
投稿

微信公众账号

微信扫一扫加关注

发表
评论
返回
顶部