From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/72790 Path: news.gmane.org!not-for-mail From: Otared Kavian Newsgroups: gmane.comp.tex.context Subject: Re: Resetting references or local references? Date: Mon, 28 Nov 2011 10:18:58 +0100 Message-ID: References: <256E87E8-CCD2-4843-A1D8-0F90129333E3@googlemail.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v1251.1) Content-Type: multipart/mixed; boundary="===============0412587785==" X-Trace: dough.gmane.org 1322471973 5045 80.91.229.12 (28 Nov 2011 09:19:33 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 28 Nov 2011 09:19:33 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Mon Nov 28 10:19:28 2011 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RUxN2-0006Vd-2o for gctc-ntg-context-518@m.gmane.org; Mon, 28 Nov 2011 10:19:28 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 4D776CB0F3; Mon, 28 Nov 2011 10:19:27 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id ZyI2232Tw4XS; Mon, 28 Nov 2011 10:19:26 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 2C2A4CB0E8; Mon, 28 Nov 2011 10:19:23 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 26D65CB0E8 for ; Mon, 28 Nov 2011 10:19:21 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 2RFLoJmCg3hj for ; Mon, 28 Nov 2011 10:19:04 +0100 (CET) Original-Received: from filter2-ams.mf.surf.net (filter2-ams.mf.surf.net [192.87.102.70]) by balder.ntg.nl (Postfix) with ESMTP id 9C8E9CB04D for ; Mon, 28 Nov 2011 10:19:04 +0100 (CET) Original-Received: from mail-qw0-f48.google.com (mail-qw0-f48.google.com [209.85.216.48]) by filter2-ams.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id pAS9J2wY028994 for ; Mon, 28 Nov 2011 10:19:03 +0100 Original-Received: by qam2 with SMTP id 2so1180146qam.14 for ; Mon, 28 Nov 2011 01:19:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:mime-version:content-type:subject:date:in-reply-to:to :references:message-id:x-mailer; bh=UOvCihp0hTt44+vlfx/a2tdzDmzVH9IdXJHWjomcVnQ=; b=bqa9hV4c1qfQybSv9aTdD+hE0+KpVMX+/pbSZP5PByqtIVpAdTkqYNl9B21ZlYdNbF nDYtZvv9sNRX3M/JL+GoGrJvYguWqEVdeTT0iEmB8erT5juummeN8AoWGksTnltNKRHy AxYDOW6QQ2bcz18wb3+WM3n3bQwdRDljj4LeU= Original-Received: by 10.224.217.131 with SMTP id hm3mr18831930qab.81.1322471942458; Mon, 28 Nov 2011 01:19:02 -0800 (PST) Original-Received: from lmv-uvsq-102.home (AOrleans-553-1-20-4.w90-24.abo.wanadoo.fr. [90.24.62.4]) by mx.google.com with ESMTPS id hk8sm2799174qab.17.2011.11.28.01.19.00 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 28 Nov 2011 01:19:01 -0800 (PST) In-Reply-To: <256E87E8-CCD2-4843-A1D8-0F90129333E3@googlemail.com> X-Mailer: Apple Mail (2.1251.1) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=209.85.216.48; country=US; region=CA; city=Mountain View; postalcode=94043; latitude=37.4192; longitude=-122.0574; metrocode=807; areacode=650; http://maps.google.com/maps?q=37.4192,-122.0574&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0rG2xj333 - 00f5a046abe7 - 20111128 X-Scanned-By: CanIt (www . roaringpenguin . com) on 192.87.102.70 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.12 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:72790 Archived-At: --===============0412587785== Content-Type: multipart/alternative; boundary="Apple-Mail=_718768A9-376D-4EC3-9449-EDBD4DB5268D" --Apple-Mail=_718768A9-376D-4EC3-9449-EDBD4DB5268D Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 Hi Wolfgang, Many thanks for your attention and the link you sent. I looked up the chapter on references of the main manuel written by = Hans, but unfortunately I could not find a solution, or could not adapt = what is said there.=20 It can be that I have to change my approach of defining my =AB exercises = =BB, for instance by defining each exercise as a section or subsection?=20= Up to now I have two ways of defining an =AB exercise =BB:=20 =95 one is with \defineenumeration[Exo] (when using mkii),=20 =95 the other one is with \defineannotation[Exo] and your = annotation module when using mkiv. In neither case the command \setupreferencing[prefix=3D+] or \setupannotation[Exo][prefix=3D+] seems to generate local tags.=20 Just in case, below is a minimal file, which shows how I use the = annotation module. Best regards: OK %%%%%%%%%% begin \setupinteraction[state=3Dstart] \usemodule[annotation] % Wolfgang's module \define[2]\ExoSetup {\resetnumber[formula] \setupframedtext[ width=3D\textwidth, frame=3Doff, leftframe=3Don] \textrule{#1}% \startframedtext #2% \stopframedtext} =20 \defineannotation[Exo] [alternative=3Dcommand, command=3D\ExoSetup, text=3DExercise , number=3Dyes, headcolor=3Ddarkred, ] % \setupannotation[Exo][prefix=3D+] \setupreferencing[prefix=3D+] \starttext \startExo[exo:CharacTwo] Prove that if $ab=3Dba$ and $2ab=3D0$ then \placeformula[eq:1] \startformula (a+b)^2 =3D a^2 + b^2. \stopformula Using the identity (\in[eq:1]) prove that $(a=3Db)^{2n} =3D a^{2n} + = b^{2n}$. \stopExo \page \startExo[exo:Moivre]{Moivre's formula} Prove that for any integer $n$ \placeformula[eq:2] % I would like the reference to be [eq:1] \startformula (\cos(x) + {\rm i}\sin(x))^n =3D \cos(nx) + {\rm i} \sin(nx). \stopformula Using the identity (\in[eq:2]) % I would like here to say [eq:1] compute $\cos{3x}$. \stopExo \stoptext %%%%%%%%%% end On 28 nov. 2011, at 00:10, Wolfgang Schuster wrote: >=20 > Am 27.11.2011 um 23:27 schrieb Otared Kavian: >=20 >> Dear all, >>=20 >> Is it possible to have a sort of =AB local references for formulas =BB = or else to clear previous references to formulas at a certain point? >> In a chapter where a certain number of exercices and formulas are to = be numbered, assume I have the following minimal example >>=20 >> %%%%%%%%% begin >> \starttext >>=20 >> Exercice 1. Prove that if $ab=3Dba$ and $2ab=3D0$ then >> \placeformula[eq:1] >> \startformula >> (a+b)^2 =3D a^2 + b^2. >> \stopformula >> Using the identity (\in[eq:1]) prove that $(a=3Db)^{2n} =3D a^{2n} + = b^{2n}$. >>=20 >> \blank[big] >> \hrule >> \blank[big] >>=20 >> Exercice 2. Prove that for any integer $n$ >> \resetnumber[formula] >> %\reset[formulas][references] >> \placeformula[eq:2] % I would like the reference to be [eq:1] >> \startformula >> (\cos(x) + {\rm i}\sin(x))^n =3D \cos(nx) + {\rm i} \sin(nx). >> \stopformula >> Using the identity (\in[eq:2]) % I would like here to say [eq:1] >> compute $\cos{3x}$. >>=20 >> \stoptext >> %%%%%%%%% end >>=20 >> I would like to be able to have the equations numbered within each = exercise (which is in fact defined through an enumeration environment), = and be able to have the reference to each formula =AB local =BB within = that exercise. >> The resaon is that the execises and problems may have several = equations which are referenced to with [eq:1] through [eq:10] (say=85), = and have been prepared and given previously to students on independent = sheets. When I want to give out a booklet of all the exercises, then it = would be handy to have such a feature. >>=20 >> I understand that I am not being very clear=85 Hope someone would = understand what I mean and need :-) >=20 > Look at page 168: http://pragma-ade.com/general/manuals/cont-enp.pdf >=20 > Wolfgang > = __________________________________________________________________________= _________ > If your question is of interest to others as well, please add an entry = to the Wiki! >=20 > 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 > = __________________________________________________________________________= _________ %%%%%%%%%%%%%%%%%% Otared Kavian D=E9partement de Math=E9matiques Universit=E9 de Versailles Saint-Quentin B=E2timent Fermat 45 avenue des Etats Unis 78035 Versailles cedex T=E9l=E9phone: +33 1 39 25 46 42 Secr=E9tariat: +33 1 39 25 46 44=20 Secr=E9tariat: +33 1 39 25 46 46 e-mail: Otared.Kavian@math.uvsq.fr --Apple-Mail=_718768A9-376D-4EC3-9449-EDBD4DB5268D Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=windows-1252 Hi = Wolfgang,

Many thanks for your attention and the link = you sent.
I looked up the chapter on references of the main = manuel written by Hans, but unfortunately I could not find a solution, = or could not adapt what is said there. 
It can be that I = have to change my approach of defining my =AB exercises =BB, for = instance by defining each exercise as a section or = subsection? 
Up to now I have two ways of defining an =AB = exercise =BB: 
=95 one is with = \defineenumeration[Exo] (when using mkii), 
= =95 the other one is with \defineannotation[Exo] and your = annotation module when using mkiv.

In neither = case the command
= \setupreferencing[prefix=3D+]
or
= \setupannotation[Exo][prefix=3D+]
seems to generate = local tags. 

Just in case, below is a = minimal file, which shows how I use the annotation = module.

Best regards: OK
%%%%%%%%%% = begin
\setupinteraction[state=3Dstart]

<= /div>
\usemodule[annotation] % Wolfgang's = module

\define[2]\ExoSetup
= {\resetnumber[formula]
\setupframedtext[
= width=3D\textwidth,
= frame=3Doff,
= leftframe=3Don]
\textrule{#1}%
= \startframedtext
#2%
= \stopframedtext}
=  
\defineannotation[Exo]
= [alternative=3Dcommand,
= command=3D\ExoSetup,
text=3DExercise ,
= number=3Dyes,
= headcolor=3Ddarkred,
]

% = \setupannotation[Exo][prefix=3D+]
\setupreferencing[prefix=3D+]<= /div>

\starttext

\startE= xo[exo:CharacTwo] Prove that if $ab=3Dba$ and $2ab=3D0$ = then
\placeformula[eq:1]
\startformula
(a+b)= ^2 =3D a^2 + b^2.
\stopformula
Using the identity = (\in[eq:1]) prove that $(a=3Db)^{2n} =3D a^{2n} + = b^{2n}$.
\stopExo

\page

<= /div>
\startExo[exo:Moivre]{Moivre's formula} Prove that for any = integer $n$
\placeformula[eq:2] % I would like the reference = to be [eq:1]
\startformula
(\cos(x) + {\rm = i}\sin(x))^n =3D \cos(nx) + {\rm i} = \sin(nx).
\stopformula
Using the identity = (\in[eq:2]) % I would like here to say [eq:1]
 compute = $\cos{3x}$.
\stopExo

\stoptext
%%%%%%%%%% end

On 28 nov. 2011, at = 00:10, Wolfgang Schuster wrote:


Am = 27.11.2011 um 23:27 schrieb Otared Kavian:

Dear all,

Is it possible = to have a sort of =AB local references for formulas =BB or else to clear = previous references to formulas at a certain = point?
In a chapter where a = certain number of exercices and formulas are to be numbered, assume I = have the following minimal example

%%%%%%%%% = begin
\starttext

Exercice 1. = Prove that if $ab=3Dba$ and $2ab=3D0$ then
\placeformula[eq:1]
\startformula
(a+b)^2 =3D a^2 + b^2.
\stopformula
Using= the identity (\in[eq:1]) prove that $(a=3Db)^{2n} =3D a^{2n} + = b^{2n}$.

\blank[big]
\hrule
\blank[big]

Exercice 2. = Prove that for any integer $n$
\resetnumber[formula]
%\reset[formulas][references]
\placeformula[eq:2] % I would like the reference to be = [eq:1]
\startformula
(\cos(x) + {\rm i}\sin(x))^n =3D \cos(nx) + {\rm i} = \sin(nx).
\stopformula
Using= the identity (\in[eq:2]) % I would like here to say = [eq:1]
compute = $\cos{3x}$.

\stoptext
%%%%%%%%% end

I would like to = be able to have the equations numbered within each exercise (which is in = fact defined through an enumeration environment), and be able to have = the reference to each formula =AB local =BB within that = exercise.
The resaon is that = the execises and problems may have several equations which are = referenced to with [eq:1] through [eq:10] (say=85), and have been = prepared and given previously to students on independent sheets. When I = want to give out a booklet of all the exercises, then it would be handy = to have such a feature.

I understand = that I am not being very clear=85 Hope someone would understand what I = mean and need :-)

Look at page 168: http://pragma-= ade.com/general/manuals/cont-enp.pdf

Wolfgang
______________= _____________________________________________________________________
I= f 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.sup= elec.fr/projects/contextrev/
wiki     : http://contextgarden.net
________= __________________________________________________________________________= _

%%%%%%%%%%%%%%%%%%
Otared = Kavian
D=E9partement de Math=E9matiques
Universit=E9 = de Versailles Saint-Quentin
B=E2timent Fermat
45 = avenue des Etats Unis
78035 Versailles = cedex

T=E9l=E9phone: +33 1 39 25 46 = 42
Secr=E9tariat: +33 1 39 25 46 = 44 
Secr=E9tariat: +33 1 39 25 46 = 46




= --Apple-Mail=_718768A9-376D-4EC3-9449-EDBD4DB5268D-- --===============0412587785== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ___________________________________________________________________________________ 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 ___________________________________________________________________________________ --===============0412587785==--