* referenceformat MkIV
@ 2010-05-29 12:17 Yury G. Kudryashov
2010-05-31 18:32 ` Yury G. Kudryashov
0 siblings, 1 reply; 5+ messages in thread
From: Yury G. Kudryashov @ 2010-05-29 12:17 UTC (permalink / raw)
To: ntg-context
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.
___________________________________________________________________________________
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] 5+ messages in thread
* Re: referenceformat MkIV
2010-05-29 12:17 referenceformat MkIV Yury G. Kudryashov
@ 2010-05-31 18:32 ` Yury G. Kudryashov
2010-05-31 18:53 ` taco
0 siblings, 1 reply; 5+ messages in thread
From: Yury G. Kudryashov @ 2010-05-31 18:32 UTC (permalink / raw)
To: ntg-context
[-- Attachment #1: Type: text/plain, Size: 682 bytes --]
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".
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: referenceformat-fix.patch --]
[-- Type: text/x-patch; name="referenceformat-fix.patch", Size: 1019 bytes --]
--- 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
[-- Attachment #3: 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
___________________________________________________________________________________
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: referenceformat MkIV
2010-05-31 18:32 ` Yury G. Kudryashov
@ 2010-05-31 18:53 ` taco
2010-05-31 19:34 ` Yury G. Kudryashov
2010-06-07 14:34 ` Yury G. Kudryashov
0 siblings, 2 replies; 5+ messages in thread
From: taco @ 2010-05-31 18:53 UTC (permalink / raw)
To: mailing list for ConTeXt users
Hi,
Yury G. Kudryashov wrote:
>>
>> 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.
This problem was already fixed in the latest (internal?) beta.
> 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".
This problem is still there and needs fixing, but I think your patch
has a bug (possibly because of the already done other bugfix).
After patching, I think \doinatreferenceone should look like
this:
\def\doinatreferenceone
{\ifx\next\bgroup
\afterassignment\doinatreferenceonetwo
\expandafter\leftreferencetoks
\else\ifx\textofreference\empty
\leftreferencetoks\emptytoks
\expandafter\expandafter\expandafter\dodoinatreferencenone
\else
\leftreferencetoks{\textofreference}%
\expandafter\expandafter\expandafter\doinatreferenceonetwo
\fi\fi}
Best wishes,
Taco
___________________________________________________________________________________
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] 5+ messages in thread
* Re: referenceformat MkIV
2010-05-31 18:53 ` taco
@ 2010-05-31 19:34 ` Yury G. Kudryashov
2010-06-07 14:34 ` Yury G. Kudryashov
1 sibling, 0 replies; 5+ messages in thread
From: Yury G. Kudryashov @ 2010-05-31 19:34 UTC (permalink / raw)
To: ntg-context
taco wrote:
>
> Hi,
> Yury G. Kudryashov wrote:
>>> 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.
> This problem was already fixed in the latest (internal?) beta.
I shall test once this beta will be published.
>> 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".
>
> This problem is still there and needs fixing, but I think your patch
> has a bug (possibly because of the already done other bugfix).
>
> After patching, I think \doinatreferenceone should look like
> this:
>
> \def\doinatreferenceone
> {\ifx\next\bgroup
> \afterassignment\doinatreferenceonetwo
> \expandafter\leftreferencetoks
> \else\ifx\textofreference\empty
> \leftreferencetoks\emptytoks
> \expandafter\expandafter\expandafter\dodoinatreferencenone
> \else
> \leftreferencetoks{\textofreference}%
> \expandafter\expandafter\expandafter\doinatreferenceonetwo
> \fi\fi}
With published beta, I didn't need these \expandafter, but probably I missed
some corner case, or they're needed with your internal fix.
___________________________________________________________________________________
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] 5+ messages in thread
* Re: referenceformat MkIV
2010-05-31 18:53 ` taco
2010-05-31 19:34 ` Yury G. Kudryashov
@ 2010-06-07 14:34 ` Yury G. Kudryashov
1 sibling, 0 replies; 5+ messages in thread
From: Yury G. Kudryashov @ 2010-06-07 14:34 UTC (permalink / raw)
To: ntg-context
taco wrote:
>
> Hi,
>
> Yury G. Kudryashov wrote:
>> 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".
>
> This problem is still there and needs fixing, but I think your patch
> has a bug (possibly because of the already done other bugfix).
>
> After patching, I think \doinatreferenceone should look like
> this:
>
> \def\doinatreferenceone
> {\ifx\next\bgroup
> \afterassignment\doinatreferenceonetwo
> \expandafter\leftreferencetoks
> \else\ifx\textofreference\empty
> \leftreferencetoks\emptytoks
> \expandafter\expandafter\expandafter\dodoinatreferencenone
> \else
> \leftreferencetoks{\textofreference}%
> \expandafter\expandafter\expandafter\doinatreferenceonetwo
> \fi\fi}
Yes, this \doinatreference (with 3 \expandafter) works for me in the latest
beta. Could you please replace current \doinatreference with this one?
___________________________________________________________________________________
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] 5+ messages in thread
end of thread, other threads:[~2010-06-07 14:34 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-29 12:17 referenceformat MkIV Yury G. Kudryashov
2010-05-31 18:32 ` Yury G. Kudryashov
2010-05-31 18:53 ` taco
2010-05-31 19:34 ` Yury G. Kudryashov
2010-06-07 14:34 ` Yury G. Kudryashov
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).