ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Duncan Hothersall <dh@capdm.com>
To: ntg-context@ntg.nl
Subject: MPgraphic with rounded corners
Date: Thu, 15 Jan 2009 17:26:55 +0000	[thread overview]
Message-ID: <496F71DF.5080605@capdm.com> (raw)

Hello all.

I have adapted a bit of MP code from Aditya from a mailing list message 
dated 2006-05-19 
(http://archive.contextgarden.net/message/20060519.214124.9174ac0e.en.html) 
to ensure that when a page break occurs in a textbackground there is a 
forced vertical space inside the box at the top of the new page.

This code works fine for me (although interestingly not in the garden):


\setupcolors[state=start]

\startuseMPgraphic{mpos:par:myexample}
path p;
for i = 1 upto nofmultipars :
p := multipars[1] topenlarged 8pt bottomenlarged 8pt;
fill p withcolor 0.9white ;
draw p withcolor black
withpen pencircle scaled \MPvar{linewidth};
endfor;
\stopuseMPgraphic

\definetextbackground[ExampleBackground]
        
[mp=mpos:par:myexample,location=paragraph,leftoffset=1em,rightoffset=1em,rulethickness=1pt]

\starttext
\input knuth \endgraf
\starttextbackground[ExampleBackground]
\dorecurse{13}{\input knuth \endgraf}
\stoptextbackground
\input knuth \endgraf
\stoptext


But now I need to make this box have rounded corners, and I am very 
confused when reading core-pgr.tex because that is a level of MP code I 
just don't understand.

Would somebody please be able to tell me what to change in the above to 
make the corners of the box rounded (with a radius of 2mm)?

Thank you very much!

Duncan

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


             reply	other threads:[~2009-01-15 17:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-15 17:26 Duncan Hothersall [this message]
2009-01-15 17:48 ` Aditya Mahajan
2009-01-18 11:05   ` mpgraph and minimals Alan BRASLAU
2009-01-18 13:48     ` Hans Hagen
2009-01-15 17:48 ` MPgraphic with rounded corners Wolfgang Schuster
     [not found] <mailman.6627.1232044057.19169.ntg-context@ntg.nl>
2009-01-16  8:27 ` Duncan Hothersall

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=496F71DF.5080605@capdm.com \
    --to=dh@capdm.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).