ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <pragma@wxs.nl>
To: ntg-context@ntg.nl
Subject: Re: \externalfigure doesn't find mps file in subdirectory
Date: Tue, 06 Aug 2013 00:00:13 +0200	[thread overview]
Message-ID: <5200206D.4070708@wxs.nl> (raw)
In-Reply-To: <CAF=dkzwFUBKDqwc46tONVVM3T4yrEwDYcnVS47yuos0xW1xqHQ@mail.gmail.com>

On 8/5/2013 11:18 PM, Sietse Brouwer wrote:
> Hi Sanjoy,
>
> Sorry for the late reply; I had to dig around in grph-inc.lua, and I'm
> a bit rusty at source-diving.
>
> Yep, that’s a problem all right. A bug, even: when you put `simple.1`
> in the same directory as the `.tex` file, it is correctly identified
> as MetaPost; when you put the exact same file in a subdirectory like
> `./fig`, you get the problem you describe. No clue why.
>
> Until Hans fixes this, you can force ConTeXt to treat a file as
> MetaPost, JPEG, etc. by passing the `method=` paramater to
> `\externalfigure`. For MetaPost, write `method=mps`; I don’t know why
> the MetaPost code is not `mp`. (Perhaps that could be made a synonym?)
>
> Complete example below. I hope this workaround helps? Good luck with your work!

you can test with this (line 767 in grph-inc):

             askedformat = format -- new per 2013-08-05
         elseif trace_figures then
             report_inclusion("unknown format %a",askedformat)
         end


> Cheers,
> Sietse
>
>      % test.tex
>      \setupexternalfigures[directory={fig}]
>      \enabletrackers[graphics.locating]
>
>      \starttext
>          \externalfigure[simple.1][width=10cm, method=mps]
>      \stoptext
>
>      % fig/simple.1
>      %!PS
>      %%BoundingBox: 0 0 29 29
>      %%HiResBoundingBox: 0 0 28.34645 28.34645
>      %%Creator: MetaPost 1.803
>      %%CreationDate: 2013.08.04:0841
>      %%Pages: 1
>      %%BeginProlog
>      %%EndProlog
>      %%Page: 1 1
>       0 0 0 setrgbcolor
>      newpath 0 0 moveto
>      28.34645 0 lineto
>      28.34645 28.34645 lineto
>      0 28.34645 lineto
>       closepath fill
>      showpage
>      %%EOF
> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________
>


-- 

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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-05 22:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-04 13:04 Sanjoy Mahajan
2013-08-05 12:37 ` Sanjoy Mahajan
2013-08-05 21:18   ` Sietse Brouwer
2013-08-05 22:00     ` Hans Hagen [this message]
2013-08-06  9:04       ` Sietse Brouwer
2013-08-06 12:38       ` Sanjoy Mahajan
2013-08-06  7:50     ` Alan BRASLAU

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=5200206D.4070708@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).