Hi! I remember reading somewhere that you can't use btex ... etex in "input" .mp files, as there is no possibility for them to be processed at that time. I've hit a snag, though, and this would really be a good thing for me to have. Is there any way to get similar behavior? Basically, I want to define some stuff that I want to reuse in several pictures. nikolai -- ::: name: Nikolai Weibull :: aliases: pcp / lone-star / aka ::: ::: born: Chicago, IL USA :: loc atm: Gothenburg, Sweden ::: ::: page: www.pcppopper.org :: fun atm: gf,lps,ruby,lisp,war3 ::: main(){printf(&linux["\021%six\012\0"],(linux)["have"]+"fun"-97);}
On Thu, 26 Aug 2004 22:07:23 +0200, Nikolai wrote:
Hi!
I remember reading somewhere that you can't use btex ... etex in "input" .mp files, as there is no possibility for them to be processed at that time.
That is somewhat incorrect information. You can not use btex ... etex in a normal way in places where expansion is prohibited (i.e. definitions), but whether or not this is inside an inputted file is irrelevant. If you need run-time TeX labels, you can use the textext() macro from metafun, or John Hobby's TEX() macro (available after "input tex;") Greetings, Taco
* Taco Hoekwater
I remember reading somewhere that you can't use btex ... etex in "input" .mp files, as there is no possibility for them to be processed at that time.
That is somewhat incorrect information. You can not use btex ... etex in a normal way in places where expansion is prohibited (i.e. definitions), but whether or not this is inside an inputted file is irrelevant.
Ah, yes, that's what I read. Sorry for misunderstanding.
If you need run-time TeX labels, you can use the textext() macro from metafun, or John Hobby's TEX() macro (available after "input tex;")
Hm, I tried textext(). Can it be used in vardef's? I get ! Isolated expression. <to be read again> ; endfig->scantokens.extra_endfig; shipit;endgroup l.217 endfig ; ? from some of my pictures. I can't make sense of it. Anyway, the affected pictures aren't coming out right. Am I doing something terribly wronge here? I'm using trees.mp and have a couple of def_nonterminal(CONS, textext("$\mathstrut\circ$")); type lines I want to reuse placed in a file i "input". trees.mp can be found at http://www.cis.upenn.edu/~dchiang/software/trees.mp Thanks, nikolai -- ::: name: Nikolai Weibull :: aliases: pcp / lone-star / aka ::: ::: born: Chicago, IL USA :: loc atm: Gothenburg, Sweden ::: ::: page: www.pcppopper.org :: fun atm: gf,lps,ruby,lisp,war3 ::: main(){printf(&linux["\021%six\012\0"],(linux)["have"]+"fun"-97);}
On Fri, 27 Aug 2004 12:32:31 +0200, Nikolai wrote:
* Taco Hoekwater
[Aug 27, 2004 11:28]: If you need run-time TeX labels, you can use the textext() macro from metafun, or John Hobby's TEX() macro (available after "input tex;")
Hm, I tried textext(). Can it be used in vardef's? I get
! Isolated expression. <to be read again> ?
from some of my pictures. I can't make sense of it. Anyway, the affected pictures aren't coming out right. Am I doing something terribly wronge here?
Don't know. Metapost seems to be complaining about something that is part of extra_endfig, but neither trees.mp nor mp-text.mp do anything with that, so it may be completely unrelated ? If you can create a minimal file that shows the same problem and post/e-mail that, I may be able to help further. -- groeten, Taco
* Taco Hoekwater
Don't know. Metapost seems to be complaining about something that is part of extra_endfig, but neither trees.mp nor mp-text.mp do anything with that, so it may be completely unrelated ?
Actually, it was boxes.mp's fault. I was "input"ing boxes from two places, and it was not multiple-inclusion-protected, so line 122 of metapost/base/boxes.mp was being executed twice, adding clearboxesclearboxes instead of only clearboxes. The line is buggy though, as it should read extra_endfig := extra_endfig & "clearboxes;"; My error report should have been >> clearboxesclearboxes ! Isolated expression. : : which I didn't realize until now. Who should one contact about fixing that? Anyway, the real problem was that texexec doesn't run with --mptex when it actually needs to. If there are textext() stuff or other generated btex ... etex stuff, but no btex ... etex in the picture itself, the extra run for the labels is not performed. This needs fixing and should probably not be impossible to fix, but I guess it's yet another one of my "pushing the limits of ConTeXt/MetaPost"-problems. I cannot quite figure out how texexec determines whether to run an extra run of the files, but it won't. I can provide an example of this off-list (as there are quite a few files necessary for even a small example) if anyone is interested. The temporary solution is thus to include at least one btex ... etex sequence in the graphic: label(textext(""), origin); which of course is crap, but it's the best I could come up with. nikolai -- ::: name: Nikolai Weibull :: aliases: pcp / lone-star / aka ::: ::: born: Chicago, IL USA :: loc atm: Gothenburg, Sweden ::: ::: page: www.pcppopper.org :: fun atm: gf,lps,ruby,lisp,war3 ::: main(){printf(&linux["\021%six\012\0"],(linux)["have"]+"fun"-97);}
On Fri, 27 Aug 2004 18:48:19 +0200
Nikolai Weibull
Who should one contact about fixing that?
As of about a day ago, I guess that could be me ;) A guard against double loading of boxes.mp is now added to the todo list. Perhaps some other 'standard' files have to be done as well, will check.
Anyway, the real problem was that texexec doesn't run with --mptex when it actually needs to. If there are textext() stuff or other generated btex ... etex stuff, but no btex ... etex in the picture itself, the extra run for the labels is not performed.
Perhaps this is the same problem as the sometimes missing final run for flowcharts. I've noticed that sometimes the flowcharts don't update correctly after edits, but couldn't fathom why (up to now). Greetings, Taco
participants (2)
-
Nikolai Weibull
-
Taco Hoekwater