Description

From ConTeXt wiki
Revision as of 11:40, 29 July 2004 by 130.149.19.37 (talk) (Suggestion for description solution)

< From LaTeX to ConTeXt

LaTeX:

\documentclass{article}
\begin{document}
\begin{description}
\item[Short label] bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla
  bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla
\item[Very long label] bla bla bla bla bla bla bla bla bla bla bla bla bla
  bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla
\end{description}
\end{document}

ConTeXt: \setupdescription with some special parameters (location=hanging, width=broad, margin=indentation)

\definedescription[notation][
  headstyle=bold,style=normal,
  align=left,
  location=hanging,
  width=broad,
  margin=1cm,
  ]

\notation{A very very very very long item}
  bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla
  bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla

\notation{i}
  bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla
  bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla

The empty lines (or \par) after each description (here notation) seem to be necessary.

Hint: This solution uses the distance=dimension distance for separation of label and text. I could not find a solution yet, which aligns the text in the first line with that of the other lines, if the label is short enough.