ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* absolute positioning of figures
@ 2006-10-12 21:30 andrea valle
  2006-10-12 22:00 ` Hans Hagen
  0 siblings, 1 reply; 9+ messages in thread
From: andrea valle @ 2006-10-12 21:30 UTC (permalink / raw)


Hi to all,

In case of presentations sometimes one has to combine many figures in 
the page, maybe overlapping for some parts. Something very easy in 
powerpoint.
What's the best technique?
Taking a look at the wiki and ot "It's in the details" manual it seems 
that layers, which can be placed according to absolute positions, are 
the ConTeXt solution to the problem.
Is it so?

I was in fact considering to create a simple python GUI app to allow a 
visual control on position of figures on a page, outputting ConTeXt 
code to be copied and pasted.

Thanks

-a-



Andrea Valle
DAMS - Facoltà di Scienze della Formazione
Università degli Studi di Torino
http://www.semiotiche.it/andrea
andrea.valle@unito.it

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

* Re: absolute positioning of figures
  2006-10-12 21:30 absolute positioning of figures andrea valle
@ 2006-10-12 22:00 ` Hans Hagen
  2006-10-12 22:45   ` andrea valle
  0 siblings, 1 reply; 9+ messages in thread
From: Hans Hagen @ 2006-10-12 22:00 UTC (permalink / raw)


andrea valle wrote:
> Hi to all,
>
> In case of presentations sometimes one has to combine many figures in 
> the page, maybe overlapping for some parts. Something very easy in 
> powerpoint.
> What's the best technique?
> Taking a look at the wiki and ot "It's in the details" manual it seems 
> that layers, which can be placed according to absolute positions, are 
> the ConTeXt solution to the problem.
> Is it so?
>   
indeed, layers put in overlays (there can be many layers on top of each 
others

if you want to do even dirtier tricks, you can use streams and have 
multiple subpages make up a page (see m-streams)
> I was in fact considering to create a simple python GUI app to allow a 
> visual control on position of figures on a page, outputting ConTeXt 
> code to be copied and pasted.
>   



-----------------------------------------------------------------
                                          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] 9+ messages in thread

* Re: absolute positioning of figures
  2006-10-12 22:00 ` Hans Hagen
@ 2006-10-12 22:45   ` andrea valle
  2006-10-13 14:33     ` andrea valle
  0 siblings, 1 reply; 9+ messages in thread
From: andrea valle @ 2006-10-12 22:45 UTC (permalink / raw)


(Thanks Hans)

On 13 Oct 2006, at 00:00, Hans Hagen wrote:
>>

> indeed, layers put in overlays (there can be many layers on top of each
> others
>


Uhm,  I don't think I understood. In wiki layers are, in some way, 
opposite to overlay. How do I put a layer in an overlay?
Could you post an essential snippet?


> if you want to do even dirtier tricks, you can use streams and have
> multiple subpages make up a page (see m-streams)

(I'll take a look)

Thanks

-a-

Andrea Valle
DAMS - Facoltà di Scienze della Formazione
Università degli Studi di Torino
http://www.semiotiche.it/andrea
andrea.valle@unito.it

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

* Re: absolute positioning of figures
  2006-10-12 22:45   ` andrea valle
@ 2006-10-13 14:33     ` andrea valle
  2006-10-13 15:54       ` Peter Rolf
  0 siblings, 1 reply; 9+ messages in thread
From: andrea valle @ 2006-10-13 14:33 UTC (permalink / raw)




> On 13 Oct 2006, at 00:00, Hans Hagen wrote:
>>>
>
>> indeed, layers put in overlays (there can be many layers on top of 
>> each
>> others
>>
>
>


Now, I tried with overlays and layers. That's fine. In any case, in a 
second approach I simply used \setlayer to fill repeatedly the same 
layer. The result seems to be the same.
  What's the difference? Is it safe to use the second approach?

Then: changing layer dimension in \definelayer, I cannot see any 
differences in the output.
Can anyone explain what it should happen?
Thanks

Best

-a-

Two examples follow:

\setupcolors[state=start]


% first approach

\definelayer    [layer1][]
\definelayer    [layer2][]
\definelayer    [layer3][]

\setlayer       [layer1]
                 [x=.5\paperwidth, y=.5\paperheight]
                 {\externalfigure[layTest][]}



\setlayer       [layer2]
                 [x=.35\paperwidth, y=.45\paperheight]
                 {\externalfigure[layTest][]}


\setlayer       [layer3]
                 [x=.5\paperwidth, y=.5\paperheight]
                 {\color[darkred]{ \bf This is a text}}


\defineoverlay[overlay1][{\placelayer[layer1]}]
\defineoverlay[overlay2][{\placelayer[layer2]}]
\defineoverlay[overlay3][{\placelayer[layer3]}]

% end of first


% second approach
\definelayer    [layer1b][]      % just one

\setlayer       [layer1b]
                 [x=.5\paperwidth, y=.5\paperheight]
                 {\externalfigure[layTest][]}



\setlayer       [layer1b]
                 [x=.35\paperwidth, y=.45\paperheight]
                 {\externalfigure[layTest][]}


\setlayer       [layer1b]
                 [x=.5\paperwidth, y=.5\paperheight]
                 {\color[darkred]{ \bf This is a text}}


% end


\starttext

% using first
\framed [height=\textheight,width=\textwidth,background={overlay1, 
overlay2, overlay3},align=right, frame=off]
{
% write if you need to
}


% using second

\framed 
[height=\textheight,width=\textwidth,background=layer1b,align=right, 
frame=off]
{
% write if you need to
}


\stoptext

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

* Re: absolute positioning of figures
  2006-10-13 14:33     ` andrea valle
@ 2006-10-13 15:54       ` Peter Rolf
  2006-10-13 16:22         ` andrea valle
  0 siblings, 1 reply; 9+ messages in thread
From: Peter Rolf @ 2006-10-13 15:54 UTC (permalink / raw)


Hi Andrea,

andrea valle wrote:
> 
>> On 13 Oct 2006, at 00:00, Hans Hagen wrote:
>>> indeed, layers put in overlays (there can be many layers on top of 
>>> each
>>> others
>>>
>>
> 
> 
> Now, I tried with overlays and layers. That's fine. In any case, in a 
> second approach I simply used \setlayer to fill repeatedly the same 
> layer. The result seems to be the same.
>   What's the difference? Is it safe to use the second approach?
>
Using different layers, you can change the order of appearance
(background={1,2,3}|{1,3,2},..) for the layer content.
Using only one layer, all layer content is placed stack like; the
printing order is then fixed by the appearance order in the document
(last overprints prior).

> Then: changing layer dimension in \definelayer, I cannot see any 
> differences in the output.
> Can anyone explain what it should happen?

I think the size is significant, if you use relative positioning
(preset=bottomright and alike).

Greetings, Peter

> Thanks
> 
> Best
> 
> -a-
> 
> Two examples follow:
> 
> \setupcolors[state=start]
> 
> 
> % first approach
> 
> \definelayer    [layer1][]
> \definelayer    [layer2][]
> \definelayer    [layer3][]
> 
> \setlayer       [layer1]
>                  [x=.5\paperwidth, y=.5\paperheight]
>                  {\externalfigure[layTest][]}
> 
> 
> 
> \setlayer       [layer2]
>                  [x=.35\paperwidth, y=.45\paperheight]
>                  {\externalfigure[layTest][]}
> 
> 
> \setlayer       [layer3]
>                  [x=.5\paperwidth, y=.5\paperheight]
>                  {\color[darkred]{ \bf This is a text}}
> 
> 
> \defineoverlay[overlay1][{\placelayer[layer1]}]
> \defineoverlay[overlay2][{\placelayer[layer2]}]
> \defineoverlay[overlay3][{\placelayer[layer3]}]
> 
> % end of first
> 
> 
> % second approach
> \definelayer    [layer1b][]      % just one
> 
> \setlayer       [layer1b]
>                  [x=.5\paperwidth, y=.5\paperheight]
>                  {\externalfigure[layTest][]}
> 
> 
> 
> \setlayer       [layer1b]
>                  [x=.35\paperwidth, y=.45\paperheight]
>                  {\externalfigure[layTest][]}
> 
> 
> \setlayer       [layer1b]
>                  [x=.5\paperwidth, y=.5\paperheight]
>                  {\color[darkred]{ \bf This is a text}}
> 
> 
> % end
> 
> 
> \starttext
> 
> % using first
> \framed [height=\textheight,width=\textwidth,background={overlay1, 
> overlay2, overlay3},align=right, frame=off]
> {
> % write if you need to
> }
> 
> 
> % using second
> 
> \framed 
> [height=\textheight,width=\textwidth,background=layer1b,align=right, 
> frame=off]
> {
> % write if you need to
> }
> 
> 
> \stoptext
> 
> _______________________________________________
> ntg-context mailing list
> ntg-context@ntg.nl
> http://www.ntg.nl/mailman/listinfo/ntg-context
> 
> 

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

* Re: absolute positioning of figures
  2006-10-13 15:54       ` Peter Rolf
@ 2006-10-13 16:22         ` andrea valle
  2006-10-13 16:31           ` Hans Hagen
  0 siblings, 1 reply; 9+ messages in thread
From: andrea valle @ 2006-10-13 16:22 UTC (permalink / raw)



Hi Peter,

> Using different layers, you can change the order of appearance
> (background={1,2,3}|{1,3,2},..) for the layer content.
> Using only one layer, all layer content is placed stack like; the
> printing order is then fixed by the appearance order in the document
> (last overprints prior).
>

Ah, thanks, I see the point.

In the posted example, I was mumbling about the reference Hans did 
about overlays+layers.
As far as I saw, I think that the only solution to absolute positioning 
is \setupbackgrounds.
As wiki says, \placelayer offsets to \text dimensions.

Am I right?

Best

-a-

Andrea Valle
DAMS - Facoltà di Scienze della Formazione
Università degli Studi di Torino
http://www.semiotiche.it/andrea
andrea.valle@unito.it

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

* Re: absolute positioning of figures
  2006-10-13 16:22         ` andrea valle
@ 2006-10-13 16:31           ` Hans Hagen
  2006-10-13 16:56             ` andrea valle
  0 siblings, 1 reply; 9+ messages in thread
From: Hans Hagen @ 2006-10-13 16:31 UTC (permalink / raw)


andrea valle wrote:
> Hi Peter,
>
>   
>> Using different layers, you can change the order of appearance
>> (background={1,2,3}|{1,3,2},..) for the layer content.
>> Using only one layer, all layer content is placed stack like; the
>> printing order is then fixed by the appearance order in the document
>> (last overprints prior).
>>
>>     
>
> Ah, thanks, I see the point.
>
> In the posted example, I was mumbling about the reference Hans did 
> about overlays+layers.
> As far as I saw, I think that the only solution to absolute positioning 
> is \setupbackgrounds.
> As wiki says, \placelayer offsets to \text dimensions.
>
> Am I right?
>   

\definelayer[blabla][width=20cm,height30cm]

etc etc

-- 

-----------------------------------------------------------------
                                          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] 9+ messages in thread

* Re: absolute positioning of figures
  2006-10-13 16:31           ` Hans Hagen
@ 2006-10-13 16:56             ` andrea valle
  2006-10-13 17:58               ` Peter Rolf
  0 siblings, 1 reply; 9+ messages in thread
From: andrea valle @ 2006-10-13 16:56 UTC (permalink / raw)



Example:

\definelayer    [layer2a][width=.15\paperwidth]

\setlayer       [layer2a]
                 [x=.15\paperwidth, y=.5\paperheight]
                 {\externalfigure[layTest][width=.75\paperwidth]}


I was expecting to have the layTest figure cut after its width exceeds 
the layer's width. It seems that this is unrelevant, i.e.

If I have instead of this:

\definelayer    [layer2a][width=.15\paperwidth]

this:
\definelayer    [layer2a][width=.75\paperwidth]

It's the same.

So, I cannot understand what width means for layers, as changing it has 
no consequences (in my example).

Best

-a-






On 13 Oct 2006, at 18:31, Hans Hagen wrote:
>>
>
> \definelayer[blabla][width=20cm,height30cm]
>
> etc etc
>
> -- 
>
> -----------------------------------------------------------------
>                                           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
> -----------------------------------------------------------------
>
> _______________________________________________
> ntg-context mailing list
> ntg-context@ntg.nl
> http://www.ntg.nl/mailman/listinfo/ntg-context
>
>
Andrea Valle
DAMS - Facoltà di Scienze della Formazione
Università degli Studi di Torino
http://www.semiotiche.it/andrea
andrea.valle@unito.it

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

* Re: absolute positioning of figures
  2006-10-13 16:56             ` andrea valle
@ 2006-10-13 17:58               ` Peter Rolf
  0 siblings, 0 replies; 9+ messages in thread
From: Peter Rolf @ 2006-10-13 17:58 UTC (permalink / raw)


andrea valle wrote:
> Example:
> 
> \definelayer    [layer2a][width=.15\paperwidth]
> 
> \setlayer       [layer2a]
>                  [x=.15\paperwidth, y=.5\paperheight]
>                  {\externalfigure[layTest][width=.75\paperwidth]}
>
extend your example with

\clip[width=.15\paperwidth,height=<define
one>,hoffset=0pt,voffset=0pt]{\externalfigure..}

and you can see the difference.. (no picture in the smaller layer).

As I already mentioned, the size is (only?) significant, if you change
the default positioning (reference point). For example, you want to
place something with an offset of 2cm to the right bottom corner of the
layer. Therefore you need the exact width and height of the layer.
All default positioning (relative to top left corner of the layer)
doesn't care about the size, as there is no difference (no calculation
is needed).

I hope I have made myself clear.

Greetings, Peter

> 
> I was expecting to have the layTest figure cut after its width exceeds 
> the layer's width. It seems that this is unrelevant, i.e.
> 
> If I have instead of this:
> 
> \definelayer    [layer2a][width=.15\paperwidth]
> 
> this:
> \definelayer    [layer2a][width=.75\paperwidth]
> 
> It's the same.
> 
> So, I cannot understand what width means for layers, as changing it has 
> no consequences (in my example).
> 
> Best
> 
> -a-
> 
> 
> 
> 
> 
> 
> On 13 Oct 2006, at 18:31, Hans Hagen wrote:
>> \definelayer[blabla][width=20cm,height30cm]
>>
>> etc etc
>>
>> -- 
>>
>> -----------------------------------------------------------------
>>                                           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
>> -----------------------------------------------------------------
>>
>> _______________________________________________
>> ntg-context mailing list
>> ntg-context@ntg.nl
>> http://www.ntg.nl/mailman/listinfo/ntg-context
>>
>>
> Andrea Valle
> DAMS - Facoltà di Scienze della Formazione
> Università degli Studi di Torino
> http://www.semiotiche.it/andrea
> andrea.valle@unito.it
> 
> _______________________________________________
> ntg-context mailing list
> ntg-context@ntg.nl
> http://www.ntg.nl/mailman/listinfo/ntg-context
> 
> 

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

end of thread, other threads:[~2006-10-13 17:58 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-10-12 21:30 absolute positioning of figures andrea valle
2006-10-12 22:00 ` Hans Hagen
2006-10-12 22:45   ` andrea valle
2006-10-13 14:33     ` andrea valle
2006-10-13 15:54       ` Peter Rolf
2006-10-13 16:22         ` andrea valle
2006-10-13 16:31           ` Hans Hagen
2006-10-13 16:56             ` andrea valle
2006-10-13 17:58               ` Peter Rolf

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