Ignoring pdftex primitives

David Carlisle davidc at nag.co.uk
Thu Dec 10 11:08:44 CET 1998


> \pdfimage height 3 cm imagefile.png

I can't say I like the syntax either, but it is probably the `TeX way'.
It is just that Knuth's decision to give TeX primitives a syntax that
is totally alien to the TeX macro syntax was simply wrong:-)

In practice I am not sure it would help much in this case. Even if the
syntax were slightly more helpful you would probably never be able to
totally fake a non expandable primitive with a macro. In this case
probably you should just use some macro and document that it be used for
both tex and pdftex. For latex this would just be

\includegraphics{imagefile}

(being a macro it can do other checks, like deciding which extension to
use depending on what tex version and drivers are specified)
Context no doubt has similar image inclusion macros which again give a
consistent interface. For plain tex you could either provide just a
basic wrapper around \special and \pdfimage, or you could use the
latex interface (which does work with plain tex).


> Incidentally, with the syntax as it is, I notice that I can't
> include an image file with a name like depthcharge.png.

If you know there is no depth you can always use depth 0pt, can't you?
so that \pdfimage has seen a depth and doesn't look for another. (not
tried)

David



More information about the pdftex mailing list