From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/33 Path: main.gmane.org!not-for-mail From: Hans Hagen Newsgroups: gmane.comp.tex.context Subject: Re: No straightforward .png support in ConTeXt? Date: Sun, 21 Jun 1998 19:44:02 +0200 Sender: owner-ntg-context@let.uu.nl Message-ID: <358D4662.D5D477D5@wxs.nl> NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1035390890 20418 80.91.224.250 (23 Oct 2002 16:34:50 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 23 Oct 2002 16:34:50 +0000 (UTC) Original-To: Berend de Boer , NTG-CONTEXT Xref: main.gmane.org gmane.comp.tex.context:33 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:33 Berend de Boer wrote: > The main problem was figuring out that I had to use texutil to get the > sizes correct (this was the first time I tried to use figures within > context). TeX can only process non binary data. Therefore one has to use a separate tool to determins figure dimensions. Because TeX can do text input, eps illustrations can be processed (as well as pdf) although last week at the pdftex list we found out that on Windows this can give problems if we strickly follow the original tex implementation. Therefore, ConTeXt can either read the eps file directly or texutil.tuf to determine the size. > The error message context gives in this case is really confusing: "figuur > . niet te vinden". > > Looking through the source this really means that no size for this figure > could be find. You can trick context by saying e.g. \externafigure[somename][type=xxx,preset=no,width=3cm,height=4cm] But keep in mind that TeX has to know the dimension to reserve space. > With latex including a .png figure is really easy. Why is context not able I'm not sure of the state of the implementation you use, but I guess png is possible: \externalfigure[name][type=png,...] Now the reason why LaTeX can determines the size, is simply that is uses the fact that when one says: \pdfimage name width ... height ... the figure is scaled ok. (thanks to pdf) But how about movies and pdf? Only the latest pdftex release supports pdf en jpg and tif. > to auto-determine the size of .png? I.e. I need a \dogetfiguresizepng. Is Keep in mind that tex (latex/context) techically depend on some programe to determine these! pdfTeX does scale by using width/height, but other (dvi) drivers differ in this respect (e.g. scale). When you include figures in 1:1, in pdftex you get back a box of the right size, somthing you cannot do in dvi. Therefore the mechanisms I use are general, non-pdftex specific! > this routine available somewhere already? If you can be patient for a few days, I'll upload the latest release. Due to very recent developments in pdftex I extended the figure mechanism. Given a suitable texutil.tuf file (you can generate one, but also provide one yourself: if you add an entry: \presetfigure[name][type=png,width=...,height=...] ConTeXt is pretty well able to include whatever illustration you want, even ones that are not at you machine that moment. Back to the extensions: - fully automatic type recognitions (so no problems when switching from dvi to pdf, given that alternatives are at hand) - direct scanning of figure - when not possible using or even calling directly for texutil (now texutil can also read tif, png, jpg and pdf) - automatic recognition of metapost (mps/eps) files and automatic handling of fonts, clor conversion, direct pdf conversion etc) - reusing inserts when possible (was already done with mps figures) For those unaware of some features already present: - there is automatic scaling to the max: (b)(h)factor=max/fit/dimen - with width/height limitations checked - as well as isometric scaling - and width/height, scale or document design size scaling, etc etc (Well, we've been including eps and tif ever since we started with context, with scaling tricks provided, so things are possible.) Hans Again, keep in mind that, althought often possible, there are situations where tex cannot determine boundingboxes, while texutil can. ----------------------------------------------------------------- Hans Hagen | PRAGMA Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | mail: pragma@wxs.nl -----------------------------------------------------------------