Ignoring pdftex primitives

Robert Howlett rhowlett at mail.usyd.edu.au
Fri Dec 11 23:42:30 CET 1998



Hans Hagen wrote:
> 
> Robert Howlett wrote:
> 
> > Incidentally, with the syntax as it is, I notice that I can't
> > include an image file with a name like depthcharge.png.
> 
> This is a general tex problem, take rules.
> 
> > I guess pdftex syntax is by now too settled for it to be changed, is it?
> > If not, is there any support out there for changing the syntax?
> 
> The current syntax suits the \input one, no beauty either but we've
> learned to live with that. In most cases \pdfimage will be wrapped up
> anyway.
> 
> Maybe the next hack suits your purpose and it saves Thanh some
> programming -)
> 
> \let\normalpdfimage\pdfimage
> 
> \def\pdfimage%
>   {\ifcase\pdfoutput
>      \expandafter\nopdfimage
>    \else
>      \expandafter\dopdfimage
>    \fi}
> 
> \def\dopdfimage#1#{\dodopdfimage{#1}}
> \def\nopdfimage#1#{\donopdfimage{#1}}
> 
> \def\dodopdfimage#1#2%
>   {\normalpdfimage#1#2\relax}
> 
> \def\donopdfimage#1#2%
>   {\ifhmode\vrule\else\hrule\fi height 1cm width 1cm depth 0cm #1\relax}
> 
> \pdfimage width 2cm {./logo-con.png}
> 
> It also shows why your pdfimage substitute would be no real substitute:
> \pdfimage returns a box with the natural dimensions of the graphic.
> 
> Hans
> 

This approach implicitly concedes that

\pdfimage width 2cm {./logo-con.png}

is a more convenient syntax than

\pdfimage width 2cm ./logo-con.png


I was imagining a situation where a person who doesn't have
access to pdftex and has never heard of it comes to me and
says "I've got this tex file from Prof. Bloggs, but when I
run it I get the message 
undefined control sequence \pdfimage.
What can I do?"
I would answer 
"Take this macro file nopdf.tex and add
\input nopdf
to the start of Bloggs' file. It won't be perfect but
not too bad"
and with any luck the person will be happy or at least won't
come back.

I have actually half-written such macros, where "half" means
that I've done \pdfimage but haven't tried \pdfdest yet.
But it was really just for fun, I don't expect to have
any serious need for it.

Bob




More information about the pdftex mailing list