Description

From ConTeXt wiki
Revision as of 06:55, 30 July 2004 by Peter (talk | contribs) (example with mdwlist)

< 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]

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

\stoptext

The empty lines (or \par) after each description (here notation) are necessary.

Hint: This solution uses the distance=dimension distance for separation of label and text.

Description with minimal label width:

LaTeX:

\documentclass{article}
\usepackage{mdwlist}
\begin{document}
\begin{basedescript}{\desclabelstyle{\pushlabel}\desclabelwidth{6em}}
\item[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
\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
\end{basedescript}
\end{document}

ConTeXt: ???