2

My problem is: I drew a picture in Latexdraw software and when I run the latex code of my picture in my editor, lots of errors made. I use TexLive 2017 and my editor is bidiTexmaker. My code is:

 \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}

The picture of errors are:

enter image description here

I would very much appreciate any assistance you can offer me in this question.

Edition: I want to ask you to guide to improve the code until that the picture inside an ellipse as follows. Thanks

enter image description here

  • 2
    use xelatex or latex-dvips-ps2pdf – Artificial Stupidity Dec 3 '18 at 19:58
  • @ArtificialStupidity Wonderful. Really Really Thanks. It works. Please write your comment as an answer. Thanks – user0410 Dec 3 '18 at 20:01
  • 1
    Well, you set linecolor=... It's used in your code. – Bernard Dec 3 '18 at 20:56
  • These extravagant coordinates come from Latex Draw? – Bernard Dec 3 '18 at 21:28
  • @Bernard Yes. It is extracted from Latex Draw. – user0410 Dec 3 '18 at 21:32
1

Use xelatex or latex-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}

enter image description here

  • I edited the question. Please see it . Thanks – user0410 Dec 4 '18 at 8:07
  • Its perfect. Never I use the Latexdraw software. In fact, I want to write pspicture codes as you done. Thanks again. – user0410 Dec 4 '18 at 10:31
  • 1
    @user0410: linecolor=green. – Artificial Stupidity Dec 4 '18 at 10:53
  • 1
    I suggest to change your username, since you are not "Artificial Stupidity" . In fact, you are "Factual Knowledge". Please excuse me if my suggestion bother you. – user0410 Dec 4 '18 at 11:04
  • 1
    @user0410: Changing birth certificate takes time and money. :-) – Artificial Stupidity Dec 4 '18 at 11:05
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}

enter image description here

  • I would appreciate for your nice code. – user0410 Dec 4 '18 at 12:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.