ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Sanjoy Mahajan <sanjoy@mrao.cam.ac.uk>
Subject: Re: MPenvironment \def gives "Parameters must be numbered consecutively"
Date: Sat, 30 Sep 2006 16:46:02 +0100	[thread overview]
Message-ID: <E1GTh2Q-0007Vc-00@skye.ra.phy.cam.ac.uk> (raw)
In-Reply-To: Your message of "Fri, 29 Sep 2006 18:29:05 +0200." <6faad9f00609290929m4f03532asf0b1abb4ce26500f@mail.gmail.com>

> never try to do tricky stuff like definitions inside MPenvironement,
> because it is parsed and changed slightly.

I'm learning that lesson too.  Another one: "don't use btex..etex
instead use \sometxt".  So I now try to use the MPenvironment only for
font and size switching (e.g. if I want the figures to be in a smaller
font).  I wikified a small example of converting to \sometxt:
<http://wiki.contextgarden.net/Mpgraphic#startMPenvironment>.  It's
probably not in the right place on the wiki though.

> \def\a{abc}
> 
> \starttext
> \startMPcode
> label(\sometxt{\a},origin);
> \stopMPcode
> \stoptext
> 
> Would that kind of approach satisfy your needs?

It would.  I've used this sed script to help me convert my standalone
metapost files:

  sed 's/btex (.*) etex/\\sometxt{\1}/' < standalone.mp

But for the next chapter's figures, I'll write a python script that
will do the other transformations: e.g. turn each beginfig into
\startstaticMPfigure -- or is it \startstaticMPgraphic?  I always have
to check, hence I'll put it in a script and have *it* remember.

I know that metafun was made for integrating backgrounds and the like,
not for standalone figures, so it may seem strange to convert all of
one's standalone figures into metafun figures and place them in the
.tex source file.  But I like having the source for the standalone
figures in the same file near their use: it's figure--text integration
(one theme of Tufte's books), done in the source file.

-Sanjoy

`Never underestimate the evil of which men of power are capable.'
         --Bertrand Russell, _War Crimes in Vietnam_, chapter 1.

      reply	other threads:[~2006-09-30 15:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-29  5:07 Sanjoy Mahajan
2006-09-29  7:29 ` Hans Hagen
2006-09-30 15:50   ` Sanjoy Mahajan
2006-10-05  7:10   ` Aditya Mahajan
2006-09-29 16:29 ` Mojca Miklavec
2006-09-30 15:46   ` Sanjoy Mahajan [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=E1GTh2Q-0007Vc-00@skye.ra.phy.cam.ac.uk \
    --to=sanjoy@mrao.cam.ac.uk \
    --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).