枚举右对齐

枚举右对齐

我怎样才能做这样的枚举:

一些 loresipsum,lores ipsume loresipsum,lores ipsume loresipsum,lores ipsume loresipsum,lores ipsume loresipsum,lores ipsume loresipsum,lores ipsume loresipsum,lores ipsume loresipsum,lores ipsume loresipsum,lores ipsume loresipsum,lores ipsume loresipsum,lores ipsume loresipsum,lores ipsume

            text: some info
        Sometext: some another info
  Somelongertext: an info

loresipsum, lores ipsume loresipsum, lores ipsume loresipsum, lores ipsume loresipsum, lores ipsume loresipsum, lores ipsume loresipsum, lores ipsume loresipsum, lores ipsume loresipsum, lores ipsume loresipsum, lores ipsume loresipsum, lores ipsume loresipsum, lores ipsume

答案1

快速解决方案:

\begin{itemize}
\item[text:] some info
\item[Sometext:] some another info
\item[Somelongertext:] an info
\end{itemize}

但是,如果您不想将项目放在页边距中,则可以使用 tabular 代替。我使用带有列类型的longtabufrom包,以使文本正确换行。但是,它不适合长项目,会产生糟糕的分页符。tabuX

\documentclass{article}
\usepackage{longtable,tabu}
\usepackage{lipsum}
\begin{document}
\lipsum[1]
\begin{longtabu} to \textwidth{@{}rX@{}}
text: & some info \\
Sometext: & some another info \\
Somelongertext: & something very very very very very very very very very very very very very very very very long
\end{longtabu}
\lipsum[2]
\end{document}

在此处输入图片描述

答案2

像这样:

\documentclass{article}
\expandafter\renewcommand\csname @mklab\endcsname[1]{#1\hfil}
\begin{document}
Some loresipsum, lores ipsume loresipsum, lores ipsume loresipsum, lores ipsume loresipsum, lores ipsume loresipsum, lores ipsume loresipsum, lores ipsume loresipsum, lores ipsume loresipsum, lores ipsume loresipsum, lores ipsume loresipsum, lores ipsume loresipsum, lores ipsume 
\begin{enumerate}
\item[ text:] some info
 \item[Sometext:] some another info
\item[Somelongertext:] an info
\end{enumerate}
loresipsum, lores ipsume loresipsum, lores ipsume loresipsum, lores ipsume loresipsum, lores ipsume loresipsum, lores ipsume loresipsum, lores ipsume loresipsum, lores ipsume loresipsum, lores ipsume loresipsum, lores ipsume loresipsum, lores ipsume loresipsum, lores ipsume 
\end{document}

相关内容