From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/85744 Path: news.gmane.org!not-for-mail From: Hans Hagen Newsgroups: gmane.comp.tex.context Subject: Re: internal mptopdf conversion fails on older mps file (using MkIV, beta 2013.12.26) Date: Thu, 02 Jan 2014 19:30:08 +0100 Message-ID: <52C5B030.1050706@wxs.nl> References: <87txdme06m.fsf@approx.mit.edu> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1388687410 10811 80.91.229.3 (2 Jan 2014 18:30:10 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 2 Jan 2014 18:30:10 +0000 (UTC) To: ntg-context@ntg.nl Original-X-From: ntg-context-bounces@ntg.nl Thu Jan 02 19:30:17 2014 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([5.39.185.229]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Vyn28-0001Io-Q7 for gctc-ntg-context-518@m.gmane.org; Thu, 02 Jan 2014 19:30:16 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 2AC32101DE; Thu, 2 Jan 2014 19:30:16 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 0yHcOJ6wvt3V; Thu, 2 Jan 2014 19:30:14 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 66F75101E2; Thu, 2 Jan 2014 19:30:14 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id E07AF101E2 for ; Thu, 2 Jan 2014 19:30:13 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id OVbJmRbAMMmx for ; Thu, 2 Jan 2014 19:30:09 +0100 (CET) Original-Received: from filter2-til.mf.surf.net (filter2-til.mf.surf.net [194.171.167.218]) by balder.ntg.nl (Postfix) with ESMTP id E1C62101DE for ; Thu, 2 Jan 2014 19:30:09 +0100 (CET) Original-Received: from smtp.ziggozakelijk.nl (D57D1DA2.static.ziggozakelijk.nl [213.125.29.162]) by filter2-til.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id s02IU8Pl000725 for ; Thu, 2 Jan 2014 19:30:09 +0100 X-Default-Received-SPF: pass (skip=loggedin (res=PASS)) x-ip-name=10.100.1.103; Original-Received: from [10.100.1.103] (unverified [10.100.1.103]) by pragma-net.nl (SurgeMail 6.3c2) with ESMTP id 3485-1713362 for ; Thu, 02 Jan 2014 19:30:07 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 In-Reply-To: <87txdme06m.fsf@approx.mit.edu> X-Authenticated-User: hagen@controller-9 X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=213.125.29.162; country=NL; region=15; city=Zwolle; latitude=52.5058; longitude=6.0858; http://maps.google.com/maps?q=52.5058,6.0858&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0TL96u8hR - d11dcce1495c - 20140102 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.218 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.14 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:85744 Archived-At: On 1/2/2014 6:57 PM, Sanjoy Mahajan wrote: > The MkIV internal mptopdf converter fails on the following minimal example. > Here is the tex: > > ------- cut test2.tex here ------------- > \enabletrackers[graphics.conversion,graphics.inclusion,fonts.mapfiles,fonts.loading,fonts.missing,fonts.mapping] > \starttext > \externalfigure[fig.1][frame=on] > \blank > \externalfigure[fig-1.pdf][frame=on] > \stoptext > ------- cut test2.tex here ------------- > > And here is the figure, which was produced with mpost 0.993 (and also > converted to fig-1.pdf using the 'mptopdf' command): > > -------- cut fig.1 here ------------ > %!PS-Adobe-3.0 EPSF-3.0 > %%BoundingBox: 0 0 10 10 > %%HiResBoundingBox: 0 0 9.96262 9.96262 > %%Creator: MetaPost 0.993 > %%CreationDate: 2009.10.21:1318 > %%Pages: 1 > %%BeginProlog > /bd{bind def}bind def > /hlw{0 dtransform exch truncate exch idtransform pop setlinewidth}bd > /vlw{0 exch dtransform truncate idtransform setlinewidth pop}bd > /l{lineto}bd/r{rlineto}bd/c{curveto}bd/m{moveto}bd/p{closepath}bd/n{newpath}bd > /C{setcmykcolor}bd/G{setgray}bd/R{setrgbcolor}bd/lj{setlinejoin}bd/ml{setmiterlimit}bd > /lc{setlinecap}bd/S{stroke}bd/F{fill}bd/q{gsave}bd/Q{grestore}bd/s{scale}bd/t{concat}bd > /sd{setdash}bd/rd{[] 0 setdash}bd/P{showpage}bd/B{q F Q}bd/W{clip}bd > %%EndProlog > %%Page: 1 1 > 0.7 G > n 0 0 m > 0 9.96262 l > 9.96262 4.98131 l > p F > P > %%EOF > -------- cut fig.1 here ------------ > > Running it through MkIV with the 2013.12.26 beta (or the stable context) > produces an empty frame for the inclusion of fig.1, but the correct > triangle for the inclusion of fig-1.pdf. The empty frame has the > correct size, so the parser is getting at least as far as the bounding > box. > > If I regenerate fig.1 using a recent metapost (1.803), the mps file is > simpler, and it is incorporated correctly by context. > > -------- cut fig.1 produced with recent metapost here ------------ > %!PS > %%BoundingBox: 0 0 10 10 > %%HiResBoundingBox: 0 0 9.96262 9.96262 > %%Creator: MetaPost 1.803 > %%CreationDate: 2014.01.02:1250 > %%Pages: 1 > %%BeginProlog > %%EndProlog > %%Page: 1 1 > 0.7 setgray > newpath 0 0 moveto > 0 9.96262 lineto > 9.96262 4.98131 lineto > closepath fill > showpage > %%EOF > -------- cut fig.1 produced with recent metapost here ------------ > > Here is the source file: > > --- cut fig.mp here ----- > def darkshaded = withgreyscale 0.70 enddef; > beginfig(1) > fill (origin--(0,1)--(1,1/2)--cycle) scaled 10pt darkshaded; > endfig; > --- cut fig.mp here ----- weird, there used to be a procset line ... anyhow, maybe this works ok at your end (meta-pdf.lua): local function parse(m_data) if find(m_data,"%%%%BeginResource: procset mpost") then -- report_mptopdf("using sparse scanner, case 1") lpegmatch(captures_new,m_data) elseif find(m_data,"%%%%BeginProlog%s*%S+(.-)%%%%EndProlog") then -- report_mptopdf("using sparse scanner, case 2") lpegmatch(captures_new,m_data) else -- report_mptopdf("using verbose ps scanner") lpegmatch(captures_old,m_data) end end -- ----------------------------------------------------------------- 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 ___________________________________________________________________________________