ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Aditya Mahajan <adityam@umich.edu>
Subject: Re: metafun "boxes"
Date: Thu, 2 Mar 2006 16:12:11 -0500 (EST)	[thread overview]
Message-ID: <Pine.WNT.4.63.0603021606030.2392@nqvgln> (raw)
In-Reply-To: <44074A5A.5030001@nibua-r.org>

<--- On Mar 2, Renaud AUBIN wrote --->

>
> Hi all,
>
> Yesterday, I have tried to put "\input boxes" within a MPgraphic. As a
> result, I obtain errors at compilation. After discussing this issue with
> Taco on #context, it appears that boxes.mp and metafun interaction is
> not safe at all.

Shouldn't  that be input boxes; in a MPinclusions?

> X. others solutions I don't know yet... (feel free to add yours !)

Have a look at metaobj.
> My thought is to finally obtain in metafun:
> 1. Nodes with text (multiline text!)

Place inside a framed

> and a collection of "simple" shapes to use like box, circle, box 
> with rounded corner...

Metaobj provides all basic shapes

> 2. Nodes must be placed freely accroding to the metapost coordinate 
> system

Metaobj provides a better interface to placement. You can specify the 
distance and alignment between the nodes.

> 3. Connections between nodes (using boundaries of each nodes +
> possibility to give angles from...to for each connections)

Has all of that

> See http://renolab.lrv.uvsq.fr/perso/ConTeXt/sample.png to have an idea

See the example below. metaobj has some bugs and limitations, but 
works as expected most of the time.

\starttext

\startMPenvironment
   \setupbodyfont[8pt]
   \setupframed[width=3cm, align=center, frame=off]
\stopMPenvironment

\startMPinclusions
   input metaobj;
   setObjectDefaultOption("Ellipse")("fit")(false)
   setCurveDefaultOption("arcangleA",15);
   setCurveDefaultOption("arcangleB",15);
\stopMPinclusions

\startMPpage
   % Metaobj provides a Circle command. But there seems to be
   % a bug in the interaction of Circle and Matix. So using Ellipse with
   % fit=false
   newEllipse.N1(btex \framed{Mise Sous Tension} etex) ;
   newEllipse.N2(btex \framed{Mesure du point zéro méchaique} etex) ;
   newEllipse.N3(btex \framed{Régalage des paramèters de contrôle} etex) ;
   newEllipse.N4(btex \framed{Envoi du contenu de l'\cap{EEPROM}} etex) ;
   newEllipse.N5(btex \framed{{\bf Mode stop|/| réglage}
                 Attente de commande} etex) ;
   newEllipse.N6(btex \framed{\bf Mode freins libres} etex) ;
   newEllipse.N7(btex \framed{Le contenu de l'\cap{EEPROM} a changé} etex) ;
   newEllipse.N8(btex \framed{Ëcriture du contenu de la
                 \cap{RAM} vers l'\cap{EEPROM}} etex);
   newEllipse.N9(btex \framed{{\bf Mode  Contrôle} La valeur
                 de la commande est rafraîchie à chaque cycle} etex) ;

   newMatrix.diagram(3,3)(N1,N2,N3,N4,N5,N6,N7,N8,N9)
                     "hsep(1.5cm)", "vsep(1.5cm)";
   diagram.c = origin ;
   drawObj(diagram) ;
   ncline(N1)(N5) ;
   for i = 2,3,4,6,7,8,9:
     ncarc(N[i])(N[5]) ;
     ncarc(N[5])(N[i]) ;
   endfor
   nccircle(N6) "angleA(-120)" ;
   nccircle(N9) "angleA(-120)" ;

   % Labels can be added. See metaobj manual

\stopMPpage

\stoptext





-- 
Aditya Mahajan, EECS Systems, University of Michigan
http://www.eecs.umich.edu/~adityam || Ph: 7342624008

  reply	other threads:[~2006-03-02 21:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-02 19:41 Renaud AUBIN
2006-03-02 21:12 ` Aditya Mahajan [this message]
2006-03-02 21:55   ` Renaud AUBIN

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=Pine.WNT.4.63.0603021606030.2392@nqvgln \
    --to=adityam@umich.edu \
    --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).