Re: [NTG-context] numbered exercises

2021-08-25 Thread Henning Hraban Ramm via ntg-context

> Am 25.08.2021 um 00:19 schrieb Aditya Mahajan via ntg-context 
> :
> 
> On Tue, 24 Aug 2021, Henning Hraban Ramm via ntg-context wrote:
> 
>>> Am 24.08.2021 um 21:17 schrieb Wolfgang Schuster via ntg-context 
>>> :
>>> 
>>> 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?
> 
> http://www.ntg.nl/maps/36/09.pdf

Thank you, that also answers my last question.

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

maillist : ntg-context@ntg.nl / 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
___


Re: [NTG-context] numbered exercises

2021-08-24 Thread Aditya Mahajan via ntg-context
On Tue, 24 Aug 2021, Henning Hraban Ramm via ntg-context wrote:

> > Am 24.08.2021 um 21:17 schrieb Wolfgang Schuster via ntg-context 
> > :
> > 
> > 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?

http://www.ntg.nl/maps/36/09.pdf

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

maillist : ntg-context@ntg.nl / 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
___


Re: [NTG-context] numbered exercises

2021-08-24 Thread Henning Hraban Ramm via ntg-context
Here’s what I have now (result attached):

\define[1]\ÜbungNrCmd{\inmargin{\offset[y=3em]{\rotate[rotation=90]{\SectionFont
 #1
  
\defineenumeration[Übung][
  text=Übung,
  title=yes,
  titleleft=,
  titleright=,
  titledistance=-1em,
  titlestyle=\SectionFont,
  %numberstyle=\SectionFont,
  numbercommand=\ÜbungNrCmd,
  way=bytext,
  margin=1em,
  before={\blank[2*line]},
]


Now I’d like to have a vertical line beside the text, starting below the title.

And because I want to use the “sketchy“ lines we discussed a while ago (I 
needed them for the same book), it must be a MetaPost-drawn line.

What’s the right approach? Overlay? Textbackground?

Hraban


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

maillist : ntg-context@ntg.nl / 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
___


Re: [NTG-context] numbered exercises

2021-08-24 Thread Henning Hraban Ramm via ntg-context

> Am 24.08.2021 um 21:34 schrieb Wolfgang Schuster via ntg-context 
> :
> 
> Henning Hraban Ramm via ntg-context schrieb am 24.08.2021 um 21:26:
>>> Am 24.08.2021 um 21:17 schrieb Wolfgang Schuster via ntg-context 
>>> :
>>> 
>>> 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?
> 
> 
> \defineenumeration
>  [Exercise]
>  [text=Exercise,
>   title=yes,
>   titleleft=,
>   titleright=,
>   way=bytext,
>   margin=1em]
> 
> \starttext
> 
> \samplefile{lorem}
> 
> \startExercise [title={Something to do},reference=ex:something]
> \samplefile{lorem}
> \stopExercise
> 
> \stoptext

Thank you, I didn’t even try, since the wiki looked like it wasn’t possible. 
Sorry!
I’ll wikify that.

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

maillist : ntg-context@ntg.nl / 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
___


Re: [NTG-context] numbered exercises

2021-08-24 Thread Gavin via ntg-context
> On Aug 24, 2021, at 1:26 PM, Henning Hraban Ramm via ntg-context 
>  wrote:
>> Am 24.08.2021 um 21:17 schrieb Wolfgang Schuster via ntg-context 
>> :
>> 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 : ntg-context@ntg.nl / 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
___


Re: [NTG-context] numbered exercises

2021-08-24 Thread Wolfgang Schuster via ntg-context

Henning Hraban Ramm via ntg-context schrieb am 24.08.2021 um 21:26:



Am 24.08.2021 um 21:17 schrieb Wolfgang Schuster via ntg-context 
:

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?



\defineenumeration
  [Exercise]
  [text=Exercise,
   title=yes,
   titleleft=,
   titleright=,
   way=bytext,
   margin=1em]

\starttext

\samplefile{lorem}

\startExercise [title={Something to do},reference=ex:something]
\samplefile{lorem}
\stopExercise

\stoptext

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

maillist : ntg-context@ntg.nl / 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
___


Re: [NTG-context] numbered exercises

2021-08-24 Thread Henning Hraban Ramm via ntg-context


> Am 24.08.2021 um 21:17 schrieb Wolfgang Schuster via ntg-context 
> :
> 
> 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?

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

maillist : ntg-context@ntg.nl / 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
___


Re: [NTG-context] numbered exercises

2021-08-24 Thread Wolfgang Schuster via ntg-context

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.

Wolfgang

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

maillist : ntg-context@ntg.nl / 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
___


[NTG-context] numbered exercises

2021-08-24 Thread Henning Hraban Ramm via ntg-context
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.

At the moment I’m using heads, derived from 'section', but the exercises should 
have independent numbers, and I’m unsure how I should setup the indentation. 
With 'narrower' the numbered titles would be difficult.


\setuplabeltext[en][Exercise=Exercise~]

\definehead[Exercise][section]
\setuphead[Exercise][
  bodypartlabel=Exercise,
  number=yes,
  ownnumber=yes, % ??
  way=bytext, % ??
]

\starttext

\startExercise[title={Something to do},reference=ex:something]

This can have several paragraphs and maybe images etc.

\stopExercise

\stoptext



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

maillist : ntg-context@ntg.nl / 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
___