[pstricks] includegraphics page of pdf, pst-pdf, auto-pst-pdf

Alan Ristow ristow at ece.gatech.edu
Sat Mar 22 01:56:21 CET 2008

Herbert Voss wrote:
> Alan Ristow schrieb:
>> Herbert Voss wrote:
>>> exelnet at exelnet.de schrieb:
>>>> Well, it didnt change everything afterall. I am still having trouble with
>>>> images that get included in a file thats itself include by the tex \input
>>>> command.
>>>> Im using the following recommand to solve this problem in my case. Since im
>>>> not using any ps-only fileformats.
>>>> \let\includegfx\includegraphics
>>>> \renewcommand\includegraphics[2][]{\ifpdf \includegfx[#1]{#2} \fi}
>>> the \includegraphics is under the control of pst-pdf. You do nit
>>> need the above commands. Try it only with
>>> \includegraphics{file}
>> Herbert,
>> Part of the issue he presented yesterday was that he wanted to use 
>> \includegraphics to include a page from a multi-page PDF, e.g.,
>> \includegraphics[page=1]{file}
>> This works fine with pdflatex but fails with regular latex since "file" 
>> is a PDF (though the error message is generated by keyval and complains 
>> about "page" being an undefined key).
>> Is pst-pdf supposed to work around this situation automatically? AFAICT 
>> it isn't supposed to, so I advised Jan to wrap his \includegraphics 
>> statement in \ifpdf ... \fi.
> pst-pdf redefines the \includegraphics macro itself
> and ignores in the latex run the pdf images but not
> the eps one. There is no need for \ifpdf ...\else ...\fi

Hmm. Evidently I confused myself somewhere along the way because I swear 
I tried that several times yesterday and earlier today and it didn't 
work. Now, of course, it works exactly as you say it should. I haven't 
updated anything in the meantime, so I guess it's just my own stressed 
out brain.

I think it's time to step away from the computer and have a beer....


More information about the PSTricks mailing list