> On Aug 24, 2021, at 1:26 PM, Henning Hraban Ramm via ntg-context
> <[email protected]> wrote:
>> Am 24.08.2021 um 21:17 schrieb Wolfgang Schuster via ntg-context
>> <[email protected]>:
>> Henning Hraban Ramm via ntg-context schrieb am 24.08.2021 um 20:31:
>>> Hi, I’m typesetting a textbook that contains numbered and indented
>>> exercises. They must not float.
>>>
>>> Which structure should I use for them? There must be an easy answer, but I
>>> draw a blank.
>>
>> Use an enumeration.
>
> Thank you, but how can I define a title/caption for the enumeration and its
> reference?
>
Hi Hraban,
Here’s an example from my textbook which might be helpful. I use this
enumeration for example problems, but exercises could be similar. You have
access to the rest of the textbook, so feel free to grab anything useful.
-Gavin
In the environment file:
% Example Problems
\defineenumeration[example]
\setupenumeration[example][
margin=no,
headstyle=\ss\sc,
text=Example, % This text is part of the number, e.g. "Example 2.3"
style=\ss,
alternative=serried,
title=no, % This would be a title after the number
prefix=yes, % Turns on the prefix
prefixsegments=chapter, % makes the prefix the chapter number
way=bychapter, % Numbers within each chapter
%margin=standard, % Indents block on the left
width=fit, % Makes the space between the number and the question a good
size
indentnext=no,
]
\definedelimitedtext[solution][
spacebefore=medium,
spaceafter=medium,
style=\rm\it,
leftmargin=standard, % Indents block on the left
rightmargin=yes, % Indents block on the right
indentnext = no,
]
In the text:
\startexample[ex:organ]
What interval is produced by two consecutive thirds?
\startsolution
We wish to add a third to a third.
\startformula
\text{3rd} + \text{3rd} = 2\units{steps} + 2\units{steps} =
4\units{steps} = \text{5th}
\stopformula
Two thirds produce a fifth.
\stopsolution
\stopexample
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the
Wiki!
maillist : [email protected] / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://context.aanhet.net
archive : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___________________________________________________________________________________