# How to insert pspicture in article

I unable to run the following code. How to resolve it. Now i am using Miktex 2.9. and Winedt. Kindly help me to resolve it.

\documentclass[a4paper,12pt]{article}
\usepackage{layout}
\usepackage{lipsum}
\usepackage{amsmath,latexsym,amssymb,amsthm,enumerate}
\usepackage{lscape}
\usepackage{enumerate}
\usepackage{epsfig}
\begin{document} \begin{center}
\scalebox{1} % Change this value to rescale the drawing.
{
\begin{pspicture}(0,-1.08)(3.76,1.08)
\psdots[dotsize=0.12](0.06,0.2)
\psdots[dotsize=0.12](0.86,0.2)
\psdots[dotsize=0.12](1.66,0.2)
\psdots[dotsize=0.12](2.48,0.22)
\psdots[dotsize=0.12](3.28,0.2)
\psdots[dotsize=0.12](0.06,-1.0)
\psdots[dotsize=0.12](0.88,-1.0)
\psdots[dotsize=0.12](1.68,-1.0)
\psdots[dotsize=0.12](2.48,-1.0)
\psdots[dotsize=0.12](3.26,-1.0)
\psdots[dotsize=0.12](0.48,1.0)
\psdots[dotsize=0.12](1.28,1.0)
\psdots[dotsize=0.12](2.08,1.0)
\psdots[dotsize=0.12](2.88,1.0)
\psdots[dotsize=0.12](3.68,1.0)
\psline[linewidth=0.02cm](0.04,0.22)(0.04,-0.96)
\psline[linewidth=0.02cm](0.06,-0.98)(1.7,-0.98)
\psline[linewidth=0.02cm](0.86,0.22)(0.86,-1.0)
\psline[linewidth=0.02cm](1.66,0.18)(1.66,-0.94)
\psline[linewidth=0.02cm](0.06,0.24)(0.46,1.0)
\psline[linewidth=0.02cm](0.84,0.26)(0.46,1.06)
\psline[linewidth=0.02cm](0.88,0.22)(1.28,1.02)
\psline[linewidth=0.02cm](1.66,0.22)(1.26,1.06)
\psline[linewidth=0.02cm](1.66,0.24)(2.06,1.04)
\psline[linewidth=0.02cm](2.46,0.24)(2.46,-0.98)
\psline[linewidth=0.02cm](2.46,-0.98)(3.22,-0.98)
\psline[linewidth=0.02cm](3.28,0.24)(3.28,-0.98)
\psline[linewidth=0.02cm](2.48,0.24)(2.88,1.02)
\psline[linewidth=0.02cm](2.86,1.02)(3.28,0.18)
\psline[linewidth=0.02cm](3.68,1.02)(3.28,0.22)
\psline[linewidth=0.02cm](0.46,1.02)(2.06,1.02)
\psline[linewidth=0.02cm](2.86,1.02)(3.68,1.02)
\psline[linewidth=0.02cm,linestyle=dashed,dash=0.16cm 0.16cm](2.08,1.02)(2.84,1.02)
\psline[linewidth=0.02cm,linestyle=dashed,dash=0.16cm 0.16cm](2.08,1.0)(2.44,0.24)
\psline[linewidth=0.02cm,linestyle=dashed,dash=0.16cm 0.16cm](1.7,-1.0)(2.44,-1.0)
\end{pspicture}
}

Figure 1.
\end{center}
\end{document}

• What is the error? No problem here using TeXlive 2014 on Linux. – Sigur Feb 27 '15 at 17:09
• I used many pictures like this so I unable identify the error. In my out put the text and equations are appeared but the images are not – user51868 Feb 27 '15 at 17:11
• Are you running latex and getting the dvi file? You can not compile directly with pdflatex, you need to convert from DVI to PS and then to PDF. – Sigur Feb 27 '15 at 17:12
• How to convert this I dont know how – user51868 Feb 27 '15 at 17:14
• also unrelated but don't load the epsfig package. It was produced in 1993 to emulate a package that was old then. – David Carlisle Feb 27 '15 at 17:16

You can compile your code with pdflatex, provided you enable the --enable-write18 switch via Execution Modes in the Optionsmenu:

You also have to add pdf option to the document class. I took the opportunity to simplify your code , using the multido package. I took the liberty to slightly change the values of some coordinates which looked weird, so as to be able to pragram the points, rather than having to typeset them, one after another. Here is the shorter code:

\documentclass[a4paper,pdf, 12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{caption}

\begin{document}

\begin{figure}
\centering
%\scalebox{1}{ % Change this value to rescale the drawing.
\begin{pspicture}(0,-1.08)(3.76,1.08)
\psset{dotsize=0.12,linewidth=0.02cm}
\multido{\n=0.06+0.80,\N = 0.48 + 0.80,\i =1 +1}{5}
{\dotnodes(\n, 0.2){A\i}(\n, -1.0){B\i}
\dotnodes(\N, 1.0){C\i}
\psline(B\i)(A\i)(C\i)
}
\psline(A2)(C1)(C3)\psline(A5)(C4)(C5)\psline(A3)(C2)
\psline(B1)(B3)\psline(B4)(B5)
\psset{linestyle=dashed,dash=0.16cm 0.16cm}
\psline(A4)(C3)(C4)
\psline(B3)(B4)
\end{pspicture}
%}
\caption{}
\end{figure}
\end{document}