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.

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.
share|improve this question
    
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 '12 at 12:04
add comment

1 Answer

up vote 4 down vote accepted

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]
share|improve this answer
    
This command results in an error, "Undefined control sequence" with ConTeXt ver: 2011.05.18. –  Village Apr 20 '12 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 '12 at 0:05
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.