ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Re: setuphead for in-paragraph head ?
@ 2014-01-09 13:23 Jean-Guillaume
  2014-01-09 13:24 ` Wolfgang Schuster
  2014-01-09 14:19 ` Otared Kavian
  0 siblings, 2 replies; 25+ messages in thread
From: Jean-Guillaume @ 2014-01-09 13:23 UTC (permalink / raw)
  To: ntg-context

But this:

\definehead
  [Exercise] [subsection]
  [after=]
\starttext
  \startExercise [title=This is the exercise's title]
    The exercise's content.
  \stopExercise
\stoptext

results to:

1 This is the exercise's title
The exercise's content.

and I would like it to be:

1 This is the exercise's title The exercise's content.

(When I can typeset that, I will see about formatting the number and so on.)

I'm sorry it wasn't very clear. Now I understand that I misunderstood
\startExercise{...} for \startExercise[title=...] and that's why I was
confused about which newline I want to get rid of.

Jean-Guillaume
___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: setuphead for in-paragraph head ?
  2014-01-09 13:23 setuphead for in-paragraph head ? Jean-Guillaume
@ 2014-01-09 13:24 ` Wolfgang Schuster
  2014-01-09 14:19 ` Otared Kavian
  1 sibling, 0 replies; 25+ messages in thread
From: Wolfgang Schuster @ 2014-01-09 13:24 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 09.01.2014 um 14:23 schrieb Jean-Guillaume <jnglgr@gmail.com>:

> But this:
> 
> \definehead
>  [Exercise] [subsection]
>  [after=]
> \starttext
>  \startExercise [title=This is the exercise's title]
>    The exercise's content.
>  \stopExercise
> \stoptext
> 
> results to:
> 
> 1 This is the exercise's title
> The exercise's content.
> 
> and I would like it to be:
> 
> 1 This is the exercise's title The exercise's content.
> 
> (When I can typeset that, I will see about formatting the number and so on.)
> 
> I'm sorry it wasn't very clear. Now I understand that I misunderstood
> \startExercise{...} for \startExercise[title=...] and that's why I was
> confused about which newline I want to get rid of.

\definehead
  [Exercise]
  [subsection]
  [alternative=text,
   distance=0.5em,
   insidesection=\ignorespaces]

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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: setuphead for in-paragraph head ?
  2014-01-09 13:23 setuphead for in-paragraph head ? Jean-Guillaume
  2014-01-09 13:24 ` Wolfgang Schuster
@ 2014-01-09 14:19 ` Otared Kavian
  2014-01-09 14:48   ` Jaroslav Hajtmar
  1 sibling, 1 reply; 25+ messages in thread
From: Otared Kavian @ 2014-01-09 14:19 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi Jean Guillaume,

I guess Marco Patzer and Wolfgang Schuster gave you already the appropriate answers.
Nevertheless, I wanted to share with you the definitions I use for the kind of work you want to do:

%%% begin example-exercise.tex
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% defining \startexo, \stopexo as an enumeration:
\startsetups style:simple
\defineenumeration[exo]
	[alternative=hanging,
	width=fit,
	stopper={.},
	text=Exercise, 
%	between=,
	before=, 
	after=\blank] 
\stopsetups % style:simple

\startsetups style:textrule
\definenumber[MyExoNumber][way=bysection,sectionumber=yes]
\setuptextrules[rulecolor=darkred]
\define\ExoCommand{\incrementnumber[MyExoNumber]
	\textrule[top]{Exercise \getnumber[MyExoNumber]}
	\startbackground[frame=off,leftframe=on,backgroundcolor=white,
		framecolor=darkred]}

\defineenumeration[exo]
	[alternative=hanging,
	width=fit,
	text={}, 
	number=hide,
	number=no,
	before={\ExoCommand}, 
	after={\stopbackground\blank}]
\stopsetups % style:textrule

% end defining \startexo, \stopexo as an enumeration
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%defining  numbered questions
\defineconversion[exercise][\numbers]
%\setupitemize[packed]
\def\StartQuestions{%
	\startitemize[exercise][width=2em,packed,style=bold,stopper=,right=)]}
\def\StopQuestions{\stopitemize}
\def\q{\item}

% trye each of the following
\setups[style:simple]
%\setups[style:textrule]

\starttext
\startexo 
Prove that for all $a,b\in {\Bbb K}$, a field of characteristic 2, one has $(a+b)^2 = a^2 + b^2$.
\stopexo


\startexo 
Prove that for all $a,b\in {\Bbb K}$, a field of characteristic 2, one has $(a+b)^4 = a^4 + b^4$.
\stopexo

\startexo
\StartQuestions
\q Prove that 
\startformula
\sum_{n=1}^\infty{1 \over n^2} = {\pi^2 \over 6}.
\stopformula

\q Prove that for any $n \geq 1$ integer one has
\startformula
\sum_{k=1}^n k^3 = \left({n(n+1) \over 2}\right)^2.
\stopformula
\StopQuestions
\stopexo

\stoptext
%%% end example-exercise.tex


Best regards: OK

On 9 janv. 2014, at 14:23, Jean-Guillaume <jnglgr@gmail.com> wrote:

> But this:
> 
> \definehead
>  [Exercise] [subsection]
>  [after=]
> \starttext
>  \startExercise [title=This is the exercise's title]
>    The exercise's content.
>  \stopExercise
> \stoptext
> 
> results to:
> 
> 1 This is the exercise's title
> The exercise's content.
> 
> and I would like it to be:
> 
> 1 This is the exercise's title The exercise's content.
> 
> (When I can typeset that, I will see about formatting the number and so on.)
> 
> I'm sorry it wasn't very clear. Now I understand that I misunderstood
> \startExercise{...} for \startExercise[title=...] and that's why I was
> confused about which newline I want to get rid of.
> 
> Jean-Guillaume
> ___________________________________________________________________________________
> 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://tex.aanhet.net
> archive  : http://foundry.supelec.fr/projects/contextrev/
> wiki     : http://contextgarden.net
> ___________________________________________________________________________________

___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: setuphead for in-paragraph head ?
  2014-01-09 14:19 ` Otared Kavian
@ 2014-01-09 14:48   ` Jaroslav Hajtmar
  2014-01-09 15:36     ` Otared Kavian
  0 siblings, 1 reply; 25+ messages in thread
From: Jaroslav Hajtmar @ 2014-01-09 14:48 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hello Otared.
I will throw this one... Thanx.

Once I was using exercise-answer package for LaTeX.
Is there anything like this to use in ConTeXt?

Thanx
Jaroslav Hajtmar


Dne 9.1.2014 15:19, Otared Kavian napsal(a):
> %%% begin example-exercise.tex
> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
> % defining \startexo, \stopexo as an enumeration:
> \startsetups style:simple
> \defineenumeration[exo]
> 	[alternative=hanging,
> 	width=fit,
> 	stopper={.},
> 	text=Exercise,
> %	between=,
> 	before=,
> 	after=\blank]
> \stopsetups % style:simple
>
> \startsetups style:textrule
> \definenumber[MyExoNumber][way=bysection,sectionumber=yes]
> \setuptextrules[rulecolor=darkred]
> \define\ExoCommand{\incrementnumber[MyExoNumber]
> 	\textrule[top]{Exercise \getnumber[MyExoNumber]}
> 	\startbackground[frame=off,leftframe=on,backgroundcolor=white,
> 		framecolor=darkred]}
>
> \defineenumeration[exo]
> 	[alternative=hanging,
> 	width=fit,
> 	text={},
> 	number=hide,
> 	number=no,
> 	before={\ExoCommand},
> 	after={\stopbackground\blank}]
> \stopsetups % style:textrule
>
> % end defining \startexo, \stopexo as an enumeration
> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
>
> %defining  numbered questions
> \defineconversion[exercise][\numbers]
> %\setupitemize[packed]
> \def\StartQuestions{%
> 	\startitemize[exercise][width=2em,packed,style=bold,stopper=,right=)]}
> \def\StopQuestions{\stopitemize}
> \def\q{\item}
>
> % trye each of the following
> \setups[style:simple]
> %\setups[style:textrule]
>
> \starttext
> \startexo
> Prove that for all $a,b\in {\Bbb K}$, a field of characteristic 2, one has $(a+b)^2  = a^2  + b^2$.
> \stopexo
>
>
> \startexo
> Prove that for all $a,b\in {\Bbb K}$, a field of characteristic 2, one has $(a+b)^4  = a^4  + b^4$.
> \stopexo
>
> \startexo
> \StartQuestions
> \q Prove that
> \startformula
> \sum_{n=1}^\infty{1 \over n^2} = {\pi^2  \over 6}.
> \stopformula
>
> \q Prove that for any $n \geq 1$ integer one has
> \startformula
> \sum_{k=1}^n k^3  = \left({n(n+1) \over 2}\right)^2.
> \stopformula
> \StopQuestions
> \stopexo
>
> \stoptext
> %%% end example-exercise.tex

___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: setuphead for in-paragraph head ?
  2014-01-09 14:48   ` Jaroslav Hajtmar
@ 2014-01-09 15:36     ` Otared Kavian
  2014-01-09 17:12       ` Aditya Mahajan
  2014-01-09 17:23       ` Wolfgang Schuster
  0 siblings, 2 replies; 25+ messages in thread
From: Otared Kavian @ 2014-01-09 15:36 UTC (permalink / raw)
  To: hajtmar, mailing list for ConTeXt users


On 9 janv. 2014, at 15:48, Jaroslav Hajtmar <hajtmar@gyza.cz> wrote:

> Hello Otared.
> I will throw this one... Thanx.
> 
> Once I was using exercise-answer package for LaTeX.
> Is there anything like this to use in ConTeXt?
> 
> Thanx
> Jaroslav Hajtmar

Hello Jaroslav,

I have something like the following which was given to me by Hans a long time ago: unfortunately for some reason this does not work anymore with ConTeXt mkiv, but it is quite fine with mkii:

%%% begin question-hint-answer.tex
\defineblock[question]
\defineblock[hint]
\defineblock[answer]

\defineenumeration[question][location=hanging,text={Question},stopper={.}]
\defineenumeration[hint][location=hanging,text={Hint for question},stopper={.}]
\defineenumeration[answer][location=hanging,text={Answer to question},stopper={.}]

\hideblocks[hint]
\hideblocks[answer]

\starttext
\section{Questions}

\beginquestion
\question Compute $4\times 5$.

\beginhint
\hint Use the fact that $2\times 5 = 10$.
\endhint

\beginanswer
\answer $20$.
\endanswer

\endquestion

\beginquestion
\question What is the value of $100 / 10$?

\beginhint
\hint Remember that $10\times 10 = 100$.
\endhint

\beginanswer
\answer $10$
\endanswer

\endquestion

\section{Hints}
\useblocks[hint]

\section{Answers}
\useblocks[answer]

\stoptext
%%% end question-hint-answer.tex

Best regards: OK



> 
> 
> Dne 9.1.2014 15:19, Otared Kavian napsal(a):
>> %%% begin example-exercise.tex
>> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
>> % defining \startexo, \stopexo as an enumeration:
>> \startsetups style:simple
>> \defineenumeration[exo]
>> 	[alternative=hanging,
>> 	width=fit,
>> 	stopper={.},
>> 	text=Exercise,
>> %	between=,
>> 	before=,
>> 	after=\blank]
>> \stopsetups % style:simple
>> 
>> \startsetups style:textrule
>> \definenumber[MyExoNumber][way=bysection,sectionumber=yes]
>> \setuptextrules[rulecolor=darkred]
>> \define\ExoCommand{\incrementnumber[MyExoNumber]
>> 	\textrule[top]{Exercise \getnumber[MyExoNumber]}
>> 	\startbackground[frame=off,leftframe=on,backgroundcolor=white,
>> 		framecolor=darkred]}
>> 
>> \defineenumeration[exo]
>> 	[alternative=hanging,
>> 	width=fit,
>> 	text={},
>> 	number=hide,
>> 	number=no,
>> 	before={\ExoCommand},
>> 	after={\stopbackground\blank}]
>> \stopsetups % style:textrule
>> 
>> % end defining \startexo, \stopexo as an enumeration
>> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
>> 
>> %defining  numbered questions
>> \defineconversion[exercise][\numbers]
>> %\setupitemize[packed]
>> \def\StartQuestions{%
>> 	\startitemize[exercise][width=2em,packed,style=bold,stopper=,right=)]}
>> \def\StopQuestions{\stopitemize}
>> \def\q{\item}
>> 
>> % trye each of the following
>> \setups[style:simple]
>> %\setups[style:textrule]
>> 
>> \starttext
>> \startexo
>> Prove that for all $a,b\in {\Bbb K}$, a field of characteristic 2, one has $(a+b)^2  = a^2  + b^2$.
>> \stopexo
>> 
>> 
>> \startexo
>> Prove that for all $a,b\in {\Bbb K}$, a field of characteristic 2, one has $(a+b)^4  = a^4  + b^4$.
>> \stopexo
>> 
>> \startexo
>> \StartQuestions
>> \q Prove that
>> \startformula
>> \sum_{n=1}^\infty{1 \over n^2} = {\pi^2  \over 6}.
>> \stopformula
>> 
>> \q Prove that for any $n \geq 1$ integer one has
>> \startformula
>> \sum_{k=1}^n k^3  = \left({n(n+1) \over 2}\right)^2.
>> \stopformula
>> \StopQuestions
>> \stopexo
>> 
>> \stoptext
>> %%% end example-exercise.tex
> 
> ___________________________________________________________________________________
> 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://tex.aanhet.net
> archive  : http://foundry.supelec.fr/projects/contextrev/
> wiki     : http://contextgarden.net
> ___________________________________________________________________________________

___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: setuphead for in-paragraph head ?
  2014-01-09 15:36     ` Otared Kavian
@ 2014-01-09 17:12       ` Aditya Mahajan
  2014-01-09 17:23       ` Wolfgang Schuster
  1 sibling, 0 replies; 25+ messages in thread
From: Aditya Mahajan @ 2014-01-09 17:12 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Thu, 9 Jan 2014, Otared Kavian wrote:

>
> On 9 janv. 2014, at 15:48, Jaroslav Hajtmar <hajtmar@gyza.cz> wrote:
>
>> Hello Otared.
>> I will throw this one... Thanx.
>>
>> Once I was using exercise-answer package for LaTeX.
>> Is there anything like this to use in ConTeXt?
>>
>> Thanx
>> Jaroslav Hajtmar
>
> Hello Jaroslav,
>
> I have something like the following which was given to me by Hans a long 
> time ago: unfortunately for some reason this does not work anymore with 
> ConTeXt mkiv, but it is quite fine with mkii:

(Untested): Change location=hanging to alternative=hanging.

> %%% begin question-hint-answer.tex
> \defineblock[question]
> \defineblock[hint]
> \defineblock[answer]
>
> \defineenumeration[question][location=hanging,text={Question},stopper={.}]
> \defineenumeration[hint][location=hanging,text={Hint for question},stopper={.}]
> \defineenumeration[answer][location=hanging,text={Answer to question},stopper={.}]


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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: setuphead for in-paragraph head ?
  2014-01-09 15:36     ` Otared Kavian
  2014-01-09 17:12       ` Aditya Mahajan
@ 2014-01-09 17:23       ` Wolfgang Schuster
  2014-01-09 17:36         ` Otared Kavian
  1 sibling, 1 reply; 25+ messages in thread
From: Wolfgang Schuster @ 2014-01-09 17:23 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 613 bytes --]


Am 09.01.2014 um 16:36 schrieb Otared Kavian <otared@gmail.com>:

> 
> On 9 janv. 2014, at 15:48, Jaroslav Hajtmar <hajtmar@gyza.cz> wrote:
> 
>> Hello Otared.
>> I will throw this one... Thanx.
>> 
>> Once I was using exercise-answer package for LaTeX.
>> Is there anything like this to use in ConTeXt?
>> 
>> Thanx
>> Jaroslav Hajtmar
> 
> Hello Jaroslav,
> 
> I have something like the following which was given to me by Hans a long time ago: unfortunately for some reason this does not work anymore with ConTeXt mkiv, but it is quite fine with mkii:

Add \keepblocks[question].

Wolfgang

[-- Attachment #1.2: Type: text/html, Size: 1372 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: setuphead for in-paragraph head ?
  2014-01-09 17:23       ` Wolfgang Schuster
@ 2014-01-09 17:36         ` Otared Kavian
  2014-01-09 17:41           ` Wolfgang Schuster
  0 siblings, 1 reply; 25+ messages in thread
From: Otared Kavian @ 2014-01-09 17:36 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1964 bytes --]

Hi Wolfgang, Hi Aditya,

Thanks for your attention.
Unfortunately adding 
	\keepblocks[question] 
the example I sent before does not work in mkiv, and changing 
	location=hanging
to
	alternative=hanging
does not help neither…
The error message in mkiv is:
	\dostopnormalblock ...meter \c!after \par \egroup 
                                                  
<argument> ...fact that $2\times 5 = 10$. \dostopnormalblock 
                                                  \dostartnormalblock {hint}...
\dodowithpar ...dler \v!construction \endcsname #1
                                                  \csname \??constructionsto…

So I don’t know what to do if one has to use mkiv.

Best regards: OK

On 9 janv. 2014, at 18:23, Wolfgang Schuster <schuster.wolfgang@gmail.com> wrote:

> 
> Am 09.01.2014 um 16:36 schrieb Otared Kavian <otared@gmail.com>:
> 
>> 
>> On 9 janv. 2014, at 15:48, Jaroslav Hajtmar <hajtmar@gyza.cz> wrote:
>> 
>>> Hello Otared.
>>> I will throw this one... Thanx.
>>> 
>>> Once I was using exercise-answer package for LaTeX.
>>> Is there anything like this to use in ConTeXt?
>>> 
>>> Thanx
>>> Jaroslav Hajtmar
>> 
>> Hello Jaroslav,
>> 
>> I have something like the following which was given to me by Hans a long time ago: unfortunately for some reason this does not work anymore with ConTeXt mkiv, but it is quite fine with mkii:
> 
> Add \keepblocks[question].
> 
> 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://tex.aanhet.net
> archive  : http://foundry.supelec.fr/projects/contextrev/
> wiki     : http://contextgarden.net
> ___________________________________________________________________________________


[-- Attachment #1.2: Type: text/html, Size: 4701 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: setuphead for in-paragraph head ?
  2014-01-09 17:36         ` Otared Kavian
@ 2014-01-09 17:41           ` Wolfgang Schuster
  2014-01-10  6:56             ` Jaroslav Hajtmar
  2014-01-10 23:36             ` Otared Kavian
  0 siblings, 2 replies; 25+ messages in thread
From: Wolfgang Schuster @ 2014-01-09 17:41 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1125 bytes --]


Am 09.01.2014 um 18:36 schrieb Otared Kavian <otared@gmail.com>:

> Hi Wolfgang, Hi Aditya,
> 
> Thanks for your attention.
> Unfortunately adding 
> 	\keepblocks[question] 
> the example I sent before does not work in mkiv, and changing 
> 	location=hanging
> to
> 	alternative=hanging
> does not help neither…
> The error message in mkiv is:
> 	\dostopnormalblock ...meter \c!after \par \egroup 
>                                                   
> <argument> ...fact that $2\times 5 = 10$. \dostopnormalblock 
>                                                   \dostartnormalblock {hint}...
> \dodowithpar ...dler \v!construction \endcsname #1
>                                                   \csname \??constructionsto…
> 
> So I don’t know what to do if one has to use mkiv.

When you enumerations in this form

\beginanswer
\answer $10$
\endanswer

you have to finish the paragraph, e.g. by adding \par

\beginanswer
\answer $10$\par
\endanswer

or better use the start/stop commands for the enumeration.

\beginanswer
\startanswer
$10$
\stopanswer
\endanswer

Wolfgang

[-- Attachment #1.2: Type: text/html, Size: 3199 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: setuphead for in-paragraph head ?
  2014-01-09 17:41           ` Wolfgang Schuster
@ 2014-01-10  6:56             ` Jaroslav Hajtmar
  2014-01-10 23:36             ` Otared Kavian
  1 sibling, 0 replies; 25+ messages in thread
From: Jaroslav Hajtmar @ 2014-01-10  6:56 UTC (permalink / raw)
  To: ntg-context

Hello Wolfgang, Otared and Aditya.
Thanks for your advice and treatments. It is there a complete working 
example?
I am sorry, but I am not able to achieve the proposed modifications to 
make it work.
Thanx.
Jaroslav Hajtmar






Dne 9.1.2014 18:41, Wolfgang Schuster napsal(a):
>
> Am 09.01.2014 um 18:36 schrieb Otared Kavian <otared@gmail.com 
> <mailto:otared@gmail.com>>:
>
>> Hi Wolfgang, Hi Aditya,
>>
>> Thanks for your attention.
>> Unfortunately adding
>> \keepblocks[question]
>> the example I sent before does not work in mkiv, and changing
>> location=hanging
>> to
>> alternative=hanging
>> does not help neither…
>> The error message in mkiv is:
>> \dostopnormalblock ...meter \c!after \par \egroup
>>
>> <argument> ...fact that $2\times 5 = 10$. \dostopnormalblock
>> \dostartnormalblock {hint}...
>> \dodowithpar ...dler \v!construction \endcsname #1
>> \csname \??constructionsto…
>>
>> So I don’t know what to do if one has to use mkiv.
>
> When you enumerations in this form
>
> \beginanswer
> \answer $10$
> \endanswer
>
> you have to finish the paragraph, e.g. by adding \par
>
> \beginanswer
> \answer $10$\par
> \endanswer
>
> or better use the start/stop commands for the enumeration.
>
> \beginanswer
> \startanswer
> $10$
> \stopanswer
> \endanswer
>
> 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://tex.aanhet.net
> archive  : http://foundry.supelec.fr/projects/contextrev/
> wiki     : http://contextgarden.net
> ___________________________________________________________________________________

___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: setuphead for in-paragraph head ?
  2014-01-09 17:41           ` Wolfgang Schuster
  2014-01-10  6:56             ` Jaroslav Hajtmar
@ 2014-01-10 23:36             ` Otared Kavian
  2014-01-11  9:12               ` Wolfgang Schuster
  1 sibling, 1 reply; 25+ messages in thread
From: Otared Kavian @ 2014-01-10 23:36 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1712 bytes --]

Hi Wolfgang,

In mkiv, even using \startanswer, \stopanswer (and the same syntax with questions and hints) the blocks mechanism seems to be broken.
The error message is still the following:

\dostopnormalblock ...meter \c!after \par \egroup 
                                                  
<argument> ...fact that $2\times 5 = 10$. \dostopnormalblock 
                                                  \dostartnormalblock {hint}...
\dodowithpar ...dler \v!construction \endcsname #1
                                                  \csname \??constructionsto...

When I understand a little bit more about that mechanism I’ll do other testings and eventually ask Hans about what has been changed regarding blocks.
Best regards: OK

On 9 janv. 2014, at 18:41, Wolfgang Schuster <schuster.wolfgang@gmail.com> wrote:

> […]
> When you enumerations in this form
> 
> \beginanswer
> \answer $10$
> \endanswer
> 
> you have to finish the paragraph, e.g. by adding \par
> 
> \beginanswer
> \answer $10$\par
> \endanswer
> 
> or better use the start/stop commands for the enumeration.
> 
> \beginanswer
> \startanswer
> $10$
> \stopanswer
> \endanswer
> 
> 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://tex.aanhet.net
> archive  : http://foundry.supelec.fr/projects/contextrev/
> wiki     : http://contextgarden.net
> ___________________________________________________________________________________


[-- Attachment #1.2: Type: text/html, Size: 3702 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: setuphead for in-paragraph head ?
  2014-01-10 23:36             ` Otared Kavian
@ 2014-01-11  9:12               ` Wolfgang Schuster
  2014-01-11 19:01                 ` Otared Kavian
  0 siblings, 1 reply; 25+ messages in thread
From: Wolfgang Schuster @ 2014-01-11  9:12 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 2120 bytes --]


Am 11.01.2014 um 00:36 schrieb Otared Kavian <otared@gmail.com>:

> Hi Wolfgang,
> 
> In mkiv, even using \startanswer, \stopanswer (and the same syntax with questions and hints) the blocks mechanism seems to be broken.
> The error message is still the following:
> 
> \dostopnormalblock ...meter \c!after \par \egroup 
>                                                   
> <argument> ...fact that $2\times 5 = 10$. \dostopnormalblock 
>                                                   \dostartnormalblock {hint}...
> \dodowithpar ...dler \v!construction \endcsname #1
>                                                   \csname \??constructionsto...
> 
> When I understand a little bit more about that mechanism I’ll do other testings and eventually ask Hans about what has been changed regarding blocks.

You have to convert the question, hint and answer environment.

What the block environment does is to save the content from the begin to the end block and hides it when you use \hideblocks[…]. To output the content of the environments you can use \useblocks[…].


\defineblock[question]
\defineblock[hint]
\defineblock[answer]

\defineenumeration[question][alternative=hanging,text={Question},stopper={.}]
\defineenumeration[hint]    [alternative=hanging,text={Hint for question},stopper={.}]
\defineenumeration[answer]  [alternative=hanging,text={Answer to question},stopper={.}]

\keepblocks[question]
\hideblocks[hint]
\hideblocks[answer]

\starttext

\section{Questions}

\beginquestion

\startquestion
  Compute $4\times 5$.
\stopquestion

\beginhint
\starthint
  Use the fact that $2\times 5 = 10$.
\stophint
\endhint

\beginanswer
\startanswer
  $20$.
\stopanswer
\endanswer

\endquestion

\beginquestion

\startquestion
  What is the value of $100 / 10$?
\stopquestion

\beginhint
\starthint
Remember that $10\times 10 = 100$.
\stophint
\endhint

\beginanswer
\startanswer
$10$
\stopanswer
\endanswer

\endquestion

\section{Hints}

\useblocks[hint]

\section{Answers}

\useblocks[answer]

\stoptext

Wolfgang


[-- Attachment #1.2: Type: text/html, Size: 4586 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: setuphead for in-paragraph head ?
  2014-01-11  9:12               ` Wolfgang Schuster
@ 2014-01-11 19:01                 ` Otared Kavian
  2014-01-12 10:45                   ` Jaroslav Hajtmar
  2014-01-12 20:30                   ` Wolfgang Schuster
  0 siblings, 2 replies; 25+ messages in thread
From: Otared Kavian @ 2014-01-11 19:01 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi Wolfgang,

Many thanks for your attention and insight.
With your code everything works as expected. In case others would be interested, I give here a slight modification of what you sent, which works very well with mkiv: I only added 
	\setupblock[question][before={\startquestion},after={\stopquestion}]
so that one can just say \beginquestion \endquestion without having to enter each time \startquestion \stopquestion. I don’t know whether this is a good idea or not, as it may have side effects…

I will put this example on the wiki, but before doing so I have another question:
can one add two automatic links at the end of each question so that one can navigate easily to the respective hint or answer corresponding to that question? Indeed if this were possible, one would add also two automatic links to each hint going to its question and the corresponding answer, and two other links to each answer going to its hint and question. One can do this manually by adding a reference to each question, each hint and each answer, but it would be nice to have this done automatically.

Best regards: OK
PS: here is the complete example for question-hint-answer:

%%%% begin question-hint-answer-blocks.tex
\defineblock[question]
\defineblock[hint]
\defineblock[answer]

\defineenumeration[question]
	[alternative=hanging,
	width=2.5cm,
	text={Question},
	headstyle={\bi},
	stopper={.}]
	
\defineenumeration[hint]
	[alternative=hanging,
	width=4cm,
	text={Hint for question},
	headstyle={\bi},
	stopper={.}]

\defineenumeration[answer]
	[alternative=hanging,
	width=4.5cm,
	text={Answer to question},
	headstyle={\bi},
	stopper={.}]

\setupblock[question][before={\startquestion},after={\stopquestion}]
\setupblock[hint][before={\starthint},after={\stophint}]
\setupblock[answer][before={\startanswer},after={\stopanswer}]

\keepblocks[question]
\hideblocks[hint]
\hideblocks[answer]

\starttext

\section{Questions}

\beginquestion
  Compute $4\times 5$.
\endquestion

\beginhint
  Use the fact that $2\times 5 = 10$.
\endhint

\beginanswer
  $20$.
\endanswer

\beginquestion
  What is the value of $100 / 10$?
\endquestion

\beginhint
Remember that $10\times 10 = 100$.
\endhint

\beginanswer
$10$
\endanswer

\section{Hints to all questions}

\useblocks[hint]

\section{Answers to all questions}

\useblocks[answer]

\stoptext
%%%% end question-hint-answer-blocks.tex


On 11 janv. 2014, at 10:12, Wolfgang Schuster <schuster.wolfgang@gmail.com> wrote:

> 
> Am 11.01.2014 um 00:36 schrieb Otared Kavian <otared@gmail.com>:
> 
>> Hi Wolfgang,
>> 
>> In mkiv, even using \startanswer, \stopanswer (and the same syntax with questions and hints) the blocks mechanism seems to be broken.
>> The error message is still the following:
>> 
>> \dostopnormalblock ...meter \c!after \par \egroup 
>>                                                   
>> <argument> ...fact that $2\times 5 = 10$. \dostopnormalblock 
>>                                                   \dostartnormalblock {hint}...
>> \dodowithpar ...dler \v!construction \endcsname #1
>>                                                   \csname \??constructionsto...
>> 
>> When I understand a little bit more about that mechanism I’ll do other testings and eventually ask Hans about what has been changed regarding blocks.
> 
> You have to convert the question, hint and answer environment.
> 
> What the block environment does is to save the content from the begin to the end block and hides it when you use \hideblocks[…]. To output the content of the environments you can use \useblocks[…].
> 
> 
> \defineblock[question]
> \defineblock[hint]
> \defineblock[answer]
> 
> \defineenumeration[question][alternative=hanging,text={Question},stopper={.}]
> \defineenumeration[hint]    [alternative=hanging,text={Hint for question},stopper={.}]
> \defineenumeration[answer]  [alternative=hanging,text={Answer to question},stopper={.}]
> 
> \keepblocks[question]
> \hideblocks[hint]
> \hideblocks[answer]
> 
> \starttext
> 
> \section{Questions}
> 
> \beginquestion
> 
> \startquestion
>   Compute $4\times 5$.
> \stopquestion
> 
> \beginhint
> \starthint
>   Use the fact that $2\times 5 = 10$.
> \stophint
> \endhint
> 
> \beginanswer
> \startanswer
>   $20$.
> \stopanswer
> \endanswer
> 
> \endquestion
> 
> \beginquestion
> 
> \startquestion
>   What is the value of $100 / 10$?
> \stopquestion
> 
> \beginhint
> \starthint
> Remember that $10\times 10 = 100$.
> \stophint
> \endhint
> 
> \beginanswer
> \startanswer
> $10$
> \stopanswer
> \endanswer
> 
> \endquestion
> 
> \section{Hints}
> 
> \useblocks[hint]
> 
> \section{Answers}
> 
> \useblocks[answer]
> 
> \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://tex.aanhet.net
> archive  : http://foundry.supelec.fr/projects/contextrev/
> wiki     : http://contextgarden.net
> ___________________________________________________________________________________

___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: setuphead for in-paragraph head ?
  2014-01-11 19:01                 ` Otared Kavian
@ 2014-01-12 10:45                   ` Jaroslav Hajtmar
  2014-01-12 16:08                     ` Otared Kavian
  2014-01-12 20:30                   ` Wolfgang Schuster
  1 sibling, 1 reply; 25+ messages in thread
From: Jaroslav Hajtmar @ 2014-01-12 10:45 UTC (permalink / raw)
  To: ntg-context

Hello Otared and Wolfgang.

Thanks for launching this example.
Is there a possibility to write the answers into a more compact form 
(more columns, one paragraph, etc) like in any textbooks? I tried 
experimenting, but I was unable to put answers into a compact form.
Thanks Jaroslav Hajtmar

Here is my modification of answer enumeration (not working):

%%%% begin question-hint-answer-blocks.tex
\defineblock[question]
\defineblock[hint]
\defineblock[answer]

\defineenumeration[question]
     [alternative=hanging,
     width=2.5cm,
     text={Question},
     headstyle={\bi},
     stopper={.}]

\defineenumeration[hint]
     [alternative=hanging,
     width=4cm,
     text={Hint for question},
     headstyle={\bi},
     stopper={.}]

\defineenumeration[answer]
     [alternative=hanging,
     beforehead=,
     afterhead=,
      before={\startcolumns[n=4]},
     after=\stopcolumns,
     width=0.5em,
     text={},
     headstyle={},
     stopper={.}]

\setupblock[question][before={\startquestion},after={\stopquestion}]
\setupblock[hint][before={\starthint},after={\stophint}]
\setupblock[answer][before={\startanswer},after={\stopanswer}]

\keepblocks[question]
\hideblocks[hint]
\hideblocks[answer]

\starttext

\section{Questions}

\beginquestion
   Compute $4\times 5$.
\endquestion

\beginhint
   Use the fact that $2\times 5 = 10$.
\endhint

\beginanswer
   $20$.
\endanswer

\beginquestion
   What is the value of $100 / 10$?
\endquestion

\beginhint
Remember that $10\times 10 = 100$.
\endhint

\beginanswer
$10$
\endanswer

\beginquestion
   Compute $4\times 5$.
\endquestion

\beginhint
   Use the fact that $2\times 5 = 10$.
\endhint

\beginanswer
   $20$.
\endanswer

\beginquestion
   What is the value of $100 / 10$?
\endquestion

\beginhint
Remember that $10\times 10 = 100$.
\endhint

\beginanswer
$10$
\endanswer

\beginquestion
   Compute $4\times 5$.
\endquestion

\beginhint
   Use the fact that $2\times 5 = 10$.
\endhint

\beginanswer
   $20$.
\endanswer

\beginquestion
   What is the value of $100 / 10$?
\endquestion

\beginhint
Remember that $10\times 10 = 100$.
\endhint

\beginanswer
$10$
\endanswer
\beginquestion
   Compute $4\times 5$.
\endquestion

\beginhint
   Use the fact that $2\times 5 = 10$.
\endhint

\beginanswer
   $20$.
\endanswer

\beginquestion
   What is the value of $100 / 10$?
\endquestion

\beginhint
Remember that $10\times 10 = 100$.
\endhint

\beginanswer
$10$
\endanswer


\section{Hints to all questions}

\useblocks[hint]

\section{Answers to all questions}

\useblocks[answer]

\stoptext
%%%% end question-hint-answer-blocks.tex



Dne 11.1.2014 20:01, Otared Kavian napsal(a):
> %%%% begin question-hint-answer-blocks.tex
> \defineblock[question]
> \defineblock[hint]
> \defineblock[answer]
>
> \defineenumeration[question]
> 	[alternative=hanging,
> 	width=2.5cm,
> 	text={Question},
> 	headstyle={\bi},
> 	stopper={.}]
> 	
> \defineenumeration[hint]
> 	[alternative=hanging,
> 	width=4cm,
> 	text={Hint for question},
> 	headstyle={\bi},
> 	stopper={.}]
>
> \defineenumeration[answer]
> 	[alternative=hanging,
> 	width=4.5cm,
> 	text={Answer to question},
> 	headstyle={\bi},
> 	stopper={.}]
>
> \setupblock[question][before={\startquestion},after={\stopquestion}]
> \setupblock[hint][before={\starthint},after={\stophint}]
> \setupblock[answer][before={\startanswer},after={\stopanswer}]
>
> \keepblocks[question]
> \hideblocks[hint]
> \hideblocks[answer]
>
> \starttext
>
> \section{Questions}
>
> \beginquestion
>    Compute $4\times 5$.
> \endquestion
>
> \beginhint
>    Use the fact that $2\times 5 = 10$.
> \endhint
>
> \beginanswer
>    $20$.
> \endanswer
>
> \beginquestion
>    What is the value of $100 / 10$?
> \endquestion
>
> \beginhint
> Remember that $10\times 10 = 100$.
> \endhint
>
> \beginanswer
> $10$
> \endanswer
>
> \section{Hints to all questions}
>
> \useblocks[hint]
>
> \section{Answers to all questions}
>
> \useblocks[answer]
>
> \stoptext
> %%%% end question-hint-answer-blocks.tex

___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: setuphead for in-paragraph head ?
  2014-01-12 10:45                   ` Jaroslav Hajtmar
@ 2014-01-12 16:08                     ` Otared Kavian
  2014-01-12 19:29                       ` Jaroslav Hajtmar
  0 siblings, 1 reply; 25+ messages in thread
From: Otared Kavian @ 2014-01-12 16:08 UTC (permalink / raw)
  To: hajtmar, mailing list for ConTeXt users

Hi Jaroslav,

Actually the formatting of what you put in the block determined for example by
	\beginanswer
		The answer is…
	\endanswer
is independent of the block mechanism: you can use whatever structure you want. In the example we exchanged on, an enumeration such as
	\startanswer
	\stopanswer
where this \start \stop has been defined by \defineenumeration[answer], but you can use your own compact formatting instead of this.

Best regards: OK

On 12 janv. 2014, at 11:45, Jaroslav Hajtmar <hajtmar@gyza.cz> wrote:

> Hello Otared and Wolfgang.
> 
> Thanks for launching this example.
> Is there a possibility to write the answers into a more compact form (more columns, one paragraph, etc) like in any textbooks? I tried experimenting, but I was unable to put answers into a compact form.
> Thanks Jaroslav Hajtmar
> 
> Here is my modification of answer enumeration (not working):
> 
> %%%% begin question-hint-answer-blocks.tex
> \defineblock[question]
> \defineblock[hint]
> \defineblock[answer]
> 
> \defineenumeration[question]
>    [alternative=hanging,
>    width=2.5cm,
>    text={Question},
>    headstyle={\bi},
>    stopper={.}]
> 
> \defineenumeration[hint]
>    [alternative=hanging,
>    width=4cm,
>    text={Hint for question},
>    headstyle={\bi},
>    stopper={.}]
> 
> \defineenumeration[answer]
>    [alternative=hanging,
>    beforehead=,
>    afterhead=,
>     before={\startcolumns[n=4]},
>    after=\stopcolumns,
>    width=0.5em,
>    text={},
>    headstyle={},
>    stopper={.}]
> 
> \setupblock[question][before={\startquestion},after={\stopquestion}]
> \setupblock[hint][before={\starthint},after={\stophint}]
> \setupblock[answer][before={\startanswer},after={\stopanswer}]
> 
> \keepblocks[question]
> \hideblocks[hint]
> \hideblocks[answer]
> 
> \starttext
> 
> \section{Questions}
> 
> \beginquestion
>  Compute $4\times 5$.
> \endquestion
> 
> \beginhint
>  Use the fact that $2\times 5 = 10$.
> \endhint
> 
> \beginanswer
>  $20$.
> \endanswer
> 
> \beginquestion
>  What is the value of $100 / 10$?
> \endquestion
> 
> \beginhint
> Remember that $10\times 10 = 100$.
> \endhint
> 
> \beginanswer
> $10$
> \endanswer
> 
> \beginquestion
>  Compute $4\times 5$.
> \endquestion
> 
> \beginhint
>  Use the fact that $2\times 5 = 10$.
> \endhint
> 
> \beginanswer
>  $20$.
> \endanswer
> 
> \beginquestion
>  What is the value of $100 / 10$?
> \endquestion
> 
> \beginhint
> Remember that $10\times 10 = 100$.
> \endhint
> 
> \beginanswer
> $10$
> \endanswer
> 
> \beginquestion
>  Compute $4\times 5$.
> \endquestion
> 
> \beginhint
>  Use the fact that $2\times 5 = 10$.
> \endhint
> 
> \beginanswer
>  $20$.
> \endanswer
> 
> \beginquestion
>  What is the value of $100 / 10$?
> \endquestion
> 
> \beginhint
> Remember that $10\times 10 = 100$.
> \endhint
> 
> \beginanswer
> $10$
> \endanswer
> \beginquestion
>  Compute $4\times 5$.
> \endquestion
> 
> \beginhint
>  Use the fact that $2\times 5 = 10$.
> \endhint
> 
> \beginanswer
>  $20$.
> \endanswer
> 
> \beginquestion
>  What is the value of $100 / 10$?
> \endquestion
> 
> \beginhint
> Remember that $10\times 10 = 100$.
> \endhint
> 
> \beginanswer
> $10$
> \endanswer
> 
> 
> \section{Hints to all questions}
> 
> \useblocks[hint]
> 
> \section{Answers to all questions}
> 
> \useblocks[answer]
> 
> \stoptext
> %%%% end question-hint-answer-blocks.tex
> 
> 
> 
> Dne 11.1.2014 20:01, Otared Kavian napsal(a):
>> %%%% begin question-hint-answer-blocks.tex
>> \defineblock[question]
>> \defineblock[hint]
>> \defineblock[answer]
>> 
>> \defineenumeration[question]
>> 	[alternative=hanging,
>> 	width=2.5cm,
>> 	text={Question},
>> 	headstyle={\bi},
>> 	stopper={.}]
>> 	
>> \defineenumeration[hint]
>> 	[alternative=hanging,
>> 	width=4cm,
>> 	text={Hint for question},
>> 	headstyle={\bi},
>> 	stopper={.}]
>> 
>> \defineenumeration[answer]
>> 	[alternative=hanging,
>> 	width=4.5cm,
>> 	text={Answer to question},
>> 	headstyle={\bi},
>> 	stopper={.}]
>> 
>> \setupblock[question][before={\startquestion},after={\stopquestion}]
>> \setupblock[hint][before={\starthint},after={\stophint}]
>> \setupblock[answer][before={\startanswer},after={\stopanswer}]
>> 
>> \keepblocks[question]
>> \hideblocks[hint]
>> \hideblocks[answer]
>> 
>> \starttext
>> 
>> \section{Questions}
>> 
>> \beginquestion
>>   Compute $4\times 5$.
>> \endquestion
>> 
>> \beginhint
>>   Use the fact that $2\times 5 = 10$.
>> \endhint
>> 
>> \beginanswer
>>   $20$.
>> \endanswer
>> 
>> \beginquestion
>>   What is the value of $100 / 10$?
>> \endquestion
>> 
>> \beginhint
>> Remember that $10\times 10 = 100$.
>> \endhint
>> 
>> \beginanswer
>> $10$
>> \endanswer
>> 
>> \section{Hints to all questions}
>> 
>> \useblocks[hint]
>> 
>> \section{Answers to all questions}
>> 
>> \useblocks[answer]
>> 
>> \stoptext
>> %%%% end question-hint-answer-blocks.tex
> 
> ___________________________________________________________________________________
> 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://tex.aanhet.net
> archive  : http://foundry.supelec.fr/projects/contextrev/
> wiki     : http://contextgarden.net
> ___________________________________________________________________________________

___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: setuphead for in-paragraph head ?
  2014-01-12 16:08                     ` Otared Kavian
@ 2014-01-12 19:29                       ` Jaroslav Hajtmar
  0 siblings, 0 replies; 25+ messages in thread
From: Jaroslav Hajtmar @ 2014-01-12 19:29 UTC (permalink / raw)
  Cc: mailing list for ConTeXt users

OK.  Thanx very much - for me it is a useful thing...
Jaroslav Hajtmar


Dne 12.1.2014 17:08, Otared Kavian napsal(a):
> Hi Jaroslav,
>
> Actually the formatting of what you put in the block determined for example by
> 	\beginanswer
> 		The answer is…
> 	\endanswer
> is independent of the block mechanism: you can use whatever structure you want. In the example we exchanged on, an enumeration such as
> 	\startanswer
> 	\stopanswer
> where this \start \stop has been defined by \defineenumeration[answer], but you can use your own compact formatting instead of this.
>
> Best regards: OK
>
> On 12 janv. 2014, at 11:45, Jaroslav Hajtmar <hajtmar@gyza.cz> wrote:
>
>> Hello Otared and Wolfgang.
>>
>> Thanks for launching this example.
>> Is there a possibility to write the answers into a more compact form (more columns, one paragraph, etc) like in any textbooks? I tried experimenting, but I was unable to put answers into a compact form.
>> Thanks Jaroslav Hajtmar
>>
>> Here is my modification of answer enumeration (not working):
>>
>> %%%% begin question-hint-answer-blocks.tex
>> \defineblock[question]
>> \defineblock[hint]
>> \defineblock[answer]
>>
>> \defineenumeration[question]
>>     [alternative=hanging,
>>     width=2.5cm,
>>     text={Question},
>>     headstyle={\bi},
>>     stopper={.}]
>>
>> \defineenumeration[hint]
>>     [alternative=hanging,
>>     width=4cm,
>>     text={Hint for question},
>>     headstyle={\bi},
>>     stopper={.}]
>>
>> \defineenumeration[answer]
>>     [alternative=hanging,
>>     beforehead=,
>>     afterhead=,
>>      before={\startcolumns[n=4]},
>>     after=\stopcolumns,
>>     width=0.5em,
>>     text={},
>>     headstyle={},
>>     stopper={.}]
>>
>> \setupblock[question][before={\startquestion},after={\stopquestion}]
>> \setupblock[hint][before={\starthint},after={\stophint}]
>> \setupblock[answer][before={\startanswer},after={\stopanswer}]
>>
>> \keepblocks[question]
>> \hideblocks[hint]
>> \hideblocks[answer]
>>
>> \starttext
>>
>> \section{Questions}
>>
>> \beginquestion
>>   Compute $4\times 5$.
>> \endquestion
>>
>> \beginhint
>>   Use the fact that $2\times 5 = 10$.
>> \endhint
>>
>> \beginanswer
>>   $20$.
>> \endanswer
>>
>> \beginquestion
>>   What is the value of $100 / 10$?
>> \endquestion
>>
>> \beginhint
>> Remember that $10\times 10 = 100$.
>> \endhint
>>
>> \beginanswer
>> $10$
>> \endanswer
>>
>> \beginquestion
>>   Compute $4\times 5$.
>> \endquestion
>>
>> \beginhint
>>   Use the fact that $2\times 5 = 10$.
>> \endhint
>>
>> \beginanswer
>>   $20$.
>> \endanswer
>>
>> \beginquestion
>>   What is the value of $100 / 10$?
>> \endquestion
>>
>> \beginhint
>> Remember that $10\times 10 = 100$.
>> \endhint
>>
>> \beginanswer
>> $10$
>> \endanswer
>>
>> \beginquestion
>>   Compute $4\times 5$.
>> \endquestion
>>
>> \beginhint
>>   Use the fact that $2\times 5 = 10$.
>> \endhint
>>
>> \beginanswer
>>   $20$.
>> \endanswer
>>
>> \beginquestion
>>   What is the value of $100 / 10$?
>> \endquestion
>>
>> \beginhint
>> Remember that $10\times 10 = 100$.
>> \endhint
>>
>> \beginanswer
>> $10$
>> \endanswer
>> \beginquestion
>>   Compute $4\times 5$.
>> \endquestion
>>
>> \beginhint
>>   Use the fact that $2\times 5 = 10$.
>> \endhint
>>
>> \beginanswer
>>   $20$.
>> \endanswer
>>
>> \beginquestion
>>   What is the value of $100 / 10$?
>> \endquestion
>>
>> \beginhint
>> Remember that $10\times 10 = 100$.
>> \endhint
>>
>> \beginanswer
>> $10$
>> \endanswer
>>
>>
>> \section{Hints to all questions}
>>
>> \useblocks[hint]
>>
>> \section{Answers to all questions}
>>
>> \useblocks[answer]
>>
>> \stoptext
>> %%%% end question-hint-answer-blocks.tex
>>
>>
>>
>> Dne 11.1.2014 20:01, Otared Kavian napsal(a):
>>> %%%% begin question-hint-answer-blocks.tex
>>> \defineblock[question]
>>> \defineblock[hint]
>>> \defineblock[answer]
>>>
>>> \defineenumeration[question]
>>> 	[alternative=hanging,
>>> 	width=2.5cm,
>>> 	text={Question},
>>> 	headstyle={\bi},
>>> 	stopper={.}]
>>> 	
>>> \defineenumeration[hint]
>>> 	[alternative=hanging,
>>> 	width=4cm,
>>> 	text={Hint for question},
>>> 	headstyle={\bi},
>>> 	stopper={.}]
>>>
>>> \defineenumeration[answer]
>>> 	[alternative=hanging,
>>> 	width=4.5cm,
>>> 	text={Answer to question},
>>> 	headstyle={\bi},
>>> 	stopper={.}]
>>>
>>> \setupblock[question][before={\startquestion},after={\stopquestion}]
>>> \setupblock[hint][before={\starthint},after={\stophint}]
>>> \setupblock[answer][before={\startanswer},after={\stopanswer}]
>>>
>>> \keepblocks[question]
>>> \hideblocks[hint]
>>> \hideblocks[answer]
>>>
>>> \starttext
>>>
>>> \section{Questions}
>>>
>>> \beginquestion
>>>    Compute $4\times 5$.
>>> \endquestion
>>>
>>> \beginhint
>>>    Use the fact that $2\times 5 = 10$.
>>> \endhint
>>>
>>> \beginanswer
>>>    $20$.
>>> \endanswer
>>>
>>> \beginquestion
>>>    What is the value of $100 / 10$?
>>> \endquestion
>>>
>>> \beginhint
>>> Remember that $10\times 10 = 100$.
>>> \endhint
>>>
>>> \beginanswer
>>> $10$
>>> \endanswer
>>>
>>> \section{Hints to all questions}
>>>
>>> \useblocks[hint]
>>>
>>> \section{Answers to all questions}
>>>
>>> \useblocks[answer]
>>>
>>> \stoptext
>>> %%%% end question-hint-answer-blocks.tex
>> ___________________________________________________________________________________
>> 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://tex.aanhet.net
>> archive  : http://foundry.supelec.fr/projects/contextrev/
>> wiki     : http://contextgarden.net
>> ___________________________________________________________________________________
>

___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: setuphead for in-paragraph head ?
  2014-01-11 19:01                 ` Otared Kavian
  2014-01-12 10:45                   ` Jaroslav Hajtmar
@ 2014-01-12 20:30                   ` Wolfgang Schuster
  2014-01-12 20:47                     ` Otared Kavian
  1 sibling, 1 reply; 25+ messages in thread
From: Wolfgang Schuster @ 2014-01-12 20:30 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 11.01.2014 um 20:01 schrieb Otared Kavian <otared@gmail.com>:

> I will put this example on the wiki, but before doing so I have another question:
> can one add two automatic links at the end of each question so that one can navigate easily to the respective hint or answer corresponding to that question? Indeed if this were possible, one would add also two automatic links to each hint going to its question and the corresponding answer, and two other links to each answer going to its hint and question. One can do this manually by adding a reference to each question, each hint and each answer, but it would be nice to have this done automatically.

Not without writing your own environment where you generate a unique reference for each question, hint and answer.

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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: setuphead for in-paragraph head ?
  2014-01-12 20:30                   ` Wolfgang Schuster
@ 2014-01-12 20:47                     ` Otared Kavian
  2014-01-12 21:40                       ` Wolfgang Schuster
  0 siblings, 1 reply; 25+ messages in thread
From: Otared Kavian @ 2014-01-12 20:47 UTC (permalink / raw)
  To: mailing list for ConTeXt users


On 12 janv. 2014, at 21:30, Wolfgang Schuster <schuster.wolfgang@gmail.com> wrote:

> 
> Am 11.01.2014 um 20:01 schrieb Otared Kavian <otared@gmail.com>:
> 
>> I will put this example on the wiki, but before doing so I have another question:
>> can one add two automatic links at the end of each question so that one can navigate easily to the respective hint or answer corresponding to that question? Indeed if this were possible, one would add also two automatic links to each hint going to its question and the corresponding answer, and two other links to each answer going to its hint and question. One can do this manually by adding a reference to each question, each hint and each answer, but it would be nice to have this done automatically.
> 
> Not without writing your own environment where you generate a unique reference for each question, hint and answer.

If I understand well, one way might be something like (where \theQuestionNumber stands for the number given by \startquestion)

\define\StartQuestion{\startquestion[Q:\theQuestionNumber]}
\define\StartHint{\startquestion[H:\theQuestionNumber]}
\define\StartAnswer{\startquestion[A:\theQuestionNumber]}
\define\StopQuestion{\par\in{Hint}[H:\theQuestionNumber]\par \in{Answer}[A:\theQuestionNumber]\stopquestion}
\define\StopHint{\par\in{Question}[Q:\theQuestionNumber]\par \in{Answer}[A:\theQuestionNumber]\stophint}
\define\StopAnswer{\par\in{Question}[Q:\theQuestionNumber]\par \in{Hint}[H:\theQuestionNumber]\stopquestion}

and then using \StartQuestion \StopQuestion, etc, instead of \startquestion \stopquestion.
But how can I refer to the \theQuestionNumber set by \startquestion?

Thanks for your time and your attention.

Best regards: OK


___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: setuphead for in-paragraph head ?
  2014-01-12 20:47                     ` Otared Kavian
@ 2014-01-12 21:40                       ` Wolfgang Schuster
  2014-01-13  3:41                         ` Otared Kavian
  0 siblings, 1 reply; 25+ messages in thread
From: Wolfgang Schuster @ 2014-01-12 21:40 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 12.01.2014 um 21:47 schrieb Otared Kavian <otared@gmail.com>:

> 
> On 12 janv. 2014, at 21:30, Wolfgang Schuster <schuster.wolfgang@gmail.com> wrote:
> 
>> 
>> Am 11.01.2014 um 20:01 schrieb Otared Kavian <otared@gmail.com>:
>> 
>>> I will put this example on the wiki, but before doing so I have another question:
>>> can one add two automatic links at the end of each question so that one can navigate easily to the respective hint or answer corresponding to that question? Indeed if this were possible, one would add also two automatic links to each hint going to its question and the corresponding answer, and two other links to each answer going to its hint and question. One can do this manually by adding a reference to each question, each hint and each answer, but it would be nice to have this done automatically.
>> 
>> Not without writing your own environment where you generate a unique reference for each question, hint and answer.
> 
> If I understand well, one way might be something like (where \theQuestionNumber stands for the number given by \startquestion)
> 
> \define\StartQuestion{\startquestion[Q:\theQuestionNumber]}
> \define\StartHint{\startquestion[H:\theQuestionNumber]}
> \define\StartAnswer{\startquestion[A:\theQuestionNumber]}
> \define\StopQuestion{\par\in{Hint}[H:\theQuestionNumber]\par \in{Answer}[A:\theQuestionNumber]\stopquestion}
> \define\StopHint{\par\in{Question}[Q:\theQuestionNumber]\par \in{Answer}[A:\theQuestionNumber]\stophint}
> \define\StopAnswer{\par\in{Question}[Q:\theQuestionNumber]\par \in{Hint}[H:\theQuestionNumber]\stopquestion}
> 
> and then using \StartQuestion \StopQuestion, etc, instead of \startquestion \stopquestion.
> But how can I refer to the \theQuestionNumber set by \startquestion?


When you have only questions and answers you can use the coupling key but in your case something like below is necessary:

\defineenumeration[Question]
\defineenumeration[Answer]

\define\startquestion
  {\increment\QuestionCounter
   \expanded{\startQuestion[reference=Question:\QuestionCounter]}}

\define\stopquestion
  {\stopQuestion
   \par
   \in{Answer}[Answer:\QuestionCounter]}

\define\startanswer
  {\expanded{\startAnswer[reference=Answer:\QuestionCounter]}}

\define\stopanswer
  {\stopAnswer
   \par
   \in{Question}[Question:\QuestionCounter]}

\setupinteraction[state=start]

\starttext

\startquestion
What is the answer to life the universe and everything?
\stopquestion

\page

\startanswer
42.
\stopanswer

\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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: setuphead for in-paragraph head ?
  2014-01-12 21:40                       ` Wolfgang Schuster
@ 2014-01-13  3:41                         ` Otared Kavian
  2014-01-13 10:07                           ` Wolfgang Schuster
  0 siblings, 1 reply; 25+ messages in thread
From: Otared Kavian @ 2014-01-13  3:41 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi Wolfgang,

Thanks for the tip: I’ll try to adapt what you suggest to the case of blocks and question-hint-answer, and then let you know if I succeed.
Out of curiosity, how can one access the counter associated to an enumeration or an item?

Also, if I understand correctly, the command
	\increment\QuestionCounter
creates first a counter named QuestionCounter, if it does not exist yet, and then increments its value: so one does not need anymore commands such as
	\newcounter\QuestionCounter
before incrementing it. Am I right?

Best regards: OK

On 12 janv. 2014, at 22:40, Wolfgang Schuster <schuster.wolfgang@gmail.com> wrote:

> […]
> When you have only questions and answers you can use the coupling key but in your case something like below is necessary:
> 
> \defineenumeration[Question]
> \defineenumeration[Answer]
> 
> \define\startquestion
>  {\increment\QuestionCounter
>   \expanded{\startQuestion[reference=Question:\QuestionCounter]}}
> 
> \define\stopquestion
>  {\stopQuestion
>   \par
>   \in{Answer}[Answer:\QuestionCounter]}
> 
> \define\startanswer
>  {\expanded{\startAnswer[reference=Answer:\QuestionCounter]}}
> 
> \define\stopanswer
>  {\stopAnswer
>   \par
>   \in{Question}[Question:\QuestionCounter]}
> 
> \setupinteraction[state=start]
> 
> \starttext
> 
> \startquestion
> What is the answer to life the universe and everything?
> \stopquestion
> 
> \page
> 
> \startanswer
> 42.
> \stopanswer
> 
> \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://tex.aanhet.net
> archive  : http://foundry.supelec.fr/projects/contextrev/
> wiki     : http://contextgarden.net
> ___________________________________________________________________________________

___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: setuphead for in-paragraph head ?
  2014-01-13  3:41                         ` Otared Kavian
@ 2014-01-13 10:07                           ` Wolfgang Schuster
  0 siblings, 0 replies; 25+ messages in thread
From: Wolfgang Schuster @ 2014-01-13 10:07 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1004 bytes --]


Am 13.01.2014 um 04:41 schrieb Otared Kavian <otared@gmail.com>:

> Hi Wolfgang,
> 
> Thanks for the tip: I’ll try to adapt what you suggest to the case of blocks and question-hint-answer, and then let you know if I succeed.
> Out of curiosity, how can one access the counter associated to an enumeration or an item?

You can use \rawcountervalue[<name of the enumeration environment>] or \convertedcounter[<name of the environment>].

> Also, if I understand correctly, the command
> 	\increment\QuestionCounter
> creates first a counter named QuestionCounter, if it does not exist yet, and then increments its value: so one does not need anymore commands such as
> 	\newcounter\QuestionCounter
> before incrementing it. Am I right?

No, you don’t need \newcounter because \increment checks if the counter exists because it tries to increase the value. The \newcounter command which creates the counter can also be used to reset the value and not only to create the counter.

Wolfgang

[-- Attachment #1.2: Type: text/html, Size: 2191 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: setuphead for in-paragraph head ?
  2014-01-09 12:44 Jean-Guillaume
@ 2014-01-09 13:03 ` Marco Patzer
  0 siblings, 0 replies; 25+ messages in thread
From: Marco Patzer @ 2014-01-09 13:03 UTC (permalink / raw)
  To: ntg-context


[-- Attachment #1.1: Type: text/plain, Size: 443 bytes --]

On 2014–01–09 Jean-Guillaume wrote:

>  \starttext
>  \definehead[Exercise][subsection]
>  \setuphead
>     [Exercise]
>     [after=]
> \startExercise[]{(this is the exercise's title)}
> The exercise's content.
> \stopExercise
> \stoptext

\definehead
  [Exercise] [subsection]
  [after=]

\starttext
  \startExercise [title=This is the exercise's title]
    The exercise's content.
  \stopExercise
\stoptext

Marco

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: setuphead for in-paragraph head ?
@ 2014-01-09 12:44 Jean-Guillaume
  2014-01-09 13:03 ` Marco Patzer
  0 siblings, 1 reply; 25+ messages in thread
From: Jean-Guillaume @ 2014-01-09 12:44 UTC (permalink / raw)
  To: ntg-context

Thanks for your reply, Marco.

Here is a full example:

 \starttext
 \definehead[Exercise][subsection]
 \setuphead
    [Exercise]
    [after=]
\startExercise[]{(this is the exercise's title)}
The exercise's content.
\stopExercise
\stoptext


After contexting it, it looks like:

1
(this is the exercise's title) The exercise's content.


Actually, I would like to have the head's number and the head's title
on the same line. That is, whith no new line.

Jean-Guillaume
___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: setuphead for in-paragraph head ?
  2014-01-09  9:43 Jean-Guillaume
@ 2014-01-09 11:27 ` Marco Patzer
  0 siblings, 0 replies; 25+ messages in thread
From: Marco Patzer @ 2014-01-09 11:27 UTC (permalink / raw)
  To: ntg-context


[-- Attachment #1.1: Type: text/plain, Size: 757 bytes --]

On 2014–01–09 Jean-Guillaume wrote:

> In the subsection head, I would like to suppress the newline between the
> number and the text,

That's controlled by the “after” key.

 \setuphead
  [Exercise]
  [after=]

> My purpose is to define something like:
> 
>  \definehead[Exercise][subsection]
>  \setuphead
>   [Exercise]
>   [alternative=Mine?,
>   ...,
>   numberstyle=bold]

Please provide full working examples next time. That makes it easier
for us and it's more likely you'll get a response.

> So I can typeset a list of exercises in a compact way. I could use
> enumerations but I don't think I should.

That depends on your document. You can use sections, enumerations or
Wolfgang's annotation module.

Marco

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 25+ messages in thread

* setuphead for in-paragraph head ?
@ 2014-01-09  9:43 Jean-Guillaume
  2014-01-09 11:27 ` Marco Patzer
  0 siblings, 1 reply; 25+ messages in thread
From: Jean-Guillaume @ 2014-01-09  9:43 UTC (permalink / raw)
  To: ntg-context


[-- Attachment #1.1: Type: text/plain, Size: 616 bytes --]

Hi all,
this is my first message here.

In the subsection head, I would like to suppress the newline between the
number and the text, so it behaves like some kind of numbered subsubject.
I tried to modify some examples from the wiki, but without success. In
http://wiki.contextgarden.net/Command/setuphead , most of the options are
not explained.

My purpose is to define something like:

 \definehead[Exercise][subsection]
 \setuphead
  [Exercise]
  [alternative=Mine?,
  ...,
  numberstyle=bold]

So I can typeset a list of exercises in a compact way. I could use
enumerations but I don't think I should.

Thanks.

[-- Attachment #1.2: Type: text/html, Size: 820 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2014-01-13 10:07 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-09 13:23 setuphead for in-paragraph head ? Jean-Guillaume
2014-01-09 13:24 ` Wolfgang Schuster
2014-01-09 14:19 ` Otared Kavian
2014-01-09 14:48   ` Jaroslav Hajtmar
2014-01-09 15:36     ` Otared Kavian
2014-01-09 17:12       ` Aditya Mahajan
2014-01-09 17:23       ` Wolfgang Schuster
2014-01-09 17:36         ` Otared Kavian
2014-01-09 17:41           ` Wolfgang Schuster
2014-01-10  6:56             ` Jaroslav Hajtmar
2014-01-10 23:36             ` Otared Kavian
2014-01-11  9:12               ` Wolfgang Schuster
2014-01-11 19:01                 ` Otared Kavian
2014-01-12 10:45                   ` Jaroslav Hajtmar
2014-01-12 16:08                     ` Otared Kavian
2014-01-12 19:29                       ` Jaroslav Hajtmar
2014-01-12 20:30                   ` Wolfgang Schuster
2014-01-12 20:47                     ` Otared Kavian
2014-01-12 21:40                       ` Wolfgang Schuster
2014-01-13  3:41                         ` Otared Kavian
2014-01-13 10:07                           ` Wolfgang Schuster
  -- strict thread matches above, loose matches on Subject: below --
2014-01-09 12:44 Jean-Guillaume
2014-01-09 13:03 ` Marco Patzer
2014-01-09  9:43 Jean-Guillaume
2014-01-09 11:27 ` Marco Patzer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).