我如何调整此代码以在 documentclass{book} 中进行垂直枚举?

我如何调整此代码以在 documentclass{book} 中进行垂直枚举?
\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

此答案基于https://tex.stackexchange.com/a/50452/90297

与您的 MWE 的区别:

  1. 按要求使用了书籍文档类。
  2. newcommand像旧答案中那样将 圈出。

与上一个答案的区别:

  1. 请注意,与原来不同,这里您可以将两个参数放入按钮中,从而可以在不同的级别/列表中使用不同的颜色。
  2. 使用与 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}

相关内容