用同样的方法编译时如何修复错误

用同样的方法编译时如何修复错误

我拥有的一切:

  1. 安装 GhostScript 32 位(我的系统是 Windows 7-32 位)。
  2. 用文本文档编写一个批处理文件,然后跟 .bat 。

其内容( AS 的答案):

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. 将批处理文件注册到PATH环境变量(地址:控制面板\所有控制面板项\系统,点击高级系统设置,点击环境变量,查看系统变量,选择路径,点击编辑,添加“ ;C:\texlive\PSTricksbatch;C:\Program Files\gs\gs9.26\bin ”。

查看我的图片

在此处输入图片描述 在此处输入图片描述

  1. 用“ pstricksbuilder2.bat % ”替换任何未使用的(例如,DVI Viewer)TeXStudio 命令...

其图像:

在此处输入图片描述 在此处输入图片描述

  1. 更改构建

构建和查看:txs:///dvi-chain | txs:///view

默认编译器:txs:///latex

默认查看器:txs:///view-pdf

PDF 查看器:txs:///view-pdf-internal --embedded

图像如下:

在此处输入图片描述

完毕!

示例包括以下问题:

请参阅以下示例:

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}

它产生了一个很好的图像:

在此处输入图片描述

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}

它的形象很糟糕:

在此处输入图片描述

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}

其结果很糟糕:

在此处输入图片描述

  1. 动画不起作用(编译结果正常)!!

我不知道该怎么修复它。帮我修复它!

添加:

\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

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

我去拿

在此处输入图片描述

相关内容