ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: "Yury G. Kudryashov" <urkud@ya.ru>
To: ntg-context@ntg.nl
Subject: Re: referenceformat MkIV
Date: Mon, 31 May 2010 22:32:09 +0400	[thread overview]
Message-ID: <hu0vb9$f7v$1@dough.gmane.org> (raw)
In-Reply-To: <htr0kp$ac5$1@dough.gmane.org>

[-- 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
___________________________________________________________________________________

  reply	other threads:[~2010-05-31 18:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-29 12:17 Yury G. Kudryashov
2010-05-31 18:32 ` Yury G. Kudryashov [this message]
2010-05-31 18:53   ` taco
2010-05-31 19:34     ` Yury G. Kudryashov
2010-06-07 14:34     ` Yury G. Kudryashov

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='hu0vb9$f7v$1@dough.gmane.org' \
    --to=urkud@ya.ru \
    --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).