ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Wolfgang Schuster <schuster.wolfgang@googlemail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Center (horizontal + vertical) an image in \setframed
Date: Sun, 1 Jan 2012 10:23:10 +0100	[thread overview]
Message-ID: <09636156-77B4-4D5C-8607-A6A39F34ECC9@googlemail.com> (raw)
In-Reply-To: <4EFF1D1C.3090106@gmx.de>


Am 31.12.2011 um 15:33 schrieb Jan Heinen:

> Hello
> 
> I want to center (horizontal and vertical) an image in a frame.
> 
> 2. This is a complete example. I used a second \setframed to show the area in which the cow should be centered and middled:
> 
> \definelayer    [Kontaktdaten]
>        [x=0mm, y=0mm,
>        width=\paperwidth, height=\paperheight]
> \setupbackgrounds [paper]

Do you know the difference between “paper” and “page”?

>  [
>    background=Kontaktdaten,
>    state=start
>  ]%
> \starttext
>    \setlayerframed [Kontaktdaten]
>      [
>    width=120mm,
>    height=120mm,
>    hoffset=50mm,
>    voffset=50mm
>      ]
>      [strut=no,offset=overlay,frame=on]
>      {\framed [width=120mm, height=120mm]{~}}%
> 
>    \setlayerframed [Kontaktdaten]
>      [
>    width=120mm,
>    height=120mm,
>    hoffset=50mm,
>    voffset=50mm
>      ]
>      [strut=no,offset=overlay,frame=on]
>      {\externalfigure[cow][width=100mm,height=100mm]}%
> 
> test
> \page
> \stoptext

\definelayer[Kontaktdaten][width=\paperwidth, height=\paperheight]

\setupbackgrounds[page][background=Kontaktdaten]

\starttext

\setlayerframed
  [Kontaktdaten]
  [hoffset=50mm,
   voffset=50mm]
  [width=120mm,
   height=120mm,
   strut=no,
   frame=on]
  {\externalfigure[cow][width=100mm,height=100mm,frame=on]}%

\dontleavehmode\page

\stoptext

Wolfgang
___________________________________________________________________________________
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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


      parent reply	other threads:[~2012-01-01  9:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-31 14:33 Jan Heinen
2011-12-31 14:44 ` luigi scarso
2011-12-31 17:48   ` Jan Heinen
2012-01-02 16:21     ` Pagereferences to more than one page Jan Heinen
2012-01-02 16:29       ` Hans Hagen
2012-01-02 16:30       ` luigi scarso
2012-01-02 18:28         ` luigi scarso
2012-01-01  9:23 ` Wolfgang Schuster [this message]

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=09636156-77B4-4D5C-8607-A6A39F34ECC9@googlemail.com \
    --to=schuster.wolfgang@googlemail.com \
    --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).