Difference between revisions of "Description"

From ConTeXt wiki
Jump to navigationJump to search
 
(Suggestion for description solution)
Line 14: Line 14:
 
</pre>
 
</pre>
  
ConTeXt: Perhaps with some special parameters of <tt>\setupdescription</tt>?
+
ConTeXt: <tt>\setupdescription</tt> with some special parameters
 +
(<tt>location=hanging</tt>, <tt>width=broad</tt>,
 +
<tt>margin=</tt><i>indentation</i>)
 +
 
 +
<pre>
 +
\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
 +
 
 +
</pre>
 +
 
 +
The empty lines (or <tt>\par</tt>) after each description
 +
(here notation) seem to be necessary.
 +
 
 +
<b>Hint:</b> This solution uses the <tt>distance=</tt><i>dimension</i>
 +
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.

Revision as of 11:40, 29 July 2004

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