ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Rudolf Bahr <quasi@quasi.de>
To: ntg-context@ntg.nl
Subject: Re: Moving horizontally a whole ensemble of layers in the same run?
Date: Wed, 18 Dec 2019 19:46:03 +0100	[thread overview]
Message-ID: <20191218184603.GA6603@nan> (raw)
In-Reply-To: <137cfc97-50e7-29e1-bbb1-6463891f2fd8@gmail.com>

On Wed, Dec 18, 2019 at 06:13:51PM +0100, Wolfgang Schuster wrote:
> Rudolf Bahr schrieb am 18.12.2019 um 15:13:
> > On Tue, Dec 17, 2019 at 07:30:49PM +0100, Hans Hagen wrote:
> > 
> > > you need to make a MWE to show what you mean
> > > 
> > > normally
> > > 
> > > \hbox to <somewidth>{\hss<come content>\hss}
> > > 
> > > is good enough for centering
> > Here is my MWE. Think of a photo album. To make it interesting the pages should
> > all be different. To this purpose layers are a good means. I'd like to centre
> > the layers on their page without doing so manually and without changig the distances
> > between them. Using luacode one can calculate the distance d between the leftmost
> > and the rightmost edge. Half the difference (\textwidth - d) is the amount to move
> > the whole layer ensemble.
> > 
> > My question is now: Does in context exist a possibility to move all layers jointly
> > without correcting all their x-values subsequently?
> 
> 1. You can use hoffset and voffset to shift all layers.
> 
> 2. You can use \setlayerframed to put paragraphs in a layer.
> 
> 
> \setuppapersize[A4,landscape]
> 
> \setupexternalfigures[location=default]
> 
> \definelayer[LAY]
> 
> \starttext
> 
> \startbuffer
> 
> \setlayerframed
>   [LAY]
>   [x=0pt,
>    y=-8pt]
>   [frame=off,
>    width=.35\textwidth,
>    align={normal,tolerant}]
>   {\externalfigure[cow][width=\hsize]
>    \blank[line]
>    \input tufte\par}
> 
> \setlayerframed
>   [LAY]
>   [x=225pt,
>    y=0pt]
>   [orientation=90,
>    foregroundstyle={\definedfont[Serif at 82pt]}]
>   {JOURNEY}
> 
> \setlayerframed
>   [LAY]
>   [x=360pt,
>    y=50pt]
>   [frame=off,
>    width=200pt,
>    align={normal,tolerant}]
>   {\input ward
>    \blank[line]
>    \externalfigure[hacker][height=.4\textheight]}
> 
> \flushlayer[LAY]
> 
> \stopbuffer
> 
> \getbuffer
> 
> \page
> 
> \setuplayer[LAY][hoffset=4cm,voffset=-2cm]
> 
> \getbuffer
> 
> \stoptext
> 
> Wolfgang
> 

Thank you very much, Wolfgang! That is exactly what I need
and what I was looking for! Very nice coding indeed!

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

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

  reply	other threads:[~2019-12-18 18:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-18 14:13 Rudolf Bahr
2019-12-18 17:13 ` Wolfgang Schuster
2019-12-18 18:46   ` Rudolf Bahr [this message]
  -- strict thread matches above, loose matches on Subject: below --
2019-12-17 18:18 Rudolf Bahr
2019-12-17 18:30 ` Hans Hagen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191218184603.GA6603@nan \
    --to=quasi@quasi.de \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).