使用 enumitem 右对齐

使用 enumitem 右对齐

我有以下包裹清单enumitem

\begin{flushright}
\begin{description}[font=\color{black},before=\color{blue},nosep]
\item[Item:] some text some text some text
\item[Another item:] some text
\item[Very long item:] some text some text
\item[Short item:] some text some text some text
\item[Item:] some text some text
\end{description}
\end{flushright}

除了环境之外,一切都运行正常flushright。我想要一个右对齐的描述列表,我的意思是所有行(每个项目中的标签和正文)都与右边距对齐。我该如何使用enumitem包来实现?还是我需要另一个包?

在此处输入图片描述

答案1

在此处输入图片描述

\documentclass{article}
\usepackage{enumitem,xcolor}
\usepackage{showframe}
\begin{document}
\begin{description}[font=\color{black},before=\color{blue},nosep]
  \raggedleft                           %% put this here
  \item[Item:] some text some text some text
  \item[Another item:] some text
  \item[Very long item:] some text some text
  \item[Short item:] some text some text some text some text some text some text some text some text some text some text some text some text
  \item[Item:] some text some text
\end{description}
\end{document}

相关内容