Yury G. Kudryashov wrote:

> Hi!
> 
> I try the following:
> 
> \definereferenceformat[ineq][left=(,right=),text=Equation]
> \starttext
> \placeformula[first]
> \startformula
> 2=2
> \stopformula
> In \in[first] ineq \ineq[first] in \in[first].
> \stoptext
> 
> The result is:
> 2 = 2 (1)
> In 1 ineq (1) in (1).
> 
> It seems that \ineq doesn't clear some variables, and the next \in uses
> the previous format.

Please, apply the attached patch upstream. It fixed the problem for me.

Another problem fixed by my patch:

\definereferenceformat[ineq][text=equation]
\starttext
\placeformula[first]
\startformula 1=1\stopformula
\ineq[first]
\stoptext
printed "1", not "equation 1".
--- a/tex/texmf-context/tex/context/base/strc-ref.mkiv	2010-05-21 15:44:04.000000000 +0400
+++ b/tex/texmf-context/tex/context/base/strc-ref.mkiv	2010-05-31 22:18:38.000000000 +0400
@@ -983,10 +983,13 @@
   {\ifx\next\bgroup
      \afterassignment\doinatreferenceonetwo
      \expandafter\leftreferencetoks
-   \else
+   \else\ifx\textofreference\empty
      \leftreferencetoks\emptytoks
      \expandafter\dodoinatreferencenone
-   \fi}
+   \else
+     \leftreferencetoks{\textofreference}%
+     \expandafter\doinatreferenceonetwo
+   \fi\fi}
 
 \def\doinatreferenceonetwo
   {\futurelet\next\doinatreferencetwo}
@@ -1022,7 +1025,11 @@
    \doifreferencefoundelse{#4}
      {\doifelsenothing{#1}\dosymbolreference\dowantedreference{#1}{#2}[#4]}%
      {\dounknownreference{#1}{#2}[#4]}%
-   \endgroup}
+   \endgroup%
+   \global\let\leftofreference\relax
+   \global\let\rightofreference\relax
+   \global\let\textofreference\empty
+   }
 
 \let\dosymbolreference\dowantedreference
 

___________________________________________________________________________________
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 via email to