ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <pragma@wxs.nl>
Subject: Re: \sometxt bodyfontsize in staticMPfigure	(2006.09.27 beta)
Date: Fri, 29 Sep 2006 09:12:39 +0200	[thread overview]
Message-ID: <451CC767.60808@wxs.nl> (raw)
In-Reply-To: <E1GT63V-0004ep-OC@approximate.corpus.cam.ac.uk>

Sanjoy Mahajan wrote:
> Hans Hagen wrote:
>
>   this is runtime tex into passed to the graphic ... imagine that we
>   flush this to the mp file ... it can contain info that is not known in
>   that session (like overlay info) which willbreak the mp run
>
>   the issue here is that a static graphic is processed in another,
>   independent run, that's the whole idea behind static graphics (quick
>   hack for independent graphics)
>
> That makes sense.  So should I use reusableMPgraphic instead of
> staticMPfigure?  My figures started as standalone mpost figures that I
> incorporate chapter by chapter into the ConTeXt source file.  I was
> using staticMPfigure because I'd noticed the code in the ConTeXt sources
> and it's so fast.
>
>   we can spend a lot of time to make it more advanced but within a year
>   from now we will have mp as a library in tex which will reduce runtime
>   to nearly zero (at least that 's what experiments show) so ....
>
> Great!  Although earlier you had said, when I wondered whether
> pdftex+lua will make it easier to meld tex and metapost:
>
>   not really, for that we need mp as a library (we did experiments with
>   simulating that but it's kind of tricky)
>
>   concerning lua ... i do have a mkiv file on my machine that uses lua
>   to parse the mp output (precursor to mp natively spitting out such
>   code); currently its a bit slower (two step conversion ps -> lua ->
>   tex) but when using many pen shapes its faster because then we don't
>   need the tex based concat code; also, less (and cleaner) code is
>   needed for parsing
>
> Oh I understand what you were saying: that pdftex+lua is not sufficient
> for clean metapost intergration, one also needs metapost as a library (I
> guess in lua?).  Anyway, don't bother to answer that.  Develop in peace,
> and I'm looking forward to the result (and will be happy to test when
> that's useful).
>
>   what we can do [for staticMPfigure] is pass info from the mpenvironment"
>
> It works well, thanks for another instant improvement.  The 2006.09.28
> beta passes the following test case (I will commit it to the contexttest
> repository).  It gives a 12pt "outside sometxt" and a 20pt "in sometxt":
>
> ============= with-static.tex ================================
> \startMPenvironment
> \setupbodyfont[20pt]
> \stopMPenvironment
>
> \starttext
>
> \startstaticMPfigure{fig}
>   label(\sometxt{in sometxt},origin);
> \stopstaticMPfigure
>
> outside sometxt\quad
> \usestaticMPfigure[fig]
> \stoptext
> =============================================
>
> Another difference (not important to fix, just a strange corner case)
> between staticMPfigure and reusableMPgraphic is the depth of the
> resulting box.  With staticMPfigure, the 'in sometxt' is raised to have
> its baseline about at the midline of the 'outside sometxt':
>
> ============= with-static12.tex ================================
> \starttext
> \startstaticMPfigure{fig}
>   label(\sometxt{in sometxt},origin);
> \stopstaticMPfigure
> outside sometxt\quad
> \usestaticMPfigure[fig]
> \stoptext
> =============================================
>
> In the reusableMPgraphic method, the outside and inside texts have their
> baselines aligned:
>
> ============= with-reusable12.tex ================================
> \starttext
> \startreusableMPgraphic{fig}
>   label(\sometxt{in sometxt},origin);
> \stopreusableMPgraphic
> outside sometxt\quad
> \reuseMPgraphic{fig}
> \stoptext
> =============================================
>
> BUT: I don't need this fixed!  It's a corner case I happened to notice,
> and I'm noting it in case it indicates a bug in the box manufacturing.
> 'See loose thread, any loose thread, pull thread' is how I debug.
>   
consider a static graphic to be(have) like an external figure, it's 
basically mp code processes as startMPpage .. stopMPpage

Hans

-- 

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                             | www.pragma-pod.nl
-----------------------------------------------------------------

  reply	other threads:[~2006-09-29  7:12 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-28  4:24 Sanjoy Mahajan
2006-09-28  7:25 ` Hans Hagen
2006-09-29  0:16   ` Sanjoy Mahajan
2006-09-29  7:12     ` Hans Hagen [this message]
2006-10-04 23:14   ` Aditya Mahajan
2006-10-05  4:38     ` Sanjoy Mahajan
2006-10-05  7:08       ` Taco Hoekwater
2006-10-05  8:01     ` Hans Hagen
2006-10-05 13:22       ` Aditya Mahajan

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=451CC767.60808@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).