From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/6027 Path: main.gmane.org!not-for-mail From: Bruce Horrocks Newsgroups: gmane.comp.tex.context Subject: Re: Problem with bit maps with ConTeXt under MikTeX (works fine using LaTeX) Date: Wed, 7 Nov 2001 23:17:44 +0000 Sender: owner-ntg-context@let.uu.nl Message-ID: References: <20011107092947.0c79bdd4.taco@elvenkind.com> <20011107164759.07627efc.taco@elvenkind.com> <5.1.0.14.1.20011107180028.02f98670@server-1> NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain;charset=us-ascii;format=flowed X-Trace: main.gmane.org 1035396578 6694 80.91.224.250 (23 Oct 2002 18:09:38 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 23 Oct 2002 18:09:38 +0000 (UTC) Cc: ntg-context@ntg.nl Original-To: Hans Hagen , Taco Hoekwater In-Reply-To: <5.1.0.14.1.20011107180028.02f98670@server-1> Xref: main.gmane.org gmane.comp.tex.context:6027 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:6027 In message <5.1.0.14.1.20011107180028.02f98670@server-1>, on Wed, 7 Nov 2001 at 18:04:29, Hans Hagen wrote: >At 04:47 PM 11/7/2001 +0100, Taco Hoekwater wrote: >>2) you can try my (very ugly, more like a proof of concept) hack with >>bmp files and yap: >> >>%% start of file >>\unprotect >>\definefileinsertion{tr}{bmp}#1#2#3#4#5#6#7#8#9% >> {\scratchdimen\@@efbreedte >> \ScaledPointsToWholeBigPoints{\number\scratchdimen}\width >> \scratchdimen\@@efhoogte >> \ScaledPointsToWholeBigPoints{\number\scratchdimen}\height >> \vbox to 0pt{\kern -\@@efhoogte\hbox{% >> \ifnum\height = 0 >> \ifnum\width = 0 \special{em: graph #1}% >> \else \special{em: graph #1,\width bp}% >> \fi >> \else >> \special{em: graph #1,\width bp,\height bp}% >> \fi% >> }\vss}} >>\protect This works a treat with the .png file (as well as the bmp file) - it's exactly what I wanted. 10/10 to Taco. Thanks. (By the way, the scale parameter has no effect for me but it doesn't matter since specifying the width and height means that it appears just fine anyway. The dimensions will be the same for all of my bitmaps so there is no problem here - I can just hard code them into a custom macro.) >#7 and #8 are the dimensions in bp, so this is a better way: > >>\definefileinsertion{tr}{bmp}#1#2#3#4#5#6#7#8#9% >> {\ScaledPointsToWholeBigPoints{#7}\width >> \ScaledPointsToWholeBigPoints{#8}\height >> \vbox to 0pt{\kern -#8sp\hbox{% >> \ifnum\height = 0 >> \ifnum\width = 0 \special{em: graph #1}% >> \else \special{em: graph #1,#7sp}% >> \fi >> \else >> \special{em: graph #1,\width bp,\height bp}% >> \fi% >> }\vss}} > This didn't work. The bitmap was included but at a tiny size. I'd hazard a guess to say that no scaling is happening here. Sure enough, looking in the DVI file itself, I see that there are no dimensions after the filename, i.e. the following line must have been the one that inserted the special: >> \ifnum\width = 0 \special{em: graph #1}% But I have no idea why the system should think that the width is zero in order to execute this line. >do we need a special yap driver ? I think that a lot of MikTeX users would appreciate the ability to get identical output in DVI or PDF, the only difference being the --PDF flag. If a special Yap driver helps achieve this then yes. Many thanks to you both for such a rapid resolution of my problem. It is much appreciated. Regards, -- Bruce Horrocks Hampshire England bh@granby.demon.co.uk