Hi,

I was in the process to convert an itemize part to a description and wanted to 
simplify the code in the same move.
I discovered headcommand for that, but struggled to set the text in an 
highlight _and_ make a colon at the end.
Do you know, if this is possible?

Here is a MWE:
```
\definehighlight[hl][style={\m{>}\,\switchtobodyfont[tt]}]

\definedescription[category][
        alternative=top,
        headstyle=bold,
        width=broad,
]

\definedescription[desc][
        width=broad,
        distance={\widthofstring{~}},
        headcommand={\groupedcommand{\hl}{:}},
        % headcommand={\groupedcommand{}{:}}, % this compiles but the highlight 
is lost
        % headcommand={\groupedcommand{\starthl}{\stophl :}}, % this does not 
compile
        headstyle=,
        before={\startpacked},
        after={\stoppacked},
        alternative=hanging,
]

\starttext

This is a \hl{highlight}.

Some listings

\startcategory{Itemize}
        \startitemize[packed]
                \item \hl{first}: one
                \item \hl{second}: two
        \stopitemize
\stopcategory

Now the same as desc:
\startcategory{Desc}
        \startdesc{first} one \stopdesc
        \startdesc{second} two \stopdesc
\stopcategory

\stoptext
```
The itemize looks like it should look (except of the dots).

Best,
Gerion

Attachment: signature.asc
Description: This is a digitally signed message part.

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

Reply via email to