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.

With \item[keyword]explanation-that-goes-on-for-several-lines I get:

keyword this is the first line
    this is the second line

But I'd like it like this

keyword this is the first line
        this is the second line

I also tried with tabular, but then it didn't do line breaks at all!

share|improve this question
    
i haven't got time to test it now, but it seems to me that (assuming you have multiple definitions) you could pick the longest term being defined and apply \settowidth to determine the magnitude of the indent. –  barbara beeton Jul 27 '12 at 15:07
add comment

1 Answer 1

up vote 3 down vote accepted

You need to make sure that \labelwidth is large enough to contain the widest label in the list.

\documentclass{article}
\begin{document}
\begin{list}{}{}
\item[keyword that is much too long] The quick brown fox jumps over
  the lazy dog. The quick brown fox jumps over the lazy dog. The quick
  brown fox jumps over the lazy dog.
\end{list}
%
\begin{list}{}{\setlength\labelwidth{5cm}\setlength\leftmargin{5cm}\advance\leftmargin by \labelsep}
\item[keyword that is much too long] The quick brown fox jumps over
  the lazy dog. The quick brown fox jumps over the lazy dog. The quick
  brown fox jumps over the lazy dog.
\end{list}
\end{document}
share|improve this answer
    
That almost did it, only now keywords are right align. –  Emanuel Berg Jul 27 '12 at 15:15
    
You can left align them by changing the definition of \makelabel. Try putting \renewcommand\makelabel[1]{#1\hfil} in the list declarations. –  Ian Thompson Jul 27 '12 at 15:26
    
Well, well, well, you are the MAN! –  Emanuel Berg Jul 27 '12 at 15:29
add comment

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.