Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

How can I do enumeration like this:

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

            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

share|improve this question
2  
Are you sure you don't want to use a description environment instead? –  Martin Scharrer Feb 14 '11 at 15:29

2 Answers 2

up vote 5 down vote accepted

A quick solution:

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

But if you want the items not to be put in the margins, you can use a tabular instead. I use longtabu from tabu package with column type X, to make the text wrapping properly. However, it is not suitable for long items, that produce bad page breaks.

\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}

enter image description here

share|improve this answer
    
The second option is that exactly what I wanted to get. Thx! –  sivy Feb 14 '11 at 15:34

Something like this:

\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}
share|improve this answer
3  
It would be nice if you could add some explanation and not just the code alone. Also, please put a space between \csname and @mklab, then it is easier to read and will also work when the code is used in a place where @ is a letter, e.g. inside a package. –  Martin Scharrer Feb 14 '11 at 15:25

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.