Gerion Entrup schrieb am 13.06.2024 um 13:41:
Hi,
is there a way to automatically prefix the text body in an enumeration?
Consider this example:
```
\defineenumeration[question][
alternative=top,
text=Question,
title=yes,
titleleft=,
titleright=,
right={:},
headstyle=bold,
]
\starttext
Some text:
\startquestion[title={How long does a loop last?}]
\bold{Answer:} For a while.
\stopquestion
\stoptext
```
I'd like to have the `\bold{Answer:}` automatically. So for example something
like this:
```
\defineenumeration[question][
alternative=top,
text=Question,
title=yes,
titleleft=,
titleright=,
right={:},
headstyle=bold,
prefix={\bold{Answer:}},
]
\starttext
Some text:
\startquestion[title={How long does a loop last?}]
For a while.
\stopquestion
\stoptext
```
I tried to misuse `inbetween` for that but `alternative=top` seems to make a
(not modifiable space) between the heading and the text body.
Use the \setupparagraphintro command to set the text which should appear
at the start of the question.
%%%% begin example
\startsetups[question:intro]
\setupparagraphintro[first][\bold{Answer:} ]
\blank
\stopsetups
\defineenumeration[question][
alternative=top,
text=Question,
title=yes,
titleleft=,
titleright=,
right={:},
headstyle=bold,
inbetween=\setup{question:intro},
]
\starttext
Some text:
\startquestion[title={How long does a loop last?}]
For a while.
\stopquestion
\stoptext
%%%% end example
Wolfgang
___________________________________________________________________________________
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
___________________________________________________________________________________