ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* TeX-MP interaction in mkii and mkiv
@ 2008-10-02  4:53 Aditya Mahajan
  2008-10-02 14:43 ` Aditya Mahajan
  2008-10-10 16:54 ` Aditya Mahajan
  0 siblings, 2 replies; 10+ messages in thread
From: Aditya Mahajan @ 2008-10-02  4:53 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: TEXT/PLAIN, Size: 338 bytes --]

Hi,

I cannot understand why mkii and mkiv give different output in the 
attached example modified from Thomas's presentation module. The output 
of MKII is correct. In MKIV, the first picture (Left) is not correct, and 
I cannot understand why is this the case.

I am using the latest minimals and the latest svn luatex.

Thanks,
Aditya

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: TEXT/x-tex; name=test.tex, Size: 1577 bytes --]

\setupcolors[state=start]

\beginOLDTEX
\loadmapfile[qhv-ec.map]

\definefontsynonym  [BigNumberFont] [ec-qhvb] 
\endOLDTEX

\beginLUATEX
\definefontsynonym  [BigNumberFont] [name:texgyreherosbold]
\endLUATEX

\definefont         [NumberFont]    [BigNumberFont at 30pt]

\definetextext[taspresent:sometxt:left] {\TaspresentSometxtLeft}
\definetextext[taspresent:sometxt:right]{\TaspresentSometxtRight}

\unexpanded\def\TaspresentSometxtLeft#1%
  {\getvalue{taspresent:framed:small}
                       {\color[orange]
                       {\NumberFont #1}}}

\unexpanded\def\TaspresentSometxtRight#1%
  {\getvalue{taspresent:framed:small}
                       {\color[blue]
                       {\NumberFont #1}}}

\startuseMPgraphic{test}
StartPage ;
picture Left, Right ;

Left  := \sometxt[taspresent:sometxt:left] {\folio} ysized 6cm; 
Right := \sometxt[taspresent:sometxt:right]{\folio} ysized 6cm; 

clip Left  to boundingbox Left  xyscaled(0,3cm) ;

if PageNumber < 10:
	clip Right to boundingbox Right xyscaled(0,3cm) shifted (bbwidth(Right)/2,0) ;
	draw Left  shifted (14.26cm,-.5cm) ;
	draw Right shifted (14.26cm,-.5cm) ;
else :
	clip Right to boundingbox Right xyscaled(0,3cm) shifted (bbwidth(Right)/1.5,0) ;
	draw Left  shifted (12.59cm,-.5cm) ; 
	draw Right shifted (12.59cm,-.5cm) ;
fi;
StopPage ;
\stopuseMPgraphic

\defineoverlay[test][\useMPgraphic{test}]

\setupbackgrounds[page]
                 [background=test]

\starttext

\dorecurse{10}{
\chapter{test}
\input knuth}

\stoptext



[-- Attachment #3: Type: text/plain, Size: 487 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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: TeX-MP interaction in mkii and mkiv
  2008-10-02  4:53 TeX-MP interaction in mkii and mkiv Aditya Mahajan
@ 2008-10-02 14:43 ` Aditya Mahajan
  2008-10-02 15:03   ` Taco Hoekwater
  2008-10-10 16:54 ` Aditya Mahajan
  1 sibling, 1 reply; 10+ messages in thread
From: Aditya Mahajan @ 2008-10-02 14:43 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Thu, 2 Oct 2008, Aditya Mahajan wrote:

> Hi,
>
> I cannot understand why mkii and mkiv give different output in the attached 
> example modified from Thomas's presentation module. The output of MKII is 
> correct. In MKIV, the first picture (Left) is not correct, and I cannot 
> understand why is this the case.
>
> I am using the latest minimals and the latest svn luatex.

MKIV is very strict about the spaces. I had

Left  := \sometxt[taspresent:sometxt:left] {\folio} ysized 6cm;
Right := \sometxt[taspresent:sometxt:right]{\folio} ysized 6cm;

(notice the space before \folio in Left). MKIV does not like that. If I 
remove the space, everything is fine.

Aditya
___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: TeX-MP interaction in mkii and mkiv
  2008-10-02 14:43 ` Aditya Mahajan
@ 2008-10-02 15:03   ` Taco Hoekwater
  2008-10-02 15:07     ` Taco Hoekwater
  0 siblings, 1 reply; 10+ messages in thread
From: Taco Hoekwater @ 2008-10-02 15:03 UTC (permalink / raw)
  To: mailing list for ConTeXt users



Aditya Mahajan wrote:
> On Thu, 2 Oct 2008, Aditya Mahajan wrote:
> 
>> Hi,
>>
>> I cannot understand why mkii and mkiv give different output in the attached 
>> example modified from Thomas's presentation module. The output of MKII is 
>> correct. In MKIV, the first picture (Left) is not correct, and I cannot 
>> understand why is this the case.
>>
>> I am using the latest minimals and the latest svn luatex.
> 
> MKIV is very strict about the spaces. I had
> 
> Left  := \sometxt[taspresent:sometxt:left] {\folio} ysized 6cm;
> Right := \sometxt[taspresent:sometxt:right]{\folio} ysized 6cm;
> 
> (notice the space before \folio in Left). MKIV does not like that. If I 
> remove the space, everything is fine.

... I had just figured that out myself. :-(

It seems we can fix that by redefining the definition of \sometxt.


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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: TeX-MP interaction in mkii and mkiv
  2008-10-02 15:03   ` Taco Hoekwater
@ 2008-10-02 15:07     ` Taco Hoekwater
  2008-10-02 15:37       ` Aditya Mahajan
  0 siblings, 1 reply; 10+ messages in thread
From: Taco Hoekwater @ 2008-10-02 15:07 UTC (permalink / raw)
  To: mailing list for ConTeXt users



Taco Hoekwater wrote:
>>
>> (notice the space before \folio in Left). MKIV does not like that. If I 
>> remove the space, everything is fine.
> 
> ... I had just figured that out myself. :-(
> 
> It seems we can fix that by redefining the definition of \sometxt.

Sorry, make that \definetextext. The macro \sometxt has to be
expandable, which limits the amount of tricks we can do with it.

This patch works:

   \def\definetextext[#1]#2%
     {\setvalue{@@st@@[#1]}{#2}%
      \setvalue{@@st@@[#1] }{#2}% added
     }

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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: TeX-MP interaction in mkii and mkiv
  2008-10-02 15:07     ` Taco Hoekwater
@ 2008-10-02 15:37       ` Aditya Mahajan
  0 siblings, 0 replies; 10+ messages in thread
From: Aditya Mahajan @ 2008-10-02 15:37 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Thu, 2 Oct 2008, Taco Hoekwater wrote:

>
>
> Taco Hoekwater wrote:
>>>
>>> (notice the space before \folio in Left). MKIV does not like that. If I
>>> remove the space, everything is fine.
>>
>> ... I had just figured that out myself. :-(

Ha, I can now claim that I figured out one TeX problem faster than 
you :-) Of course, you also figured out a solution :-D

>> It seems we can fix that by redefining the definition of \sometxt.
>
> Sorry, make that \definetextext. The macro \sometxt has to be
> expandable, which limits the amount of tricks we can do with it.
>
> This patch works:
>
>   \def\definetextext[#1]#2%
>     {\setvalue{@@st@@[#1]}{#2}%
>      \setvalue{@@st@@[#1] }{#2}% added
>     }

Thanks, works perfectly.

Aditya
___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: TeX-MP interaction in mkii and mkiv
  2008-10-02  4:53 TeX-MP interaction in mkii and mkiv Aditya Mahajan
  2008-10-02 14:43 ` Aditya Mahajan
@ 2008-10-10 16:54 ` Aditya Mahajan
  2008-10-10 17:05   ` Hans Hagen
  1 sibling, 1 reply; 10+ messages in thread
From: Aditya Mahajan @ 2008-10-10 16:54 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi,

Another difference in mkii and mkiv handling of sometxt. If there is a 
line break in \sometxt{ ... } then it fails in mkii, but runs in mkiv. For 
example,

\starttext

\startMPcode

   draw \sometxt{A very
                long string} ;

\stopMPcode

\stoptext

I vaguely understand why this is happening, but I do not know if it can be 
corrected.

Aditya
___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: TeX-MP interaction in mkii and mkiv
  2008-10-10 16:54 ` Aditya Mahajan
@ 2008-10-10 17:05   ` Hans Hagen
  2008-10-10 17:24     ` Aditya Mahajan
  0 siblings, 1 reply; 10+ messages in thread
From: Hans Hagen @ 2008-10-10 17:05 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Aditya Mahajan wrote:
> Hi,
> 
> Another difference in mkii and mkiv handling of sometxt. If there is a 
> line break in \sometxt{ ... } then it fails in mkii, but runs in mkiv. For 
> example,
> 
> \starttext
> 
> \startMPcode
> 
>    draw \sometxt{A very
>                 long string} ;
> 
> \stopMPcode
> 
> \stoptext
> 
> I vaguely understand why this is happening, but I do not know if it can be 
> corrected.

in mkii we obey lines because it gives better tracing etc etc given that 
we use external files; this will work:


    draw \sometxt{A very %
                 long string} ;


indeed mkiv is different but let's consider it an improvement; i don't 
want to waste time on mkii fixes that are not that important

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: TeX-MP interaction in mkii and mkiv
  2008-10-10 17:05   ` Hans Hagen
@ 2008-10-10 17:24     ` Aditya Mahajan
  2008-10-13  8:29       ` Mojca Miklavec
  0 siblings, 1 reply; 10+ messages in thread
From: Aditya Mahajan @ 2008-10-10 17:24 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Fri, 10 Oct 2008, Hans Hagen wrote:

> Aditya Mahajan wrote:
>> Hi,
>>
>> Another difference in mkii and mkiv handling of sometxt. If there is a
>> line break in \sometxt{ ... } then it fails in mkii, but runs in mkiv. For
>> example,
>>
>> \starttext
>>
>> \startMPcode
>>
>>    draw \sometxt{A very
>>                 long string} ;
>>
>> \stopMPcode
>>
>> \stoptext
>>
>> I vaguely understand why this is happening, but I do not know if it can be
>> corrected.
>
> in mkii we obey lines because it gives better tracing etc etc given that
> we use external files; this will work:
>
>
>    draw \sometxt{A very %
>                 long string} ;
>

Ah, thanks.

> indeed mkiv is different but let's consider it an improvement; i don't
> want to waste time on mkii fixes that are not that important

I understand that. We need to document all these differences between mkii 
and mkiv with regards to mp interaction for those who want to write code 
that works in both. Mojca, any plans to update your MyWay?

Aditya
___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: TeX-MP interaction in mkii and mkiv
  2008-10-10 17:24     ` Aditya Mahajan
@ 2008-10-13  8:29       ` Mojca Miklavec
  2008-10-13 13:45         ` Aditya Mahajan
  0 siblings, 1 reply; 10+ messages in thread
From: Mojca Miklavec @ 2008-10-13  8:29 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Fri, Oct 10, 2008 at 7:24 PM, Aditya Mahajan wrote:
> On Fri, 10 Oct 2008, Hans Hagen wrote:
>
>> Aditya Mahajan wrote:
>>> Hi,
>>>
>>> Another difference in mkii and mkiv handling of sometxt. If there is a
>>> line break in \sometxt{ ... } then it fails in mkii, but runs in mkiv. For
>>> example,
>>>
>>> \starttext
>>>
>>> \startMPcode
>>>
>>>    draw \sometxt{A very
>>>                 long string} ;
>>>
>>> \stopMPcode
>>>
>>> \stoptext
>>>
>>> I vaguely understand why this is happening, but I do not know if it can be
>>> corrected.
>>
>> in mkii we obey lines because it gives better tracing etc etc given that
>> we use external files; this will work:
>>
>>
>>    draw \sometxt{A very %
>>                 long string} ;
>>
>
> Ah, thanks.
>
>> indeed mkiv is different but let's consider it an improvement; i don't
>> want to waste time on mkii fixes that are not that important
>
> I understand that. We need to document all these differences between mkii
> and mkiv with regards to mp interaction for those who want to write code
> that works in both. Mojca, any plans to update your MyWay?

If you want to do changes, just go ahead (you might be more
competitive to describe them).

Otherwise: I'm not sure what all the differences are.
1.) withcolor doesn't work
2.) \startTeXtexsts cannot be used
3.) the example above fails in mkii

What else?

Mojca
___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: TeX-MP interaction in mkii and mkiv
  2008-10-13  8:29       ` Mojca Miklavec
@ 2008-10-13 13:45         ` Aditya Mahajan
  0 siblings, 0 replies; 10+ messages in thread
From: Aditya Mahajan @ 2008-10-13 13:45 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On Mon, 13 Oct 2008, Mojca Miklavec wrote:

> On Fri, Oct 10, 2008 at 7:24 PM, Aditya Mahajan wrote:
>> On Fri, 10 Oct 2008, Hans Hagen wrote:
>>
>>> Aditya Mahajan wrote:
>>>> Hi,
>>>>
>>>> Another difference in mkii and mkiv handling of sometxt. If there is a
>>>> line break in \sometxt{ ... } then it fails in mkii, but runs in mkiv. For
>>>> example,
>>>>
>>>> \starttext
>>>>
>>>> \startMPcode
>>>>
>>>>    draw \sometxt{A very
>>>>                 long string} ;
>>>>
>>>> \stopMPcode
>>>>
>>>> \stoptext
>>>>
>>>> I vaguely understand why this is happening, but I do not know if it can be
>>>> corrected.
>>>
>>> in mkii we obey lines because it gives better tracing etc etc given that
>>> we use external files; this will work:
>>>
>>>
>>>    draw \sometxt{A very %
>>>                 long string} ;
>>>
>>
>> Ah, thanks.
>>
>>> indeed mkiv is different but let's consider it an improvement; i don't
>>> want to waste time on mkii fixes that are not that important
>>
>> I understand that. We need to document all these differences between mkii
>> and mkiv with regards to mp interaction for those who want to write code
>> that works in both. Mojca, any plans to update your MyWay?
>
> If you want to do changes, just go ahead (you might be more
> competitive to describe them).
>
> Otherwise: I'm not sure what all the differences are.
> 1.) withcolor doesn't work
> 2.) \startTeXtexsts cannot be used
> 3.) the example above fails in mkii

In MKIV certain commands inside \sometxt should be unexpandable. I do not 
really understand which ones, but I occasionally get errors which can be 
fixed by making the command unexpandable.

Aditya
___________________________________________________________________________________
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  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2008-10-13 13:45 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-10-02  4:53 TeX-MP interaction in mkii and mkiv Aditya Mahajan
2008-10-02 14:43 ` Aditya Mahajan
2008-10-02 15:03   ` Taco Hoekwater
2008-10-02 15:07     ` Taco Hoekwater
2008-10-02 15:37       ` Aditya Mahajan
2008-10-10 16:54 ` Aditya Mahajan
2008-10-10 17:05   ` Hans Hagen
2008-10-10 17:24     ` Aditya Mahajan
2008-10-13  8:29       ` Mojca Miklavec
2008-10-13 13:45         ` Aditya Mahajan

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).