考虑 MWE
\documentclass{article}
\usepackage{tcolorbox}
\usepackage{scalefnt}
\usepackage{xcolor}
\usepackage{lipsum}
\newtcbox{\logo}{nobeforeafter, notitle, %sharpcorners,
colframe=blue,
colback=blue!30,
fontupper=\sffamily\bfseries,
tcbox raise base}
\begin{document}
\Large
\begin{enumerate}
\item I would like to have LateX automatically replace the default item number by $\logo{1}$
\\[10pt]
\item I would like to have LateX automatically replace the default item number by $\logo{2}$
\\[10pt]
\item I would like to have LateX automatically replace the default item number by $\logo{3}$
\\[10pt]
\item And so on \ldots\
\end{enumerate}
\end{document}
产生输出
问题:我想用如图tcolorbox
所示的枚举徽标替换默认枚举项目编号 1.、2.、3.、...。我该如何实现?
谢谢。
答案1
随附enumitem
包装和\begin{enumerate}[label=\logo{\arabic*}]
:
\documentclass{article}
\usepackage{enumitem}
\usepackage{tcolorbox}
\usepackage{scalefnt}
\usepackage{xcolor}
\usepackage{lipsum}
\newtcbox{\logo}{nobeforeafter, notitle, %sharpcorners,
colframe=blue,
colback=blue!30,
fontupper=\sffamily\bfseries,
tcbox raise base}
\begin{document}
\Large
\begin{enumerate}[label=\logo{\arabic*}]
\item I would like to have LateX automatically replace the default item number by $\logo{1}$
\\[10pt]
\item I would like to have LateX automatically replace the default item number by $\logo{2}$
\\[10pt]
\item I would like to have LateX automatically replace the default item number by $\logo{3}$
\\[10pt]
\item And so on \ldots\
\end{enumerate}
\end{document}