答案1
这是创建此类彩色列表的方法。最终,您可能希望将其与 结合使用enumitem
,但由于您未提供任何代码,因此这是一个非常基本的版本。
\documentclass{article}
\usepackage{circledsteps}
\usepackage{pgf}
\pgfkeys{/csteps/enumerate colors/.initial={"red","green!70!black","blue","orange","cyan",
"magenta","teal","purple"}}
\renewcommand{\labelenumi}{%
\pgfmathtruncatemacro{\mydim}{dim({\pgfkeysvalueof{/csteps/enumerate colors}})}%
\ifnum\value{enumi}>\mydim
\textsf{\arabic{enumi}}%
\else
\pgfmathsetmacro{\mycolor}{{\pgfkeysvalueof{/csteps/enumerate colors}}[\value{enumi}-1]}%
\Circled[inner color=white,fill color=\mycolor,outer color=\mycolor]{\textsf{\arabic{enumi}}}%
\fi}
\begin{document}
\begin{enumerate}
\item text
\item text
\item text
\item text
\end{enumerate}
\end{document}
颜色存储在键中/csteps/enumerate colors
。
答案2
您必须定义颜色,如 MWE 中所示。如果枚举项超过 9 个,则会超出圆(子弹)直径。
\documentclass{article}
\usepackage{stackengine,xcolor,enumitem}
\newcommand\circnum[1]{\stackinset{c}{}{c}{.1ex}{\small\textcolor{white}{#1}}%
{\abovebaseline[-.7ex]{\Huge\textcolor{\csname colenum#1\endcsname}{$\bullet$}}}}
\csdef{colenum1}{red}
\csdef{colenum2}{blue}
\csdef{colenum3}{cyan}
\csdef{colenum4}{orange}
\csdef{colenum5}{green!70!black}
\begin{document}
\begin{enumerate}[label=\protect\circnum{\theenumi}]
\item first
\item next
\item third
\item fourth
\item last
\end{enumerate}
\end{document}