ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Aditya Mahajan <adityam@umich.edu>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: internal mptopdf converter skips some glyphs in labels
Date: Fri, 9 Aug 2013 20:09:10 -0400 (EDT)	[thread overview]
Message-ID: <alpine.LNX.2.02.1308091957210.491@ybpnyubfg.ybpnyqbznva> (raw)
In-Reply-To: <87y58awhii.fsf@approx.mit.edu>

On Fri, 9 Aug 2013, Sanjoy Mahajan wrote:

>> Try adding
>>      prologues := 2;
>> or
>>      prologues := 3;
>> in your mp file.
>>
>
> Good thought, which I tried, though neither setting resolved the
> problem.
>
>> Any particular reason that you are compiling metapost files using mp and
>> then including them in ConTeXt rather than directly using any one of the
>> inbuilt ConTeXt environments for handling mp (\startMPcode, \useMPgraphic,
>> \processMPbuffer, etc.)
>
> Mostly conservatism.  I cannot quite figure out the canonical
> replacement for btex ... etex (textext, sometext?), and then I get
> confused by the many possible environments.
>
> What do you recommend as the best btex...etex replacement

Nothing. Just leave them as it is and MkIV is smart enough to process 
them [^1]. If you used the TEX macros (to build strings with metapost 
variables), use textext("...") instead of TEX("....").

> and the best
> environment for replacing a standalong metapost figure (that I would
> otherwise just include with \externalfigure)?

I use the following:

\startcomponent figures

\startbuffer[system-1]
  ... mp code ..
\stopbuffer

% Other figures in separate buffer

\stopcomponent

and then use

\processMPbuffer[list of buffers]

to typeset them [^2]. With this approach you loose some of the features of 
\externalfigure (scaling, backgrounds, etc.) For scaling, you can use

   \scale[....]{\processMPbuffer[...]}


and if you really need a background, you can use \framed.

Another option is to use \startMPcode .... \stopMPcode environment, but I 
usually like my figures to be separate files.

[^1]: To process btex ... etex, the content of each metapost 
environment is processed twice. This can sometimes lead to unexpected 
results. Basically you have to careful with := vs =, otherwise you'll get 
inconsistent equations.

[^2]: You also need to keep in mind that all metapost graphics are 
processed in a single run (think of a single mp file with multiple 
beginfigs). So you have to be careful with initializing and resetting 
variables (\startMPinclusions, \startMPinitializations, 
\startMPdefinitions, see wiki for difference) or adding bgroup ... egroup 
at appropriate location to limit scope.

Another way to avoid interference is to use separate MPinstances, but in 
my opinion that feature is more useful to module writers than normal 
users.


Aditya


___________________________________________________________________________________
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-08-10  0:09 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-09 20:26 Sanjoy Mahajan
2013-08-09 20:41 ` Aditya Mahajan
2013-08-09 23:50   ` Sanjoy Mahajan
2013-08-10  0:09     ` Aditya Mahajan [this message]
2013-08-09 21:50 ` Hans Hagen
2013-08-09 23:45   ` Sanjoy Mahajan
2014-06-05  2:17   ` Sanjoy Mahajan
2014-06-05  8:04     ` Hans Hagen
2014-06-05 19:37       ` Sanjoy Mahajan
2014-06-05 20:25         ` Hans Hagen
2014-06-05 21:27           ` Sanjoy Mahajan
2014-06-05 23:19             ` Hans Hagen

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=alpine.LNX.2.02.1308091957210.491@ybpnyubfg.ybpnyqbznva \
    --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).