ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Absolute positioning of \startcombination... \stopcombination
@ 2023-03-16 16:59 Keith McKay via ntg-context
  2023-03-16 17:27 ` Wolfgang Schuster via ntg-context
  2023-03-16 17:58 ` Pablo Rodriguez via ntg-context
  0 siblings, 2 replies; 7+ messages in thread
From: Keith McKay via ntg-context @ 2023-03-16 16:59 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Keith McKay


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

Hi,

I would like to position a combination of images where the centre of the 
combination coincides with the centre of the text area of a page. In the 
example below I have made the combination into a layer thinking that 
this would be the easiest way to position it where I wanted. However to 
position in the centre of the page I would need to know the size of the 
combination and use this to calculate the x and y values for positioning 
of the layer. I have looked at the Wiki page on image size of 
combinations but still cant figure out how to do it. Any suggestions on 
how to go about this or is their a better way?

Wiki Page reference: https://wiki.contextgarden.net/Combinations#Image_Width

Thanks

Keith McKay

%%% example %%%

\setuppapersize[A4,portrait]%[A4,portrait]

\setuplayout

[backspace=2.5cm,

topspace=1cm,

height=28cm,

width=17cm,

header=0cm,

footer=0.75cm,

]

\useMPlibrary [dum]

\starttext

\definelayer[test3]

\setlayer[test3][x=2cm,y=15cm]

{\startcombination[nx=3,ny=1,distance=15mm,after=,location=middle]

{\externalfigure[dummy]}{}

\rotate[rotation=90]{\externalfigure[dummy]}{}

{\externalfigure[dummy][]}{}

\stopcombination}

\flushlayer[test3]

\stoptext

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

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

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : https://contextgarden.net
___________________________________________________________________________________

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

* Re: Absolute positioning of \startcombination... \stopcombination
  2023-03-16 16:59 Absolute positioning of \startcombination... \stopcombination Keith McKay via ntg-context
@ 2023-03-16 17:27 ` Wolfgang Schuster via ntg-context
  2023-03-16 18:07   ` Alan Braslau via ntg-context
  2023-03-16 17:58 ` Pablo Rodriguez via ntg-context
  1 sibling, 1 reply; 7+ messages in thread
From: Wolfgang Schuster via ntg-context @ 2023-03-16 17:27 UTC (permalink / raw)
  To: mailing list for ConTeXt users, Keith McKay via ntg-context
  Cc: Wolfgang Schuster, Keith McKay


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

Keith McKay via ntg-context schrieb am 16.03.2023 um 17:59:
>
> Hi,
>
> I would like to position a combination of images where the centre of 
> the combination coincides with the centre of the text area of a page. 
> In the example below I have made the combination into a layer thinking 
> that this would be the easiest way to position it where I wanted. 
> However to position in the centre of the page I would need to know the 
> size of the combination and use this to calculate the x and y values 
> for positioning of the layer. I have looked at the Wiki page on image 
> size of combinations but still cant figure out how to do it. Any 
> suggestions on how to go about this or is their a better way?
>
> Wiki Page reference: 
> https://wiki.contextgarden.net/Combinations#Image_Width
>
> Thanks
>
> Keith McKay
>
> %%% example %%%
>
> \setuppapersize[A4,portrait]%[A4,portrait]
>
> \setuplayout
>
> [backspace=2.5cm,
>
> topspace=1cm,
>
> height=28cm,
>
> width=17cm,
>
> header=0cm,
>
> footer=0.75cm,
>
> ]
>
> \useMPlibrary [dum]
>
> \starttext
>
> \definelayer[test3]
>
> \setlayer[test3][x=2cm,y=15cm]
>
> {\startcombination[nx=3,ny=1,distance=15mm,after=,location=middle]
>
> {\externalfigure[dummy]}{}
>
> \rotate[rotation=90]{\externalfigure[dummy]}{}
>
> {\externalfigure[dummy][]}{}
>
> \stopcombination}
>
> \flushlayer[test3]
>
> \stoptext
>

\useMPlibrary [dum]

\showframe [text] [text]

\setuplayout [tight]

\starttext

\centerbox
    {\bTABLE[frame=off,offset=7.5mm,align={middle,lohi}]
         \bTR
             \bTD
                 \externalfigure[dummy]
             \eTD
             \bTD
                 \rotate[rotation=90]{\externalfigure[dummy]}
             \eTD
             \bTD
                 \externalfigure[dummy]
             \eTD
         \eTR
     \eTABLE}

\stoptext

Wolfgang


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

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

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : https://contextgarden.net
___________________________________________________________________________________

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

* Re: Absolute positioning of \startcombination... \stopcombination
  2023-03-16 16:59 Absolute positioning of \startcombination... \stopcombination Keith McKay via ntg-context
  2023-03-16 17:27 ` Wolfgang Schuster via ntg-context
@ 2023-03-16 17:58 ` Pablo Rodriguez via ntg-context
  2023-03-17 12:11   ` Keith McKay via ntg-context
  1 sibling, 1 reply; 7+ messages in thread
From: Pablo Rodriguez via ntg-context @ 2023-03-16 17:58 UTC (permalink / raw)
  To: Keith McKay via ntg-context; +Cc: Pablo Rodriguez

On 3/16/23 17:59, Keith McKay via ntg-context wrote:
> Hi,
> 
> I would like to position a combination of images where the centre of the
> combination coincides with the centre of the text area of a page.

Hi Keith,

I think the following sample might achieve what you want:

  \showframe
  \setupexternalfigures[location={default}]
  \setuplayout
    [backspace=2.5cm,
    topspace=1cm,
    height=28cm,
    width=17cm,
    header=0cm,
    footer=0.75cm,
    ]
  \definelayer[test3]
  %[x=.5\paperwidth, y=.5\paperheight]
  [x=.5\textwidth, y=.5\textheight]
  %\setupbackgrounds[page]
  \setupbackgrounds[text]
  [background=test3]
  \starttext
  \setlayer[test3][location={middle}]
     \framed[offset=overlay]{{\startcombination[nx=3,ny=1,distance=15mm]
            {\externalfigure[cow][width=15mm]}{}
            \rotate[rotation=90]{\externalfigure[cow][width=15mm]}{}
            {\externalfigure[cow][width=15mm]}{}
     \stopcombination}}
  \null
  \stoptext

BTW, A4 portrait is the default page size.

\setupbackgrounds is the standard way to place layers.

Page and text centering would require different positions (I have
commented out the option for page centering).

I hope it helps (since I’m not sure I’m getting your point here),

Pablo
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : https://contextgarden.net
___________________________________________________________________________________

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

* Re: Absolute positioning of \startcombination... \stopcombination
  2023-03-16 17:27 ` Wolfgang Schuster via ntg-context
@ 2023-03-16 18:07   ` Alan Braslau via ntg-context
  2023-03-16 19:50     ` Keith McKay via ntg-context
  0 siblings, 1 reply; 7+ messages in thread
From: Alan Braslau via ntg-context @ 2023-03-16 18:07 UTC (permalink / raw)
  To: Wolfgang Schuster via ntg-context; +Cc: Alan Braslau, Keith McKay

On Thu, 16 Mar 2023 18:27:53 +0100
Wolfgang Schuster via ntg-context <ntg-context@ntg.nl> wrote:

> Keith McKay via ntg-context schrieb am 16.03.2023 um 17:59:
> >
> > Hi,
> >
> > I would like to position a combination of images where the centre
> > of the combination coincides with the centre of the text area of a
> > page. In the example below I have made the combination into a layer
> > thinking that this would be the easiest way to position it where I
> > wanted. However to position in the centre of the page I would need
> > to know the size of the combination and use this to calculate the x
> > and y values for positioning of the layer. I have looked at the
> > Wiki page on image size of combinations but still cant figure out
> > how to do it. Any suggestions on how to go about this or is their a
> > better way?
> >
> > Wiki Page reference: 
> > https://wiki.contextgarden.net/Combinations#Image_Width
> >
> > Thanks
> >
> > Keith McKay
> >
> > %%% example %%%
> >
> > \setuppapersize[A4,portrait]%[A4,portrait]
> >
> > \setuplayout
> >
> > [backspace=2.5cm,
> >
> > topspace=1cm,
> >
> > height=28cm,
> >
> > width=17cm,
> >
> > header=0cm,
> >
> > footer=0.75cm,
> >
> > ]
> >
> > \useMPlibrary [dum]
> >
> > \starttext
> >
> > \definelayer[test3]
> >
> > \setlayer[test3][x=2cm,y=15cm]
> >
> > {\startcombination[nx=3,ny=1,distance=15mm,after=,location=middle]
> >
> > {\externalfigure[dummy]}{}
> >
> > \rotate[rotation=90]{\externalfigure[dummy]}{}
> >
> > {\externalfigure[dummy][]}{}
> >
> > \stopcombination}
> >
> > \flushlayer[test3]
> >
> > \stoptext
> >  
> 
> \useMPlibrary [dum]
> 
> \showframe [text] [text]
> 
> \setuplayout [tight]
> 
> \starttext
> 
> \centerbox
>     {\bTABLE[frame=off,offset=7.5mm,align={middle,lohi}]
>          \bTR
>              \bTD
>                  \externalfigure[dummy]
>              \eTD
>              \bTD
>                  \rotate[rotation=90]{\externalfigure[dummy]}
>              \eTD
>              \bTD
>                  \externalfigure[dummy]
>              \eTD
>          \eTR
>      \eTABLE}
> 
> \stoptext
> 
> Wolfgang

Or you could put the combination in a frame:

\startparagraph [align=middle]
  \startframed [frame=off,offset=\zeropoint]
    \startcombination [nx=3,ny=1]
      {first} {}
      {second}{}
      {third} {}
    \stopcombination
  \stopframed
\stopparagraph

Alan
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : https://contextgarden.net
___________________________________________________________________________________

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

* Re: Absolute positioning of \startcombination... \stopcombination
  2023-03-16 18:07   ` Alan Braslau via ntg-context
@ 2023-03-16 19:50     ` Keith McKay via ntg-context
  2023-03-17 11:13       ` Keith McKay via ntg-context
  0 siblings, 1 reply; 7+ messages in thread
From: Keith McKay via ntg-context @ 2023-03-16 19:50 UTC (permalink / raw)
  To: Alan Braslau; +Cc: Keith McKay, Wolfgang Schuster via ntg-context


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

Thanks Wolfgang and Alan! I will experiment with them tomorrow.
Best Wishes
Keith McKay


On Thu, 16 Mar 2023, 18:07 Alan Braslau, <alan.braslau@icloud.com> wrote:

> On Thu, 16 Mar 2023 18:27:53 +0100
> Wolfgang Schuster via ntg-context <ntg-context@ntg.nl> wrote:
>
> > Keith McKay via ntg-context schrieb am 16.03.2023 um 17:59:
> > >
> > > Hi,
> > >
> > > I would like to position a combination of images where the centre
> > > of the combination coincides with the centre of the text area of a
> > > page. In the example below I have made the combination into a layer
> > > thinking that this would be the easiest way to position it where I
> > > wanted. However to position in the centre of the page I would need
> > > to know the size of the combination and use this to calculate the x
> > > and y values for positioning of the layer. I have looked at the
> > > Wiki page on image size of combinations but still cant figure out
> > > how to do it. Any suggestions on how to go about this or is their a
> > > better way?
> > >
> > > Wiki Page reference:
> > > https://wiki.contextgarden.net/Combinations#Image_Width
> > >
> > > Thanks
> > >
> > > Keith McKay
> > >
> > > %%% example %%%
> > >
> > > \setuppapersize[A4,portrait]%[A4,portrait]
> > >
> > > \setuplayout
> > >
> > > [backspace=2.5cm,
> > >
> > > topspace=1cm,
> > >
> > > height=28cm,
> > >
> > > width=17cm,
> > >
> > > header=0cm,
> > >
> > > footer=0.75cm,
> > >
> > > ]
> > >
> > > \useMPlibrary [dum]
> > >
> > > \starttext
> > >
> > > \definelayer[test3]
> > >
> > > \setlayer[test3][x=2cm,y=15cm]
> > >
> > > {\startcombination[nx=3,ny=1,distance=15mm,after=,location=middle]
> > >
> > > {\externalfigure[dummy]}{}
> > >
> > > \rotate[rotation=90]{\externalfigure[dummy]}{}
> > >
> > > {\externalfigure[dummy][]}{}
> > >
> > > \stopcombination}
> > >
> > > \flushlayer[test3]
> > >
> > > \stoptext
> > >
> >
> > \useMPlibrary [dum]
> >
> > \showframe [text] [text]
> >
> > \setuplayout [tight]
> >
> > \starttext
> >
> > \centerbox
> >     {\bTABLE[frame=off,offset=7.5mm,align={middle,lohi}]
> >          \bTR
> >              \bTD
> >                  \externalfigure[dummy]
> >              \eTD
> >              \bTD
> >                  \rotate[rotation=90]{\externalfigure[dummy]}
> >              \eTD
> >              \bTD
> >                  \externalfigure[dummy]
> >              \eTD
> >          \eTR
> >      \eTABLE}
> >
> > \stoptext
> >
> > Wolfgang
>
> Or you could put the combination in a frame:
>
> \startparagraph [align=middle]
>   \startframed [frame=off,offset=\zeropoint]
>     \startcombination [nx=3,ny=1]
>       {first} {}
>       {second}{}
>       {third} {}
>     \stopcombination
>   \stopframed
> \stopparagraph
>
> Alan
>

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

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

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : https://contextgarden.net
___________________________________________________________________________________

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

* Re: Absolute positioning of \startcombination... \stopcombination
  2023-03-16 19:50     ` Keith McKay via ntg-context
@ 2023-03-17 11:13       ` Keith McKay via ntg-context
  0 siblings, 0 replies; 7+ messages in thread
From: Keith McKay via ntg-context @ 2023-03-17 11:13 UTC (permalink / raw)
  To: Alan Braslau; +Cc: Keith McKay, Wolfgang Schuster via ntg-context


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

Hi,

I've experimented this morning with the solutions suggested by Wolfgang 
and Alan in reply to my post.

The solution is really quite simple as suggested by Wolfgang i.e. 
\centerbox{..}.  I have applied this to the code and I now have three 
different solutions to my initial problem. The Joy of ConTeXt!

Thanks again Wolfgang and Alan.

Best Wishes

Keith McKay

Here is the code showing the three solutions which others may find useful.

\setuppapersize[A4,portrait]%[A4,portrait]

\setuplayout

[backspace=2.5cm,

topspace=1cm,

height=28cm,

width=17cm,

header=0cm,

footer=0.75cm,

]

\setuppagenumbering[state=start,alternative=doublesided,location=margin]

\useMPlibrary [dum]

\starttext

%%% Me %%%

\showframe [text] [text]

\definelayer[test3]

\setlayer[test3][]

\centerbox{

{\startcombination[nx=3,ny=1,distance=15mm,after=,location=middle]

{\externalfigure[dummy]}{}

\rotate[rotation=90]{\externalfigure[dummy]}{}

{\externalfigure[dummy][]}{}

\stopcombination}

}

\flushlayer[test3]

\page

%%% Wolfgang %%%

\centerbox

{\bTABLE[frame=off,offset=7.5mm,align={middle,lohi}]

\bTR

\bTD

\externalfigure[dummy]

\eTD

\bTD

\rotate[rotation=90]{\externalfigure[dummy]}

\eTD

\bTD

\externalfigure[dummy]

\eTD

\eTR

\eTABLE}

\page

%%% Alan %%%

\centerbox{

\startparagraph [align=middle]

\startframed [frame=off,offset=\zeropoint]

\startcombination [nx=3,ny=1,distance=15mm,after=,location=middle]

{\externalfigure[dummy]}{}

\rotate[rotation=90]{\externalfigure[dummy]}{}

{\externalfigure[dummy][]}{}

\stopcombination

\stopframed

\stopparagraph

}

\stoptext

On 16/03/2023 19:50, Keith McKay wrote:
> Thanks Wolfgang and Alan! I will experiment with them tomorrow.
> Best Wishes
> Keith McKay
>
>

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

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

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : https://contextgarden.net
___________________________________________________________________________________

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

* Re: Absolute positioning of \startcombination... \stopcombination
  2023-03-16 17:58 ` Pablo Rodriguez via ntg-context
@ 2023-03-17 12:11   ` Keith McKay via ntg-context
  0 siblings, 0 replies; 7+ messages in thread
From: Keith McKay via ntg-context @ 2023-03-17 12:11 UTC (permalink / raw)
  To: ntg-context; +Cc: Keith McKay

Thanks for your reply Pablo. I didn't see it till just now because for 
some reason it ended up in my junk folder, along with a number of other 
ConTeXt messages. You will probably have seen my reply to the list with 
the three solutions, now we have four!

Yep, I know that A4 is the default page size and I always start with 
that but sometimes I play about with page sizes when typesetting and so 
can just change when coding.

In the document I'm working on, some pages will only contain images 
and/or combination of images so I went down the Layers route since this 
also allows me to absolutely position these images on the page.

Thanks again for your help!

Best Wishes

Keith McKay

On 16/03/2023 17:58, Pablo Rodriguez via ntg-context wrote:
> On 3/16/23 17:59, Keith McKay via ntg-context wrote:
>> Hi,
>>
>> I would like to position a combination of images where the centre of the
>> combination coincides with the centre of the text area of a page.
> Hi Keith,
>
> I think the following sample might achieve what you want:
>
>    \showframe
>    \setupexternalfigures[location={default}]
>    \setuplayout
>      [backspace=2.5cm,
>      topspace=1cm,
>      height=28cm,
>      width=17cm,
>      header=0cm,
>      footer=0.75cm,
>      ]
>    \definelayer[test3]
>    %[x=.5\paperwidth, y=.5\paperheight]
>    [x=.5\textwidth, y=.5\textheight]
>    %\setupbackgrounds[page]
>    \setupbackgrounds[text]
>    [background=test3]
>    \starttext
>    \setlayer[test3][location={middle}]
>       \framed[offset=overlay]{{\startcombination[nx=3,ny=1,distance=15mm]
>              {\externalfigure[cow][width=15mm]}{}
>              \rotate[rotation=90]{\externalfigure[cow][width=15mm]}{}
>              {\externalfigure[cow][width=15mm]}{}
>       \stopcombination}}
>    \null
>    \stoptext
>
> BTW, A4 portrait is the default page size.
>
> \setupbackgrounds is the standard way to place layers.
>
> Page and text centering would require different positions (I have
> commented out the option for page centering).
>
> I hope it helps (since I’m not sure I’m getting your point here),
>
> Pablo
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an entry to the Wiki!
>
> maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki     : https://contextgarden.net
> ___________________________________________________________________________________
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : https://contextgarden.net
___________________________________________________________________________________

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

end of thread, other threads:[~2023-03-17 12:11 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-16 16:59 Absolute positioning of \startcombination... \stopcombination Keith McKay via ntg-context
2023-03-16 17:27 ` Wolfgang Schuster via ntg-context
2023-03-16 18:07   ` Alan Braslau via ntg-context
2023-03-16 19:50     ` Keith McKay via ntg-context
2023-03-17 11:13       ` Keith McKay via ntg-context
2023-03-16 17:58 ` Pablo Rodriguez via ntg-context
2023-03-17 12:11   ` Keith McKay via ntg-context

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