Pspicture环境运行问题

Pspicture环境运行问题

我的问题是:我在 Latexdraw 软件中画了一幅图,当我在编辑器中运行图片的 latex 代码时,出现了很多错误。我使用 TexLive 2017,我的编辑器是 bidiTexmaker。我的代码是:

 \documentclass[12pt]{article}   

 \usepackage{amsmath,verbatim,epsfig,graphicx,amssymb} 
 \usepackage[usenames,dvipsnames]{pstricks}
 \usepackage{helvet}
 \usepackage{pst-grad} 
 \usepackage{pst-plot}

 \begin{document}

 \begin{figure}[h]
 \begin{pspicture}(0,-1.212)(3.07325,1.212)
 \definecolor{color509}{rgb}{0.2,0.2,0.2}
 \psline[linewidth=0.024cm,arrowsize=0.05291667cm 2.0,arrowlength=1.4,arrowinset=0.4]{->}(0.06625,0.6)(0.88625,0.6)
 \usefont{T1}{ptm}{b}{it}
 \usefont{T1}{ptm}{b}{it}
 \usefont{T1}{ptm}{b}{it}
 \psframe[linewidth=0.024,dimen=outer](2.04625,1.02)(0.88625,0.2)
 \psline[linewidth=0.024cm](2.86625,1.2)(2.86625,0.0)
 \psline[linewidth=0.024cm](0.06625,1.2)(0.06625,0.0)
 \psdots[dotsize=0.374,dotstyle=oplus](2.86625,0.6)
 \psline[linewidth=0.024cm,arrowsize=0.05291667cm 2.0,arrowlength=1.4,arrowinset=0.4]{->}(2.06625,0.6)(2.66625,0.6)
 \psline[linewidth=0.024cm,linecolor=color509](0.06625,0.0)(2.86625,-1.2)
 \psline[linewidth=0.024cm,linecolor=color509](2.86625,0.0)(0.06625,-1.2)
 \end{pspicture}
 \end{figure}

 \end{document}

错误图片如下:

在此处输入图片描述

我将非常感激您在这个问题上给予我的帮助。

版:我想请你指导我改进代码,直到椭圆里面的图片如下。谢谢

在此处输入图片描述

答案1

使用xelatexlatex-dvips-ps2pdf

\documentclass[pstricks,border=1pt,12pt]{standalone}   
\usepackage{pst-node}

\begin{document}
\begin{pspicture}(-3.5,-3)(3.5,3)
    \pnodes(-2.7,3){A}(-2.7,1){B}(-2.7,0){C}(2.7,-3){D}
    \pnodes(2.7,3){A'}(2.7,1){B'}(2.7,0){C'}(-2.7,-3){D'}
    \pnodes(-1,1){X}(1,1){Y}
    \rput(B'){\circlenode{P}{$+$}}
    \psline(A)(C)(D)
    \ncline{A'}{P}
    \ncline{P}{C'}
    \ncline{C'}{D'}
    \psframe(-1,0)(1,2)
    \ncline{->}{B}{X}
    \ncline{->}{Y}{P}
    \psellipse[linecolor=green](0,.5)(3.5,2.25)
\end{pspicture}
\end{document}

在此处输入图片描述

答案2

\documentclass[pstricks,border=1pt,12pt]{standalone}   
\usepackage{pst-node}

\begin{document}
\begin{pspicture}(-3.5,-3)(3.5,3)
    \psline(-2.7,3)(-2.7,1)(-2.7,0)(2.7,-3)
    \cnodeput(2.7,1){P}{$+$}
    \pnodes(-2.7,1){A}(2.7,3){B0}(2.7,0){B1}
    \ncline{B0}{P}\ncline{P}{B1}
    \psline(B1)(-2.7,-3)
    \fnode[framesize=1.5](0,1){F}{}
    \ncline{->}{A}{F}\ncline{->}{F}{P}
    \psellipse[linecolor=green,fillcolor=green,
               opacity=0.15,fillstyle=solid](0,.5)(3.5,2.25)
\end{pspicture}
\end{document}

在此处输入图片描述

相关内容