ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* positionoverlays problem
@ 2006-07-06 19:50 Hans van der Meer
  2006-07-11 13:21 ` Taco Hoekwater
  0 siblings, 1 reply; 8+ messages in thread
From: Hans van der Meer @ 2006-07-06 19:50 UTC (permalink / raw)



[-- Attachment #1.1: Type: text/plain, Size: 1582 bytes --]

I want to use the positionoverlay mechanism in several different  
figures (according to the metafun manual "Anchors and layers").
The problem is that the overlays show up in the last figure only, not  
in the first.
If I do not typeset the second overlayseries, the first does appear.
It looks like only the last overlayseries is kept.
Why is this and how to remedy this?


Like this with several names overlay names:
	\def\startoverlaygraphics#1{%
		\startpositionoverlay{#1}%
	}
	\def\stopoverlaygraphics#1{%
		\stoppositionoverlay
		\defineoverlay[#1][\positionoverlay{#1}]
		\setupbackgrounds[page][background={foreground,#1}]
	}
  Using it in:

\startoverlaygraphics{graphics-1}
	\setMPpositiongraphic{A1}{syllabus:arrow}{to=B1}
etc.
\stopoverlaygraphics{graphics-1}

...\hpos{A1}{}...\hpos{B1}{}...

\startoverlaygraphics{graphics-2}
	\setMPpositiongraphic{E1}{syllabus:arrow}{to=F1}
etc.
\stopoverlaygraphics{graphics-2}

...\hpos{E1}{}...\hpos{F1}{}...

Arrows drawn with:
\setupMPvariables[syllabus:arrow]%
	[linestyle={dashed evenly},%
		linesize=\tableframethickness,
		coloring=FrameColor,%
		axoff=0pt, ayoff=0pt, bxoff=0pt, byoff=0pt]
\startMPpositiongraphic{syllabus:arrow}{coloring}
	pair a, b;
	initialize_box(\MPpos{\MPvar{from}});
	a := cxy;
	initialize_box(\MPpos{\MPvar{to}});
	b:= cxy;
	pickup pencircle scaled \MPvar{linesize};
	drawarrow (a + (\MPvar{axoff},\MPvar{ayoff})) --
		(b + (\MPvar{bxoff},\MPvar{byoff}))
		\MPvar{linestyle} withcolor \MPvar{coloring};
	anchor_box(\MPanchor{\MPvar{from}});
\stopMPpositiongraphic
\endinput


Hans van der Meer




[-- Attachment #1.2: Type: text/html, Size: 7559 bytes --]

[-- Attachment #2: Type: text/plain, Size: 139 bytes --]

_______________________________________________
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context

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

* Re: positionoverlays problem
  2006-07-06 19:50 positionoverlays problem Hans van der Meer
@ 2006-07-11 13:21 ` Taco Hoekwater
  2006-07-11 19:33   ` Hans van der Meer
  0 siblings, 1 reply; 8+ messages in thread
From: Taco Hoekwater @ 2006-07-11 13:21 UTC (permalink / raw)




Hans van der Meer wrote:
> I want to use the positionoverlay mechanism in several different figures 
> (according to the metafun manual "Anchors and layers").
> The problem is that the overlays show up in the last figure only, not in 
> the first.
> If I do not typeset the second overlayseries, the first does appear.
> It looks like only the last overlayseries is kept.
> Why is this and how to remedy this?

I would like to help but I almost never use this stuff myself and
your example code doesn't compile. Is it because both are on the same
page? You effectively redefine the current page background in
each \stopoverlaygraphics command.

Taco

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

* Re: positionoverlays problem
  2006-07-11 13:21 ` Taco Hoekwater
@ 2006-07-11 19:33   ` Hans van der Meer
  2006-07-12  8:20     ` Taco Hoekwater
  2006-07-14 16:04     ` Hans Hagen
  0 siblings, 2 replies; 8+ messages in thread
From: Hans van der Meer @ 2006-07-11 19:33 UTC (permalink / raw)


I more or less guess there are only a restricted number of overlays  
possible? Could that be a correct conclusion?
The elegant way would have been being able to define separate  
positionoverlays for each picture, imho. However I found a practical  
solution in defining all items centrally within one positionoverlay.  
Up till now it has not failed, so I can live with that, but I cross  
my fingers it will still hold for a few hundred positional graphics.

Hans van der Meer

On Jul 11, 2006, at 15:21, Taco Hoekwater wrote:

>
>
> Hans van der Meer wrote:
>> I want to use the positionoverlay mechanism in several different  
>> figures
>> (according to the metafun manual "Anchors and layers").
>> The problem is that the overlays show up in the last figure only,  
>> not in
>> the first.
>> If I do not typeset the second overlayseries, the first does appear.
>> It looks like only the last overlayseries is kept.
>> Why is this and how to remedy this?
>
> I would like to help but I almost never use this stuff myself and
> your example code doesn't compile. Is it because both are on the same
> page? You effectively redefine the current page background in
> each \stopoverlaygraphics command.
>
> Taco

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

* Re: positionoverlays problem
  2006-07-11 19:33   ` Hans van der Meer
@ 2006-07-12  8:20     ` Taco Hoekwater
  2006-07-12 19:55       ` Hans van der Meer
  2006-07-14 16:04     ` Hans Hagen
  1 sibling, 1 reply; 8+ messages in thread
From: Taco Hoekwater @ 2006-07-12  8:20 UTC (permalink / raw)




Hans van der Meer wrote:
> I more or less guess there are only a restricted number of overlays  
> possible? Could that be a correct conclusion?

Whenever you say something like

   \setupbackgrounds[page][background={foreground,#1}]

you redefine the list of backgrounds that are applied to
the (current) page. The last one that is in effect before
the output routine is called is the one that wins this
contest.

At least that is how I understood your example code.
But (like I said earlier) could be mistaken about what
it was supposed to do.

Greetings, taco

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

* Re: positionoverlays problem
  2006-07-12  8:20     ` Taco Hoekwater
@ 2006-07-12 19:55       ` Hans van der Meer
  2006-07-13  6:34         ` Taco Hoekwater
  0 siblings, 1 reply; 8+ messages in thread
From: Hans van der Meer @ 2006-07-12 19:55 UTC (permalink / raw)



On Jul 12, 2006, at 10:20, Taco Hoekwater wrote:

>
>
> Hans van der Meer wrote:
>> I more or less guess there are only a restricted number of overlays
>> possible? Could that be a correct conclusion?
>
> Whenever you say something like
>
>    \setupbackgrounds[page][background={foreground,#1}]
>
> you redefine the list of backgrounds that are applied to
> the (current) page. The last one that is in effect before
> the output routine is called is the one that wins this
> contest.

Thanks, I guess that is the case. If the number of \hpos's will not  
overflow it shouldn't be a big problem. Can you confirm that all  
these positional graphics are generated one by one, or are they  
collected in a list that might overflow and one day cause me trouble?

>
> At least that is how I understood your example code.
> But (like I said earlier) could be mistaken about what
> it was supposed to do.
>
> Greetings, taco

met vriendelijke groet
Hans van der Meer

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

* Re: positionoverlays problem
  2006-07-12 19:55       ` Hans van der Meer
@ 2006-07-13  6:34         ` Taco Hoekwater
  2006-07-14 16:08           ` Hans Hagen
  0 siblings, 1 reply; 8+ messages in thread
From: Taco Hoekwater @ 2006-07-13  6:34 UTC (permalink / raw)


Hans van der Meer wrote:
> 
> Thanks, I guess that is the case. If the number of \hpos's will not  
> overflow it shouldn't be a big problem. Can you confirm that all  
> these positional graphics are generated one by one, or are they  
> collected in a list that might overflow and one day cause me trouble?
> 

Anything in TeX will overflow eventually, but you should be safe
enough. And if it still barks, you could define temp on a
per-chapter basis (or any other place with a 'natural' page
break).

Groet, Taco

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

* Re: positionoverlays problem
  2006-07-11 19:33   ` Hans van der Meer
  2006-07-12  8:20     ` Taco Hoekwater
@ 2006-07-14 16:04     ` Hans Hagen
  1 sibling, 0 replies; 8+ messages in thread
From: Hans Hagen @ 2006-07-14 16:04 UTC (permalink / raw)


Hans van der Meer wrote:
> I more or less guess there are only a restricted number of overlays  
> possible? Could that be a correct conclusion?
> The elegant way would have been being able to define separate  
> positionoverlays for each picture, imho. However I found a practical  
> solution in defining all items centrally within one positionoverlay.  
> Up till now it has not failed, so I can live with that, but I cross  
> my fingers it will still hold for a few hundred positional graphics.
>   
no, in principle there is no limitation in the stacking, but there are a 
few levels predefined (text+/-2)

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

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

* Re: positionoverlays problem
  2006-07-13  6:34         ` Taco Hoekwater
@ 2006-07-14 16:08           ` Hans Hagen
  0 siblings, 0 replies; 8+ messages in thread
From: Hans Hagen @ 2006-07-14 16:08 UTC (permalink / raw)


Taco Hoekwater wrote:
> Hans van der Meer wrote:
>   
>> Thanks, I guess that is the case. If the number of \hpos's will not  
>> overflow it shouldn't be a big problem. Can you confirm that all  
>> these positional graphics are generated one by one, or are they  
>> collected in a list that might overflow and one day cause me trouble?
>>
>>     
>
> Anything in TeX will overflow eventually, but you should be safe
> enough. And if it still barks, you could define temp on a
> per-chapter basis (or any other place with a 'natural' page
> break).
>   
indeed; at some point, with lots of refs and positions (once you use positions, each paragraph will generate one at least) there may be problems; in the coming luatex version we can use lua to store information in hashes) 

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

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

end of thread, other threads:[~2006-07-14 16:08 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-07-06 19:50 positionoverlays problem Hans van der Meer
2006-07-11 13:21 ` Taco Hoekwater
2006-07-11 19:33   ` Hans van der Meer
2006-07-12  8:20     ` Taco Hoekwater
2006-07-12 19:55       ` Hans van der Meer
2006-07-13  6:34         ` Taco Hoekwater
2006-07-14 16:08           ` Hans Hagen
2006-07-14 16:04     ` Hans Hagen

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