2

I am using \startdesc{} to create a label and description environment, e.g.:

\startdesc{(label)}
    This is some text in a sentence.
\stopdesc

\startdesc{(another label)}
    This is some more text in another sentence.
\stopdesc

Unfortunately, this results in labels which are of different length and the sentences begin at a different starting distance relative to the left margin.

(label)  This is some text in
   a sentence.

(another label)  This is some
   more text in another sent-
   ence.

How can I set the width of all of the labels to a fixed width, to the width which would be appropriate for the string WWWWWWWW, which never actually appears in the document?

(WWWWWWWW)  This is some text
   in the first sentence.

(label)     This is some text
   in a sentence.

(another labTlis is some
   more text in another sent-
   ence.
1
  • You can set the width to a fixed value using \definedescription[desc][width=3cm,…], this is however not related to the longest label.
    – Marco
    Apr 15, 2012 at 12:04

1 Answer 1

4

Use \setwidthof to find the width of a string:

\setwidthof A really really long long Long word \to \WIDTH

For descriptions you can use the width key to set the width of the labels:

\definedescription[desc][width=\WIDTH]
2
  • This command results in an error, "Undefined control sequence" with ConTeXt ver: 2011.05.18.
    – Village
    Apr 20, 2012 at 23:50
  • 1
    @VIllage: If you are using ConTeXt MkIV, then you must update the context distribution. In the last one year, almost all of the internals of MkIV have been rewritten.
    – Aditya
    Apr 21, 2012 at 0:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .