ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Question and answers
@ 2006-03-19 23:24 David Arnold
  2006-03-20 14:34 ` Mojca Miklavec
  0 siblings, 1 reply; 2+ messages in thread
From: David Arnold @ 2006-03-19 23:24 UTC (permalink / raw)


All,

I have:

\defineenumeration[questions][location=serried,text=\blank]
\setupenumerations[questions][before={\unnumberedsubsection{Exercises} 
\startcolumns[n=2]},after=\stopcolumns,number=no]

\defineenumeration[answers][location=serried,text=\blank]
\setupenumerations[answers][before={\unnumberedsubsection{Answers} 
\startcolumns[n=2]},after=\stopcolumns,number=no]

\def\placeanswers{\startanswers\doifmodeelse{short}{\selectblocks 
[shortanswer][criterium=section]}{\selectblocks[longanswer] 
[criterium=section]}\stopanswers}

\defineenumeration[question][location=inleft,text={\color[heavygreen] 
\bgroup}]
\setupenumerations[question][stopper={.\egroup}]

\defineenumeration[subquestion][location=hanging,text={\color 
[heavygreen]\bgroup},conversion=characters]
\setupenumerations[subquestion][stopper={.\egroup}]

\defineenumeration[answer][location=inleft,text={\color[heavygreen] 
\bgroup}]
\setupenumerations[answer][stopper={.\egroup}]

\defineenumeration[subanswer][location=hanging,text={\color 
[heavygreen]\bgroup},conversion=characters]
\setupenumerations[subanswer][stopper={.\egroup}]

\defineblock[question,shortanswer,longanswer]
\hideblocks[shortanswer,longanswer]

I put a \placeanswers at the end of each section, but the numbering  
is contiguous across sections. For example, section 1 might end with  
exercise #15, then section 2 begins with exercise #16. How can I  
reset the numbers to start with #1 in section 2?

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

* Re: Question and answers
  2006-03-19 23:24 Question and answers David Arnold
@ 2006-03-20 14:34 ` Mojca Miklavec
  0 siblings, 0 replies; 2+ messages in thread
From: Mojca Miklavec @ 2006-03-20 14:34 UTC (permalink / raw)


On 3/20/06, David Arnold wrote:
> All,
>
> I have:
>
> \defineenumeration[questions][location=serried,text=\blank]
> \setupenumerations[questions][before={\unnumberedsubsection{Exercises}
> \startcolumns[n=2]},after=\stopcolumns,number=no]
>
> \defineenumeration[answers][location=serried,text=\blank]
> \setupenumerations[answers][before={\unnumberedsubsection{Answers}
> \startcolumns[n=2]},after=\stopcolumns,number=no]
>
> \def\placeanswers{\startanswers\doifmodeelse{short}{\selectblocks
> [shortanswer][criterium=section]}{\selectblocks[longanswer]
> [criterium=section]}\stopanswers}
>
> \defineenumeration[question][location=inleft,text={\color[heavygreen]
> \bgroup}]
> \setupenumerations[question][stopper={.\egroup}]
>
> \defineenumeration[subquestion][location=hanging,text={\color
> [heavygreen]\bgroup},conversion=characters]
> \setupenumerations[subquestion][stopper={.\egroup}]
>
> \defineenumeration[answer][location=inleft,text={\color[heavygreen]
> \bgroup}]
> \setupenumerations[answer][stopper={.\egroup}]
>
> \defineenumeration[subanswer][location=hanging,text={\color
> [heavygreen]\bgroup},conversion=characters]
> \setupenumerations[subanswer][stopper={.\egroup}]
>
> \defineblock[question,shortanswer,longanswer]
> \hideblocks[shortanswer,longanswer]
>
> I put a \placeanswers at the end of each section, but the numbering
> is contiguous across sections. For example, section 1 might end with
> exercise #15, then section 2 begins with exercise #16. How can I
> reset the numbers to start with #1 in section 2?

Add
    way=bysection,sectionnumber=no
to \defineenumeration or to \setupenumeration.

(You can also reset the numbers manually with \resetquestion.)

Mojca

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

end of thread, other threads:[~2006-03-20 14:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-03-19 23:24 Question and answers David Arnold
2006-03-20 14:34 ` Mojca Miklavec

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).