ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Oliver Buerschaper <oliver.buerschaper@mpq.mpg.de>
To: Hans Hagen <pragma@wxs.nl>
Subject: Re: Passing info from MetaPost to TeX
Date: Sat, 24 Jul 2010 20:35:10 +0200	[thread overview]
Message-ID: <14EF1920-A946-478D-A0F6-FE67F0E66933@mpq.mpg.de> (raw)
In-Reply-To: <4C48A86C.7050505@wxs.nl>

>> is it possible to pass data from MetaPost back to TeX? This would be similar in spirit to, say, the MetaPost variable BodyFontSize that contains data from the TeX surrounding. Just the other way round.
> 
> maybe future mlib versions will provide something like that (writing something from mp to a lua table); currently you have to use a file or interpret the log (use show to print out values).

OK. What I have in mind is to vertically align a diagram with the math axis... something like:

---
\startuseMPgraphic{diagram}
   u := StrutHeight;
   draw origin--(2u,0)--(u,sqrt(3)*u)--cycle;
   % MathAxis at y-coordinate sqrt(3)*u/3
\stopuseMPgraphic


\starttext

\startformula
   A\useMPgraphic{diagram}
   =B
\stopformula

\stoptext
---

It would be great if the comment could be turned into a processing instruction for ConTeXt such that the triangle's center of mass ends up on the math axis of the formula.

What's the best way to achieve this?

Many thanks,
Oliver
___________________________________________________________________________________
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:[~2010-07-24 18:35 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-20 12:00 Oliver Buerschaper
2010-07-22 20:22 ` Hans Hagen
2010-07-24 18:35   ` Oliver Buerschaper [this message]
2010-07-30  6:20     ` Oliver Buerschaper
2010-07-30  7:04       ` Taco Hoekwater
2010-08-01 10:16         ` Oliver Buerschaper
2010-08-01 10:42           ` Taco Hoekwater
2010-08-01 10:52           ` Oliver Buerschaper

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=14EF1920-A946-478D-A0F6-FE67F0E66933@mpq.mpg.de \
    --to=oliver.buerschaper@mpq.mpg.de \
    --cc=ntg-context@ntg.nl \
    --cc=pragma@wxs.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).