ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Matthias Weber <matweber@indiana.edu>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: More numbering trouble with blocks
Date: Sun, 24 Jan 2010 15:37:56 -0500	[thread overview]
Message-ID: <D7D55559-9FB9-4D71-975E-0A8FF87074C2@indiana.edu> (raw)

[-- Attachment #1: Type: text/plain, Size: 378 bytes --]

Dear all,

when pairing exercises with recalled solution blocks it seems that  
both are numbered consecutively
but independently.
When I don't give a solution to an exercise, the subsequent solution  
numbers are incorrect.
What is the proper way to deal with this? Manipulate the counter in  
the exercises without answers somehow?
Basic example attached.

Thanks,

Matthias


[-- Attachment #2: numbers.tex --]
[-- Type: application/octet-stream, Size: 749 bytes --]

\setupbodyfont		[10pt]

\defineenumeration
[exercise]
[before=\blank,
after=\blank,
way=bysection,
text=Exercise,
start=1,
location=hanging,
letter=rm]

\defineenumeration
[solution]
[text=Solution,
way=bysection,
location=hanging,
letter=rm]

\defineblock[exercise]
\defineblock[solution]
\hideblocks[solution]

\starttext

\section{Addition}


\startexercise
$1+1=?$
\stopexercise

\beginsolution[one]
\startsolution
$1+1=2$
\stopsolution
\endsolution

\startexercise
$1+2=?$
\stopexercise
\beginsolution[one]
\endsolution

\startexercise
$2+2=?$
\stopexercise

\beginsolution[one]
\startsolution
$2+2=4$
\stopsolution
\endsolution

\section{Solutions to Selected Exercises from Chapter One}

\reset[solution]
\useblocks[solution][one]

\stoptext

[-- Attachment #3: Type: text/plain, Size: 1 bytes --]



[-- Attachment #4: Type: text/plain, Size: 486 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
___________________________________________________________________________________

             reply	other threads:[~2010-01-24 20:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-24 20:37 Matthias Weber [this message]
2010-01-25  0:30 ` Hans Hagen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=D7D55559-9FB9-4D71-975E-0A8FF87074C2@indiana.edu \
    --to=matweber@indiana.edu \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).