2

All things I have:

  1. Install GhostScript 32 bit (My system is Window 7-32bit) .
  2. Write a batch file by Text Document and followed by .bat .

Its content ( of AS's answer ):

echo off

rem %1 TeX input filename without extension

if exist "%~1.pdf" del "%~1.pdf"

if exist "%~1.tex" latex -shell-escape "%~1.tex"

if exist "%~1.dvi" dvips -t unknown "%~1.dvi"

if exist "%~1.ps" gswin32c -dCompatibilityLevel=1.5 -dAutoRotatePages=/None -sDEVICE=pdfwrite -o "%~1.pdf" "%~1.ps"

for %%x in (aux dvi log out ps toc nav snm) do (if exist "%~1.%%x" del "%~1.%%x")
  1. Register the batch file to the PATH environment variable ( Address: Control Panel\All Control Panel Items\System , click Advanced system settings, click Environment Variables, look at System variables, choose Path, click edit, add " ;C:\texlive\PSTricksbatch;C:\Program Files\gs\gs9.26\bin ".

See my images

enter image description here enter image description here

  1. Replace any unused (for example, DVI Viewer) TeXStudio command with " pstricksbuilder2.bat % "...

Its image:

enter image description here enter image description here

  1. Change Build

Build & View: txs:///dvi-chain | txs:///view

Default Compiler: txs:///latex

Default Viewer: txs:///view-pdf

PDF Viewer: txs:///view-pdf-internal --embedded

Image as the following:

enter image description here

Done!

Examples include questions:

Please see the following examples:

1.

\documentclass[12pt,pstricks]{standalone}
\usepackage{pst-venn}
\begin{document}
\begin{pspicture}(-3,-3)(3,3)
\psframe(-2.8,-2.8)(2.8,2.8)
\psVenn[bgcircle=false](-1,.5)(0,-1)(1,.5){1.5}{4}
\rput(-1,1.2){A}\rput(1,1.2){B}\rput(0,-2.1){C}
\psline(0,1.3)(.4,2.3)  \uput[20](.3,2.4){$?$}
\end{pspicture}
\end{document}

It produces a good picture :

enter image description here

2.

\documentclass[12pt,pstricks]{standalone}
\usepackage{newcent,pst-eucl} 
\begin{document}
\begin{pspicture}
\psset{PointSymbol=none}
\pstGeonode[PointName=none](2,4){A}(0,0){B}(6,0){C}
\pstCircleABC[PosAngle=180]{A}{B}{C}{O}
\pstGeonode[PosAngle=60](10,2){M}
\pstMiddleAB[PointName=none]{O}{M}{M'}
\pstInterCC[DiameterB=\pstDistAB{O}{M},PosAngleA=45,
 PosAngleB=-45]{O}{A}{M'}{}{D}{E}
{\psset{nodesepB=-1} \ncLine{M}{D} \ncLine{o-}{M}{E}}
\psline(D)(O)(E) \ncLine{o-o}{D}{E} \ncLine{o-}{O}{M}
\pstInterLL[PosAngle=50,PointNameSep=.55]{O}{M}{D}{E}{H}
\pstRightAngle[RightAngleSize=.2]{D}{H}{M}
\end{pspicture}
\end{document}

Its image is BAD :

enter image description here

3.

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

\begin{document}
\psset{unit=0.75}
\begin{pspicture}[showgrid](-5,-5)(10,10)
\pstTriangle[fillstyle=solid,fillcolor=red!60,opacity=0.3](0,0){A}(6,0){B} 
 (2,4){C}
\pstCircleABC[PosAngle=60]{A}{B}{C}{O}
\pstBissectBAC[linestyle=none]{B}{A}{C}{A'}
\pcline[linestyle=dotted,nodesepB=-5cm](A)(A')
\pcline[linestyle=dashed,nodesepB=-5cm](A)(B)
\pcline[linestyle=dashed,nodesepB=-5cm](A)(C)
\pstOutBissectBAC[PointSymbol=none,PointName=none,linestyle=none]{C}{B}{A}{CBA}
\pstOutBissectBAC[PointSymbol=none,PointName=none,linestyle=none]{A}{C}{B}{ACB}
\pstInterLL{B}{CBA}{C}{ACB}{M1}
\pstProjection[PointName=I_1]{A}{B}{M1}[Mab]
\pstCircleOA[linecolor=red!60]{M1}{Mab}
\pstCircleOA[linecolor=red!60,linestyle=dashed,Radius=\pstDistAB{M1}{Mab}] {A}{}
\pstInterCC[Radius=\pstDistAB{M1}{Mab}]{A}{}{M1}{}{P1}{P2}
\psdots(P1)(P2)
\pstBissectBAC[linestyle=none]{A}{B}{C}{B'}
\pstInterLL[PointName=none]{A}{A'}{B}{B'}{Mi}
\psRelNode[angle=90](Mi)(A'){1}{ABi}\psdot(ABi)
\pcline[linestyle=dotted,nodesepB=-3cm](ABi)(Mi)
\pstInterLL[PointName=none]{A}{B}{Mi}{ABi}{E}\psdot(E)
\pstProjection[PointName=none]{A}{B}{Mi}[D]\psdot(D)
\psRelNode[angle=90](E)(B){2}{E'}\psdot(E')
\pstInterLL[PointName=none]{A}{A'}{E}{E'}{X}\psdot(X)
\pstCircleOA[linecolor=blue,linewidth=1.5pt,
fillstyle=solid,fillcolor=blue!50,opacity=0.3]{X}{E}
\pcline[linestyle=dotted](Mi)(D)
\pcline[linestyle=dotted](X)(E)
\end{pspicture}

\end{document}

Its result is BAD :

enter image description here

  1. Animation doesn't work (the result of compiling is normally)!!

I don't know how to fix it. Help me to fix it!

ADD:

\documentclass[12pt,border=5pt]{standalone}
 \usepackage{pstricks}
    % Two lines above get compiling normally  <<<----
\documentclass[12pt,pstricks,border=5pt]{standalone}
    % These line gets wrong compile.   <<<----
 %  Truly is so that ...

\usepackage{pst-node,pst-func,pst-plot,pst-eucl,pstricks-add,multido,animate}
\SpecialCoor
\begin{document}
 %-------------------- write timeline file ---------------------%
\newwrite\TimeLineFile  
 \immediate\openout\TimeLineFile=sinus.txt
  \immediate\write\TimeLineFile{::0x0,1}%
   %remaining frames: overlay filled circle at its current postion
    \multido{\i=2+1}{90}{%
     \immediate\write\TimeLineFile{%
       ::\i % put filled circle on top
 }}
 \immediate\closeout\TimeLineFile
 %------------------- assemble animation -----------------------%
 \psset{xunit=\pstRadUnit,dashadjust=false}
  \begin{animateinline}[controls,timeline=sinus.txt,
  begin={\begin{pspicture}(-0.5,-1.5)(6.6,2)},
   end={\end{pspicture}}]{24}
   %---- static material: axes, labels, curve ----%
   \psaxes[trigLabels,trigLabelBase=3]{->}(0,0)(-2mm,-1.5)(6.5,1.5)[t,-90][$y=\sin(t)$,0]
 \psplot[xunit=1cm,linestyle=dashed,algebraic]{0}{\psPiTwo}{sin(x)}
 \newframe
 \multiframe{91}{n=0+4}{\psset{xunit=1cm,linecolor=blue}
  \psdot[dotsize=3mm](!\n\space dup DegtoRad exch sin)
  \psline[linestyle=dashed](!\n\space dup DegtoRad exch sin)(!\n\space 
  DegtoRad 0)
  }
  \end{animateinline}
 \end{document}
  • 1
    standalone uses the coordinates of the pspicture environment for clipping. If the values are missing then (10,10) will be assumed. Use proper values and everything will be fine! – user2478 Dec 14 '18 at 9:59
  • @Herbert I am a jolterhead..... It stills get a error.... – user173875 Dec 14 '18 at 10:05
  • please make a difference between "LaTeX error" or "wrong output". What do you get? – user2478 Dec 14 '18 at 10:06
  • @Herbert Sorry. Yes, it gets wrong output... – user173875 Dec 14 '18 at 10:07
  • 1
    for an animation you should't tell standalone that you are using pstricks, because standalone would crop the buttons away from the output. For the animation the single pages are larger than the coordinates of pspicture. – user2478 Dec 14 '18 at 12:16
2

with

\documentclass[12pt,pstricks,border=10pt]{standalone}
[...]
\begin{pspicture}[showgrid](-5,-5)(14,11)

I'll get

enter image description here

  • any problem in modification also the other coordinates for pspicture??? – user2478 Dec 14 '18 at 10:33
  • 2
    \begin{pspicture} without coordinates is nonsense for standalone. I already wrote that! – user2478 Dec 14 '18 at 10:46
  • Oh, I see. I have just gotten normally. I understood ... – user173875 Dec 14 '18 at 10:49
  • Why \begin{pspicture} without coordinates is nonsense for standalone ?... – user173875 Dec 14 '18 at 10:52
  • Because it is always 10cm x 10cm and this is only by random. a correct area – user2478 Dec 14 '18 at 10:54

Your Answer

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