MPinclusions strangeness with labels
![](https://secure.gravatar.com/avatar/5ac56d5e4e2c07726085feb096e2f449.jpg?s=120&d=mm&r=g)
Hi all, I found something strange with a metapost file where I want to store various definitions for reuse in several tex files; here are example files: .......inc.mp............... numeric u; u=.8cm; path AX; AX = (10u,0) -- (0,0) -- (0,10u); picture cax; cax = thelabel(textext("Costs, prices") rotated 90,(-.3u,8u)); ............................ .......inc.tex.............. \setupoutput[pdftex] \startMPinclusions \input inc \stopMPinclusions \starttext \startuseMPgraphic{toto} drawdblarrow AX; % label.rt(textext("$3x^2+\pi$"), (5u,6u)); draw cax; \stopuseMPgraphic \placefigure[left]{bla.bla}{\useMPgraphic{toto}} \input dawkins \stoptext ............................ Now what happens? The label in the mp file "Costs, prices" is replaced by "unknown" in the pdf. But if I add a label in the startuseMPgraphic environment, (decommenting line 3 in it), then both labels appear!! I tried several other files, it seems to happen every time. Anything I'm doing wrong? tia -- Jean
![](https://secure.gravatar.com/avatar/c5ae4f9aa0d3a9bd5376e92b322c3e50.jpg?s=120&d=mm&r=g)
On Tue, 6 Jun 2006, Jean Magnan de Bornier wrote:
Hi all,
I found something strange with a metapost file where I want to store various definitions for reuse in several tex files; here are example files:
.......inc.mp............... numeric u; u=.8cm; path AX; AX = (10u,0) -- (0,0) -- (0,10u);
picture cax; cax = thelabel(textext("Costs, prices") rotated 90,(-.3u,8u)); ............................
.......inc.tex.............. \setupoutput[pdftex]
\startMPinclusions \input inc \stopMPinclusions
\starttext
\startuseMPgraphic{toto} drawdblarrow AX; % label.rt(textext("$3x^2+\pi$"), (5u,6u)); draw cax; \stopuseMPgraphic
\placefigure[left]{bla.bla}{\useMPgraphic{toto}}
\input dawkins
\stoptext ............................
Now what happens? The label in the mp file "Costs, prices" is replaced by "unknown" in the pdf. But if I add a label in the startuseMPgraphic environment, (decommenting line 3 in it), then both labels appear!!
This is because of the way textext works. tex.rb scans the file to see if textext is present. It is not, so it does not use mpx. When you uncomment the line, textext is present and mpx files are processed.
I tried several other files, it seems to happen every time. Anything I'm doing wrong?
Add \forceMPTEXgraphictrue on top of your file if you want to force mpx to be run everytime. I do not know the equivalent command line switch (if there is any) Aditya
![](https://secure.gravatar.com/avatar/5ac56d5e4e2c07726085feb096e2f449.jpg?s=120&d=mm&r=g)
Le 06 juin à 15:44:05 Aditya Mahajan
| > Hi all, | > | > I found something strange with a metapost file where I want to store | > various definitions for reuse in several tex files; here are example | > files: [...] | > | > Now what happens? The label in the mp file "Costs, prices" is replaced by | > "unknown" in the pdf. But if I add a label in the startuseMPgraphic | > environment, (decommenting line 3 in it), then both labels appear!! | >
| This is because of the way textext works. tex.rb scans the file to see | if textext is present. It is not, so it does not use mpx. When you | uncomment the line, textext is present and mpx files are processed.
| > I tried several other files, it seems to happen every time. | > Anything I'm doing wrong?
| Add \forceMPTEXgraphictrue on top of your file if you want to force | mpx to be run everytime. I do not know the equivalent command line | switch (if there is any)
| Aditya Thanks Aditya for the explanation and the solution, that was it! -- Jean
![](https://secure.gravatar.com/avatar/6114858d84b0f40cf715f12237ab67a1.jpg?s=120&d=mm&r=g)
On 6/6/06, Jean Magnan de Bornier wrote:
Now what happens? The label in the mp file "Costs, prices" is replaced by "unknown" in the pdf. But if I add a label in the startuseMPgraphic environment, (decommenting line 3 in it), then both labels appear!!
I tried several other files, it seems to happen every time. Anything I'm doing wrong? tia
In addition to Aditya's comments. OK, aliens at work! I tried to compile your documents in order to experiement a bit (\forceMPTEXcheck{nameofsomecommandtobecheckedfortextextpresence} might help in such cases as well), but now I don't understand why the example DOES work here without any modifiction. It seems to me that Hans debugged that part of ConTeXt even better than I thought :). So just a few guidelines: it might help(*) if you have a ConTeXt version that is not more than 1 month old and if you run ConTeXt with "texmfstart" (texexec should resolve to "texmfstart texexec.rb"). If you don't know how to do that, ask again (tell which distribution and OS you're using). Perhaps we should put that info right on the top of the first wiki page. (*) read: you have to Mojca
![](https://secure.gravatar.com/avatar/5ac56d5e4e2c07726085feb096e2f449.jpg?s=120&d=mm&r=g)
Le 06 juin à 16:02:01 "Mojca Miklavec"
| > Now what happens? The label in the mp file "Costs, prices" is replaced by | > "unknown" in the pdf. But if I add a label in the startuseMPgraphic | > environment, (decommenting line 3 in it), then both labels appear!! | > | > I tried several other files, it seems to happen every time. | > Anything I'm doing wrong? | > tia
| In addition to Aditya's comments.
| OK, aliens at work! I tried to compile your documents in order to | experiement a bit | (\forceMPTEXcheck{nameofsomecommandtobecheckedfortextextpresence} | might help in such cases as well), but now I don't understand why the | example DOES work here without any modifiction. It seems to me that | Hans debugged that part of ConTeXt even better than I thought :).
| So just a few guidelines: it might help(*) if you have a ConTeXt | version that is not more than 1 month old and if you run ConTeXt with | "texmfstart" (texexec should resolve to "texmfstart texexec.rb"). If | you don't know how to do that, ask again (tell which distribution and | OS you're using). Perhaps we should put that info right on the top of | the first wiki page.
| (*) read: you have to Well, sorry I forgot to say about my installation; actually I have an uptodate one, less than 10 days, last metapost, and using "texmfstart texexec" all right (I found a script for that on the list with this line: "ruby <path to ruby dir>/texmfstart.rb $*"). Then again there has to be something different with your installation... thx -- Jean
![](https://secure.gravatar.com/avatar/c5ae4f9aa0d3a9bd5376e92b322c3e50.jpg?s=120&d=mm&r=g)
On Tue, 6 Jun 2006, Mojca Miklavec wrote:
On 6/6/06, Jean Magnan de Bornier wrote:
Now what happens? The label in the mp file "Costs, prices" is replaced by "unknown" in the pdf. But if I add a label in the startuseMPgraphic environment, (decommenting line 3 in it), then both labels appear!!
I tried several other files, it seems to happen every time. Anything I'm doing wrong? tia
In addition to Aditya's comments.
OK, aliens at work! I tried to compile your documents in order to experiement a bit (\forceMPTEXcheck{nameofsomecommandtobecheckedfortextextpresence} might help in such cases as well), but now I don't understand why the example DOES work here without any modifiction. It seems to me that Hans debugged that part of ConTeXt even better than I thought :).
Mojca, I am surprised that it works without any modification on your machine. Do you have \forMPTEXgraphictrue set in your cont-sys.tex? Is it possible that the mpx files are generated from a previous run (from your testing). That is, if you purge all temporary files and rerun texexec, do you still get the correct output? If not, what magic setting do you have :) Aditya
![](https://secure.gravatar.com/avatar/6114858d84b0f40cf715f12237ab67a1.jpg?s=120&d=mm&r=g)
On 6/6/06, Aditya Mahajan wrote: Hi, Aditya!
I am surprised that it works without any modification on your machine. Do you have \forMPTEXgraphictrue set in your cont-sys.tex?
User file 'cont-sys.tex' not found, 'cont-sys.rme' has been used instead.
Is it possible that the mpx files are generated from a previous run (from your testing). That is, if you purge all temporary files and rerun texexec, do you still get the correct output?
No, impossible since I ran the file for the first time. And yes, I deleted everything and rerun and it was OK again.
If not, what magic setting do you have :)
I don't know (I've just configured one of the machines in the university, ie. replaced new tmf over old MikTeX files, added texmfstart and stubs, so there's no way that the TeX tree would be polluted from my old failures to compile gnuplot graphics), but it must be a lucky TeX day today! Apart from some great news from Hans about lua and the "Windows news" on the XeTeX mailing list ... I have nothing more to say! Mojca
participants (3)
-
Aditya Mahajan
-
Jean Magnan de Bornier
-
Mojca Miklavec