I am a pstricks newbie and sticking with including a picture in a pstricks environement. Usually I create my documents with pdflatex using png files.
Now I wanna like to use pstricks to draw some arrows, lines, ... to my pictures. I read but haven't been able to solve the problem.
Using the tutorial
http://tug.org/PSTricks/main.cgi?file=p ... autopstpdf
enabled to inculde png files and create pstricks pictures (with command pdflatex --shell-escape file.tex) but I fail to combine both.
Would be great if you can give me a hint what has been going wrong! Have no idea!
Thanks!
Cheers, Kacz
Code: Select all
\documentclass[a4paper]{article}
\usepackage{ifpdf}
\ifpdf%
\usepackage{pdftricks}
\begin{psinputs}
\usepackage{pstricks}
\usepackage{auto-pst-pdf}
\usepackage{pst-all}
\newsavebox{\Imagebox}
\end{psinputs}
\else
\usepackage{pstricks}
\usepackage{auto-pst-pdf}
\usepackage{pst-all}
\newsavebox{\Imagebox}
\newenvironment{pdfpic}{}{}
\fi
\begin{document}
\begin{figure}[htb]
\includegraphics[width=0.5\textwidth]{pic.png}
\end{figure}
\begin{figure}[htb]
\begin{pdfpic}
\savebox{\Imagebox}{\includegraphics[width=0.7\textwidth]{pic.png}}
\begin{pspicture}(\wd\Imagebox,\ht\Imagebox)
\psset{unit=0.04\wd\Imagebox}
\psgrid[subgriddiv=0,griddots=10, gridlabels=7pt](0,0)(\wd\Imagebox,\ht\Imagebox)
\rput[lb](0,0){\usebox{\Imagebox}}
\rput[lb](3.5,13.3){\textbf{\Large KCl}}
\end{pspicture}
\end{pdfpic}
\end{figure}
\end{document}