ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <pragma@wxs.nl>
To: ntg-context@ntg.nl
Subject: Re: [***SPAM***] Scaling large (annotated) MetaFun drawing
Date: Tue, 18 Jun 2013 23:43:00 +0200	[thread overview]
Message-ID: <51C0D464.5050006@wxs.nl> (raw)
In-Reply-To: <20130618131313.GA10396@haridwar>

On 6/18/2013 3:13 PM, Pavneet Arora wrote:
> [Sorry about the previous null message.]
>
> Background:
>
> Typically I use MetaPost to create small figures, which I then can scale
> as needed in larger documents.  These figures contain no text so I can
> simply use the .eps output of mpost as an inclusion.
>
> Recently, I have embarked on a large illustration replete with lots of
> text labels.  It is a "distilled" architectural drawing intended for
> diagnostic and maintenance purposes.  In it plumbing details are
> overlaid over a layout.  For simplicity, I standardized on unit size of
> 1cm so that co-ordinates can easily map from physical dimensions with
> the unusual hybrid scale of 1cm=1ft ;)..
>
> Status:
>
> With this set unit size, my drawing has grown very large.  My intent is
> to get it printed on one of the (U.S.) based architectural paper sizes,
> or if it can be made legible on U.S. Tabloid size paper (17" x 11")..
> My first successful approach (and where I stand right now) is to simply
> use \startMPpage and \stopMPpage to scale to the page.
>
> Thera are a couple of issues, though, with this approach.  First, I want
> to add additional information to the page, other than what would be
> handled by MetaPost, e.g., some tables, etc.  Even without this
> additional information, having the drawing scale to page size does not
> give adequate margin buffering and if there are some labels right at the
> edge, I have seen some clipping of the text.
>
> Objective:
>
> I would like to create a scalable drawing with all of its text
> labels so that I can scale appropriately to different page sizes, and
> also incorporate the illustration with other document elements.
>
>  From what I have read at:
>
> http://wiki.contextgarden.net/MetaPost_in_ConTeXt
>
> I think what I need is something akin to \startuseMPgraphic with a
> scaling option if I want to include the code inline.  Otherwise, the
> drawing is clipped on the page.

you can use the \scale command

\scale[width=1cm]{\useMPgraphic{somename}}

it takes the same options as externalfigure

> Or perhaps I simply try to convert the existing PDF output to PS, and
> then include it?
>
> What I am hoping is to get a best practises workflow from the list so
> that I can simply adopt it.
>
> advTHANKSance.
>
> Sample:
>
> A MWE is found below:
>
> \setuppapersize[tabloid,landscape][tabloid,landscape]
> \starttext
>
> \setupMPinstance
> 	[metafun]
> 	[extensions=yes,
> 	initializations=yes,
> 	textstyle=bold]
>
> \startMPpage
> u:=1cm;
>
> pickup pencircle scaled 1pt;
>
> draw (5u,0u) {dir 90}..(0u,5u) {dir 180};
> draw (0u,5u) .. (-1.5u,10.5u) {dir 90} .. (0u,16u);
> draw (0u,16u) {dir 0} .. (5u,21u) {dir 90};
> draw (5u,21u) -- (39u,21u);
> draw (39u,21u) {dir 270} .. (42u,18u) {dir 0};
> draw (42u,18u) .. (43.5u,10.5u) {dir 270} .. (42u,3u);
> draw (42u,3u) {dir 180} .. (39u,0u) {dir 270};
> draw (39u,0u) -- (35u,0u);
> draw (35u,0u) .. (22u,3u) {dir 180} .. (9u,0u);
> draw (9u,0u) -- (5u,0u);
> label(btex AN ARCHITECTURAL ELEMENT etex, (22u,10.5u));
>
> \stopMPpage
> \stoptext
>
>


-- 

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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
___________________________________________________________________________________


      reply	other threads:[~2013-06-18 21:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-18 13:13 Pavneet Arora
2013-06-18 21:43 ` Hans Hagen [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=51C0D464.5050006@wxs.nl \
    --to=pragma@wxs.nl \
    --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).