ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Bruce Horrocks <bh@granby.demon.co.uk>
Cc: ntg-context@ntg.nl
Subject: Re: Problem with bit maps with ConTeXt under MikTeX (works fine using LaTeX)
Date: Wed, 7 Nov 2001 23:17:44 +0000	[thread overview]
Message-ID: <EQSkZTEYEc67EwFV@granby.demon.co.uk> (raw)
In-Reply-To: <5.1.0.14.1.20011107180028.02f98670@server-1>

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


  reply	other threads:[~2001-11-07 23:17 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-11-06 23:50 Bruce Horrocks
2001-11-07  8:29 ` Taco Hoekwater
2001-11-07 11:37   ` Bruce Horrocks
2001-11-07 15:47     ` Taco Hoekwater
2001-11-07 17:04       ` Hans Hagen
2001-11-07 23:17         ` Bruce Horrocks [this message]
2001-11-08  9:27           ` Hans Hagen
2001-11-08 14:59             ` Bruce Horrocks
2001-11-08 16:08               ` Taco Hoekwater
2001-11-08  8:18         ` Taco Hoekwater
2001-11-07 17:17   ` 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=EQSkZTEYEc67EwFV@granby.demon.co.uk \
    --to=bh@granby.demon.co.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).