答案1
另一个解决方案:
\documentclass[12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[frenchb]{babel}
\usepackage{enumitem}
\usepackage{xcolor}
\newcommand\twodigits[1]{%
\ifnum#1<10 0\number#1 \else #1\fi
}
\begin{document}
\begin{enumerate}[label=\fcolorbox{black}{black!15}{\scriptsize H-\protect\twodigits{\arabic*} :}, leftmargin=1.5cm,itemsep=1pt,labelsep=1cm]
\item Coucou\\
test
\item Coucou\\
\hspace*{-1cm}test1
\item Coucou
\item Coucou
\item Coucou
\item Coucou
\item Coucou
\item Coucou
\item Coucou
\item Coucou
\item Coucou
\item Coucou
\end{enumerate}
\end{document}
答案2
尝试
\documentclass{article}
\usepackage{enumitem}
\begin{document}
\begin{enumerate}[label*=\protect\fbox{\arabic{enumi}}]
\item How are you?
\item Thank you! I'm fine.
\end{enumerate}
\end{document}
附录: 根据您的评论,看看这是否是您想要的:
\documentclass{article}
\usepackage{enumitem}
\usepackage{lipsum}
\begin{document}
\begin{enumerate}[leftmargin=0pt,
labelindent=1.5em,
label*=\protect\fbox{\arabic{enumi}},labelwidth=*]
\item \lipsum[2]
\lipsum[2]
\end{enumerate}
\end{document}