如何创建文本在右侧刷新的列表环境

如何创建文本在右侧刷新的列表环境

我想创建一个列表环境,其中描述列表上每个项目的文本位于右侧并居中,形成一种框。以下是我想要的代码

      \begin{verbatim}
       -item 1: a very interesting text, with
                lots of words, all on the right
                inside this box
       
       -item 2: another very insteresting text,
                with lots of complicated words,
                all align on the right
       
       -item 3: a very interesting text, with
                lots of words, all on the right
                inside this box
       
       -item 4: another very insteresting text,
                with lots of complicated words,
                all align on the right
       \end{verbatim}

这是文本的图片在此处输入图片描述

请尽量使用您能想到的最简单的代码。我不太擅长使用 LaTex。如果这只能通过某些软件包来实现,请向我解释如何调整项目的宽度以及每个项目上的文本可以占用的空间,谢谢。

答案1

像这样?

在此处输入图片描述

\documentclass{report}
\usepackage{enumitem}

\begin{document}
\begin{enumerate}[label={-item \arabic*:},left=0cm]\raggedright
\item a very interesting text, with
lots of words, all on the right
inside this box

\item another very insteresting text,
with lots of complicated words,
all align on the right

\item  a very interesting text, with
lots of words, all on the right
inside this box

\item  another very insteresting text,
with lots of complicated words,
all align on the right
\end{enumerate}
\end{document}

相关内容