ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Mikael Persson <md9per@mdstud.chalmers.se>
Subject: Re: MetaPost backgrounds
Date: Sun, 10 Aug 2003 23:59:29 +0200	[thread overview]
Message-ID: <20030810235929.6575ca52.md9per@mdstud.chalmers.se> (raw)
In-Reply-To: <20030810205058.278afdf2.morawski@gmx.net>

On Sun, 10 Aug 2003 20:50:58 +0200
Jens-Uwe Morawski <morawski@gmx.net> wrote:

> On Sun, 10 Aug 2003 09:30:48 +0200
> Mikael Persson <md9per@mdstud.chalmers.se> wrote:
> 
> > I had some problems with backgrounds in a table. I wanted just a
> > horizontal line, but in different heights. The problem is that the >
> > line will always be in the middle of the cell if I don't add more >
> > > graphics.
> > See the example file below.
> 
> the graphics are always centered in the cell. therefore you have to >
> set the bounding box  of the graphic to the cell size
> 
> > % This works, but is not nice.
> > 
> > \startuniqueMPgraphic{splittop}
> > draw (0,0)--(OverlayWidth,OverlayHeight) withcolor white;%should not
> > be necessary
> > draw (0,0.725*OverlayHeight)--(OverlayWidth,0.725*OverlayHeight);
> > \stopuniqueMPgraphic
> 
> the following should give what you want (untested)
> 
> \startuniqueMPgraphic{splittop}
> draw (0,0.725*OverlayHeight)--(OverlayWidth,0.725*OverlayHeight);
> setbounds currentpicture to (unitsquare xyscaled > >
> (OverlayWidth,OverlayHeight)) ;\stopuniqueMPgraphic
> 
> in order to save some typing you could define a macro
> 
> \startMPinclusions
> def FitToOverlay =
>    setbounds currentpicture to (unitsquare xyscaled > >
>    (OverlayWidth,OverlayHeight)) ;
> enddef;
> \stopMPinclusions
> 
> \startuniqueMPgraphic{splittop}
> draw (0,0.725*OverlayHeight)--(OverlayWidth,0.725*OverlayHeight);
> FitToOverlay ;
> \stopuniqueMPgraphic
> 
> Jens


Jens,

Thanks a lot! I did not know that the graphics are centered in the cell.
Now this mystery (to me) is not a mystery no more :)

Regards, Micke P

       reply	other threads:[~2003-08-10 21:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20030810093048.5d6fc12b.md9per@mdstud.chalmers.se>
     [not found] ` <20030810205058.278afdf2.morawski@gmx.net>
2003-08-10 21:59   ` Mikael Persson [this message]
2003-08-11 12: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=20030810235929.6575ca52.md9per@mdstud.chalmers.se \
    --to=md9per@mdstud.chalmers.se \
    --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).