ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* btex ... etex in .mp
@ 2004-08-26 20:07 Nikolai Weibull
  2004-08-27  7:32 ` Taco Hoekwater
  0 siblings, 1 reply; 6+ messages in thread
From: Nikolai Weibull @ 2004-08-26 20:07 UTC (permalink / raw)


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);}

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

* Re: btex ... etex in .mp
  2004-08-26 20:07 btex ... etex in .mp Nikolai Weibull
@ 2004-08-27  7:32 ` Taco Hoekwater
  2004-08-27 10:32   ` Nikolai Weibull
  0 siblings, 1 reply; 6+ messages in thread
From: Taco Hoekwater @ 2004-08-27  7:32 UTC (permalink / raw)


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

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

* Re: btex ... etex in .mp
  2004-08-27  7:32 ` Taco Hoekwater
@ 2004-08-27 10:32   ` Nikolai Weibull
  2004-08-27 13:36     ` Taco Hoekwater
  0 siblings, 1 reply; 6+ messages in thread
From: Nikolai Weibull @ 2004-08-27 10:32 UTC (permalink / raw)


* Taco Hoekwater <taco@elvenkind.com> [Aug 27, 2004 11:28]:
> > 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);}

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

* Re: Re: btex ... etex in .mp
  2004-08-27 10:32   ` Nikolai Weibull
@ 2004-08-27 13:36     ` Taco Hoekwater
  2004-08-27 16:48       ` Nikolai Weibull
  0 siblings, 1 reply; 6+ messages in thread
From: Taco Hoekwater @ 2004-08-27 13:36 UTC (permalink / raw)


On Fri, 27 Aug 2004 12:32:31 +0200, Nikolai wrote:

> * Taco Hoekwater <taco@elvenkind.com> [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

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

* Re: Re: btex ... etex in .mp
  2004-08-27 13:36     ` Taco Hoekwater
@ 2004-08-27 16:48       ` Nikolai Weibull
  2004-08-27 18:05         ` Taco Hoekwater
  0 siblings, 1 reply; 6+ messages in thread
From: Nikolai Weibull @ 2004-08-27 16:48 UTC (permalink / raw)


* Taco Hoekwater <taco@elvenkind.com> [Aug 27, 2004 15:40]:
> 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);}

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

* Re: Re: Re: btex ... etex in .mp
  2004-08-27 16:48       ` Nikolai Weibull
@ 2004-08-27 18:05         ` Taco Hoekwater
  0 siblings, 0 replies; 6+ messages in thread
From: Taco Hoekwater @ 2004-08-27 18:05 UTC (permalink / raw)


On Fri, 27 Aug 2004 18:48:19 +0200
Nikolai Weibull <context-list@pcppopper.org> wrote:

> 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

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

end of thread, other threads:[~2004-08-27 18:05 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-08-26 20:07 btex ... etex in .mp Nikolai Weibull
2004-08-27  7:32 ` Taco Hoekwater
2004-08-27 10:32   ` Nikolai Weibull
2004-08-27 13:36     ` Taco Hoekwater
2004-08-27 16:48       ` Nikolai Weibull
2004-08-27 18:05         ` Taco Hoekwater

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