答案1
这可能是第一次尝试,还有很大的改进空间。至少现在你可以尝试不同的宽度和颜色设置。
代码如下:
\documentclass{article}
\usepackage{enumitem}
\usepackage{xcolor}
\renewcommand{\descriptionlabel}[1]{%
\hspace{\labelsep}%
\colorbox{yellow}{\textbf{#1}}%
\par
}
\newlist{mydescription}{description}{1}
\setlist[mydescription]{
topsep=2ex,
partopsep=2ex,
itemsep=1ex,
font=\bfseries\color{blue},
labelwidth=3em,
labelsep*=2em,
leftmargin =!,
}
\begin{document}
\begin{mydescription}
\item[G1.] The first item
\item[G2.] The second item
A longish explanation every true mathematician would deem completely unnecessary …
\item[G3.] The third item etc …
\end{mydescription}
\end{document}
输出如下: