枚举前的星号加粗且颜色为 (*)

枚举前的星号加粗且颜色为 (*)

早上好。这是我的问题,在枚举项前添加粗体 (*****) 星号,并且还加了颜色。这是我的代码,

\documentclass[a4paper,twoside,openright,11pt]{scrbook}
\usepackage[left=1.5cm,right=1cm,top=3cm,bottom=1.5cm,marginparwidth=6cm,marginparsep=1cm,outer=8cm]{geometry}

\usepackage[T1]{fontenc}
\usepackage{color}
\usepackage{enumitem}

\newcommand{\ssitem}{\stepcounter{enumii}\item[${ }*{ }$\theenumii)]}
\newcommand{\sitem}{\stepcounter{enumi}\item[${ }*{ }$\theenumi.]}

\renewcommand\theenumi{\textbf{\arabic{enumi}}}
\renewcommand\theenumii{\textbf{\alph{enumii}}}

\setlist[enumerate,2]{font=\bfseries,before=\bfseries,before=\setupmodenumerate}
\setlist[enumerate,1]{font=\bfseries,before=\setupmodenumerate}

\newif\ifcitem

\newcommand{\setupmodenumerate}{%
\global\citemfalse
\let\origmakelabel\makelabel
\def\citem##1{\global\citemtrue\def\cecolor{##1}\item}%
\def\makelabel##1{%
\origmakelabel{\ifcitem\color{\cecolor}\fi##1}%
\global\citemfalse}}

\begin{document}

\begin{enumerate}
\item Black Question
\begin{enumerate}
\item Case \textbf{*}
\item Case
\ssitem No problem in black color
\end{enumerate}
\end{enumerate}

\textbf{Lorem}

\begin{enumerate}[resume]
\citem{blue} Blue Question
\begin{enumerate}
\citem{red} Case
\citem{blue} Problem, no added asterisk
\end{enumerate}
\end{enumerate}

\begin{enumerate}[resume]
\citem{red} Problem, no added asterisk
\end{enumerate}

\end{document}

在此处输入图片描述

添加此代码可以解决问题吗?那么,有人知道如何修复它吗?

有关的:

定义颜色枚举

答案1

为什么要让生活变得复杂?

\documentclass[a4paper,twoside,openright,11pt]{scrbook}
\usepackage[left=1.5cm,right=1cm,top=3cm,bottom=1.5cm,marginparwidth=6cm,marginparsep=1cm,outer=8cm]{geometry}

\usepackage[T1]{fontenc}
\usepackage{color}
\usepackage{bm}
\usepackage{enumitem}

\newcommand{\ssitem}[1][black]{\stepcounter{enumii}\item[\color{#1}$\bm{*}$\,\textbf{\alph{enumii})}]}
\newcommand{\sitem}[1][black]{\stepcounter{enumi}\item[\color{#1}$\bm{*}$\,\textbf{\theenumi}]}

%\renewcommand\theenumi{\textbf{\arabic{enumi}.}}
%\renewcommand\theenumii{\textbf{\alph{enumii}}}

\setlist[enumerate,1]{label=\textbf{\arabic*.}}
\setlist[enumerate,2]{label=\textbf{\alph*)}}

\begin{document}

\begin{enumerate}
\item Black Question
\begin{enumerate}
\item Case \textbf{*}
\item Case
\ssitem No problem in black color
\end{enumerate}
\end{enumerate}

\textbf{Lorem}

\begin{enumerate}[resume]
\sitem[blue] Blue Question
\begin{enumerate}
\ssitem[red] Case
\ssitem[blue] Problem, no added asterisk
\item Case
\end{enumerate}
\end{enumerate}

\end{document}

在此处输入图片描述

相关内容