* mkiv and MetaPost
@ 2009-01-14 4:16 Otared Kavian
2009-01-14 5:51 ` Aditya Mahajan
0 siblings, 1 reply; 11+ messages in thread
From: Otared Kavian @ 2009-01-14 4:16 UTC (permalink / raw)
To: mailing list for ConTeXt users
Hi all,
I have a file which contains the lines below: I can typeset it and
obtain a correct result with mkii, but not with mkiv (the second
buffer named "axes-1" does not result in a MetaPost graphic when one
says \processMPbuffer[axes-1]).
The file and the resulting PDF can be found on
http://www.kavian.fr/tex/bug-mkiv
Thanks in advance for any help.
Best regards: OK
%%%%%% begin bug-metapost.tex
\setupcolors[state=start]
\starttext
\startbuffer[axes-1]
textextoffset := ExHeight ;
numeric u ; u := .5cm ;
vardef arrowheadonpath (expr p, s) =
save autoarrows ; boolean autoarrows ; autoarrows := true ;
set_ahlength(scaled ahfactor) ; %
arrowhead p if s<1 : cutafter (point (s*arclength(p)+.5ahlength) on p)
fi
enddef ;
path xox ; xox := (-u,0)--(8u,0) ;
path yoy ; yoy := (0,-u)--(0,7u) ;
draw xox withcolor blue ;
draw yoy withcolor blue ;
ahfactor := 4 ; % default is 2.5
fill arrowheadonpath(xox,1) withcolor .625blue ; % try .25
fill arrowheadonpath(yoy,1) withcolor .625blue ; % try .25
\stopbuffer
\startbuffer[chemin-1]
textextoffset := ExHeight ;
numeric u ; u := .5cm ;
z1 = (5u,0) ;
z2 = z1 rotated 60 ;
z11 = z1 rotated 15 ;
z12 = z1 rotated 30 ;
z13 = z1 rotated 45 ;
z0 = (2u,0) rotated 30 ;
path gamma ; gamma := (0,0)--(5u,0) ;
draw gamma withpen pencircle scaled .4mm withcolor .625yellow ;
path gammaR ; gammaR := z1..z11..z12..z13..z2 ;
draw gammaR withpen pencircle scaled .4mm withcolor .625yellow ;
dotlabel.bot (btex \switchtobodyfont[10pt] \strut $R$ etex, z1) ;
path gammaRR ; gammaRR := z2--(0,0) ;
draw gammaRR withpen pencircle scaled .4mm withcolor .625yellow ;
dotlabel.top (btex \switchtobodyfont[10pt] \strut $R{\rm e}^{2{\rm i}
\pi/n}$ etex , z2) ;
dotlabel.rt (btex \switchtobodyfont[10pt] \strut ${\rm e}^{{\rm i}\pi/
n}$ etex , z0) ;
label.rt (btex \switchtobodyfont[10pt] \strut $\Gamma_{R}$ etex , z11) ;
fill arrowheadonpath(gamma,.4) withcolor .625yellow ;
fill arrowheadonpath(gammaR,.4) withcolor .625yellow ;
fill arrowheadonpath(gammaRR,.4) withcolor .625yellow ;
\stopbuffer
This file has been typeset
on \currentdate{}
at \currenttime,
with
\doifmodeelse{mkiv}
{mkiv,
LuaTeX revision \luatexrevision,
(LuaTeX date stamp \luatexdatestamp)}
{mkii,
using the command:
\type{texexec basic-test.tex}},
ConTeXt version \contextversion.
% LuaTeX version \luatexversion,
This MetaPost graphic is shown with mkiv:
\placefigure[middle][-]{}{\processMPbuffer[chemin-1]} {}
\blank
but not this one
\placefigure[middle][-]{}{\processMPbuffer[axes-1]} {}
\blank
nor this one
\placefigure[middle][-]{}{\processMPbuffer[axes-1,chemin-1]} {}
\stoptext
___________________________________________________________________________________
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] 11+ messages in thread
* Re: mkiv and MetaPost
2009-01-14 4:16 mkiv and MetaPost Otared Kavian
@ 2009-01-14 5:51 ` Aditya Mahajan
2009-01-14 6:46 ` Otared Kavian
0 siblings, 1 reply; 11+ messages in thread
From: Aditya Mahajan @ 2009-01-14 5:51 UTC (permalink / raw)
To: mailing list for ConTeXt users
On Wed, 14 Jan 2009, Otared Kavian wrote:
> Hi all,
>
> I have a file which contains the lines below: I can typeset it and obtain a
> correct result with mkii, but not with mkiv (the second buffer named "axes-1"
> does not result in a MetaPost graphic when one says
> \processMPbuffer[axes-1]).
> The file and the resulting PDF can be found on
> http://www.kavian.fr/tex/bug-mkiv
> Thanks in advance for any help.
>
> Best regards: OK
I did not run the file, just guessing. In MKIV, by default buffers are not
written to disk, so \processMPbuffer does not find any. You can force
\startbuffer to write stuff to disk, but a better way would be to modify
\processMPbuffer to also search for memory buffers.
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] 11+ messages in thread
* Re: mkiv and MetaPost
2009-01-14 5:51 ` Aditya Mahajan
@ 2009-01-14 6:46 ` Otared Kavian
2009-01-14 7:57 ` Taco Hoekwater
0 siblings, 1 reply; 11+ messages in thread
From: Otared Kavian @ 2009-01-14 6:46 UTC (permalink / raw)
To: mailing list for ConTeXt users
On 14 janv. 09, at 06:51, Aditya Mahajan wrote:
> On Wed, 14 Jan 2009, Otared Kavian wrote:
>
>> Hi all,
>>
>> I have a file which contains the lines below: I can typeset it and
>> obtain a correct result with mkii, but not with mkiv (the second
>> buffer named "axes-1" does not result in a MetaPost graphic when
>> one says \processMPbuffer[axes-1]).
>> The file and the resulting PDF can be found on
>> http://www.kavian.fr/tex/bug-mkiv
>> Thanks in advance for any help.
>>
>> Best regards: OK
>
> I did not run the file, just guessing. In MKIV, by default buffers
> are not written to disk, so \processMPbuffer does not find any. You
> can force \startbuffer to write stuff to disk, but a better way
> would be to modify \processMPbuffer to also search for memory buffers.
>
> Aditya
Thanks Aditya for your explanation, but I must say that it is not
convincing because with mkiv one of the buffers is processed with
\processMPbuffer, while the other is not… So there must be some other
hidden behaviour which has changed between mkii and mkiv.
Best regards: OK
___________________________________________________________________________________
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] 11+ messages in thread
* Re: mkiv and MetaPost
2009-01-14 6:46 ` Otared Kavian
@ 2009-01-14 7:57 ` Taco Hoekwater
2009-01-14 8:18 ` Otared Kavian
0 siblings, 1 reply; 11+ messages in thread
From: Taco Hoekwater @ 2009-01-14 7:57 UTC (permalink / raw)
To: mailing list for ConTeXt users
Otared Kavian wrote:
>
> Thanks Aditya for your explanation, but I must say that it is not
> convincing because with mkiv one of the buffers is processed with
> \processMPbuffer, while the other is not… So there must be some other
> hidden behaviour which has changed between mkii and mkiv.
I will leave it for Hans to figure what exactly goes wrong, but the
problem is caused by the comment characters in the axes-1 buffer.
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] 11+ messages in thread
* Re: mkiv and MetaPost
2009-01-14 7:57 ` Taco Hoekwater
@ 2009-01-14 8:18 ` Otared Kavian
2009-01-14 8:31 ` Taco Hoekwater
2009-01-14 8:54 ` Hans Hagen
0 siblings, 2 replies; 11+ messages in thread
From: Otared Kavian @ 2009-01-14 8:18 UTC (permalink / raw)
To: mailing list for ConTeXt users
On 14 janv. 09, at 08:57, Taco Hoekwater wrote:
> Otared Kavian wrote:
>> Thanks Aditya for your explanation, but I must say that it is not
>> convincing because with mkiv one of the buffers is processed with
>> \processMPbuffer, while the other is not… So there must be some
>> other hidden behaviour which has changed between mkii and mkiv.
>
> I will leave it for Hans to figure what exactly goes wrong, but the
> problem is caused by the comment characters in the axes-1 buffer.
>
> Best wishes,
> Taco
Hi Taco,
Thanks for finding the problem: indeed as you point out, in the
minimal example which I reproduce below, one sees that the comment
character
%
in the \startbuffer[axes-2] part is not interpreted correctly in mkiv:
if one puts that character at the end of last line of the buffer the
ouput is correct, while if one puts it at the end of other lines the
result is "undefined".
So for the file I have to typeset right now, I'll remove those nasty
"%", but I hope that the problem will be solved in mkiv…
By the way, in one of your messages some time ago you said that there
is a command
\luatexversion
but it doesn't exist on my installation: is it removed or I understod
wrong?
Best wishes: OK
%%%%% bug-metapost-1.tex
%!TEX TS-program = mkiv
\setupcolors[state=start]
\starttext
\startbuffer[axes-1]
numeric u ; u := .5cm ;
path xox ; xox := (-u,0)--(8u,0) ;
path yoy ; yoy := (0,-u)--(0,7u) ;
draw xox withcolor blue ;
draw yoy withcolor blue ;
\stopbuffer
\startbuffer[axes-2]
numeric u ; u := .5cm ;
path xox ; xox := (-u,0)--(8u,0) ;
path yoy ; yoy := (0,-u)--(0,7u) ;
draw xox withcolor blue ; % <------ here is the problem
draw yoy withcolor blue ;
\stopbuffer
This file has been typeset
on \currentdate{}
at \currenttime,
with
\doifmodeelse{mkiv}
{mkiv,
LuaTeX revision \luatexrevision,
(LuaTeX date stamp \luatexdatestamp)}
{mkii,
using the command:
\type{texexec basic-test.tex}},
ConTeXt version \contextversion.
% LuaTeX version \luatexversion,
\blank[2*big]
This MetaPost graphic is shown correctly with mkiv:
\placefigure[middle][-]{}{\processMPbuffer[axes-1]} {}
\blank
but not this one
\placefigure[middle][-]{}{\processMPbuffer[axes-2]} {}
\stoptext
___________________________________________________________________________________
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] 11+ messages in thread
* Re: mkiv and MetaPost
2009-01-14 8:18 ` Otared Kavian
@ 2009-01-14 8:31 ` Taco Hoekwater
2009-01-14 8:40 ` Otared Kavian
2009-01-14 8:54 ` Hans Hagen
1 sibling, 1 reply; 11+ messages in thread
From: Taco Hoekwater @ 2009-01-14 8:31 UTC (permalink / raw)
To: mailing list for ConTeXt users
Otared Kavian wrote:
>
> By the way, in one of your messages some time ago you said that there is
> a command
> \luatexversion
> but it doesn't exist on my installation: is it removed or I understod
> wrong?
Try \the\luatexversion, and \luatexrevision.
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] 11+ messages in thread
* Re: mkiv and MetaPost
2009-01-14 8:31 ` Taco Hoekwater
@ 2009-01-14 8:40 ` Otared Kavian
0 siblings, 0 replies; 11+ messages in thread
From: Otared Kavian @ 2009-01-14 8:40 UTC (permalink / raw)
To: mailing list for ConTeXt users
On 14 janv. 09, at 09:31, Taco Hoekwater wrote:
>
>
> Otared Kavian wrote:
>>
>> By the way, in one of your messages some time ago you said that
>> there is
>> a command
>> \luatexversion
>> but it doesn't exist on my installation: is it removed or I understod
>> wrong?
>
> Try \the\luatexversion, and \luatexrevision.
>
> Best wishes,
> Taco
>
Thanks! This works…
Best wishes: OK
___________________________________________________________________________________
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] 11+ messages in thread
* Re: mkiv and MetaPost
2009-01-14 8:18 ` Otared Kavian
2009-01-14 8:31 ` Taco Hoekwater
@ 2009-01-14 8:54 ` Hans Hagen
2009-01-14 10:30 ` Hans Hagen
1 sibling, 1 reply; 11+ messages in thread
From: Hans Hagen @ 2009-01-14 8:54 UTC (permalink / raw)
To: mailing list for ConTeXt users
Otared Kavian wrote:
>> I will leave it for Hans to figure what exactly goes wrong, but the
>> problem is caused by the comment characters in the axes-1 buffer.
core-buf.lua: line 253
return concat(t,separator or "\n") -- "\n" is safer due to comments
and such
(easier fix than passing "\\n" in meta-ini.mkiv
Hans
-----------------------------------------------------------------
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] 11+ messages in thread
* Re: mkiv and MetaPost
2009-01-14 8:54 ` Hans Hagen
@ 2009-01-14 10:30 ` Hans Hagen
2009-01-14 10:37 ` Otared Kavian
2009-01-14 13:32 ` Otared Kavian
0 siblings, 2 replies; 11+ messages in thread
From: Hans Hagen @ 2009-01-14 10:30 UTC (permalink / raw)
To: mailing list for ConTeXt users
Hans Hagen wrote:
> Otared Kavian wrote:
>
>>> I will leave it for Hans to figure what exactly goes wrong, but the
>>> problem is caused by the comment characters in the axes-1 buffer.
>
> core-buf.lua: line 253
>
> return concat(t,separator or "\n") -- "\n" is safer due to comments
> and such
>
> (easier fix than passing "\\n" in meta-ini.mkiv
there was some more involved, i'll upload a fixed beta
Hans
-----------------------------------------------------------------
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] 11+ messages in thread
* Re: mkiv and MetaPost
2009-01-14 10:30 ` Hans Hagen
@ 2009-01-14 10:37 ` Otared Kavian
2009-01-14 13:32 ` Otared Kavian
1 sibling, 0 replies; 11+ messages in thread
From: Otared Kavian @ 2009-01-14 10:37 UTC (permalink / raw)
To: mailing list for ConTeXt users
On 14 janv. 09, at 11:30, Hans Hagen wrote:
> Hans Hagen wrote:
>> Otared Kavian wrote:
>>>> I will leave it for Hans to figure what exactly goes wrong, but
>>>> the problem is caused by the comment characters in the axes-1
>>>> buffer.
>> core-buf.lua: line 253
>> return concat(t,separator or "\n") -- "\n" is safer due to
>> comments and such
>> (easier fix than passing "\\n" in meta-ini.mkiv
>
> there was some more involved, i'll upload a fixed beta
>
> Hans
>
Thanks… because the fisrst fix implied some unknown reaction when
compiling again and did not solve the problem.
Best regards: OK
___________________________________________________________________________________
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] 11+ messages in thread
* Re: mkiv and MetaPost
2009-01-14 10:30 ` Hans Hagen
2009-01-14 10:37 ` Otared Kavian
@ 2009-01-14 13:32 ` Otared Kavian
1 sibling, 0 replies; 11+ messages in thread
From: Otared Kavian @ 2009-01-14 13:32 UTC (permalink / raw)
To: mailing list for ConTeXt users
On 14 janv. 09, at 11:30, Hans Hagen wrote:
> Hans Hagen wrote:
>> Otared Kavian wrote:
>>>> I will leave it for Hans to figure what exactly goes wrong, but
>>>> the problem is caused by the comment characters in the axes-1
>>>> buffer.
>> core-buf.lua: line 253
>> return concat(t,separator or "\n") -- "\n" is safer due to
>> comments and such
>> (easier fix than passing "\\n" in meta-ini.mkiv
>
> there was some more involved, i'll upload a fixed beta
Hi Hans,
I tested the new beta mkiv
ConTeXt version 2009.01.14 11:29
on many of my files having MetaPost, and everything works as expected…
Thanks again: OK
___________________________________________________________________________________
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] 11+ messages in thread
end of thread, other threads:[~2009-01-14 13:32 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-01-14 4:16 mkiv and MetaPost Otared Kavian
2009-01-14 5:51 ` Aditya Mahajan
2009-01-14 6:46 ` Otared Kavian
2009-01-14 7:57 ` Taco Hoekwater
2009-01-14 8:18 ` Otared Kavian
2009-01-14 8:31 ` Taco Hoekwater
2009-01-14 8:40 ` Otared Kavian
2009-01-14 8:54 ` Hans Hagen
2009-01-14 10:30 ` Hans Hagen
2009-01-14 10:37 ` Otared Kavian
2009-01-14 13:32 ` Otared Kavian
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).