3

我一直试图让 pstricks 工作,但无济于事。我正在使用 Miktex,我从它的包管理器下载了包。但是当我尝试构建它时,它总是失败:

This is XeTeX, Version 3.1415926-2.2-0.9995.1 (MiKTeX 2.8)
entering extended mode
(C:\xxxx\Desktop\untitled-6.tex
LaTeX2e <2009/09/24>
Babel <v3.8l> and hyphenation patterns for english, dumylang, nohyphenation, ge
rman, ngerman, german-x-2009-06-19, ngerman-x-2009-06-19, french, portuguese, l
oaded.
("C:\Program Files\MiKTeX 2.8\tex\latex\base\article.cls"
Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
("C:\Program Files\MiKTeX 2.8\tex\latex\base\size10.clo"))
("C:\Program Files\MiKTeX 2.8\tex\latex\oberdiek\epstopdf.sty"
("C:\Program Files\MiKTeX 2.8\tex\latex\oberdiek\epstopdf-base.sty"
("C:\Program Files\MiKTeX 2.8\tex\generic\oberdiek\infwarerr.sty")
("C:\Program Files\MiKTeX 2.8\tex\latex\oberdiek\grfext.sty")
("C:\Program Files\MiKTeX 2.8\tex\latex\oberdiek\kvoptions.sty"
("C:\Program Files\MiKTeX 2.8\tex\latex\graphics\keyval.sty")
("C:\Program Files\MiKTeX 2.8\tex\generic\oberdiek\kvsetkeys.sty"
("C:\Program Files\MiKTeX 2.8\tex\generic\oberdiek\etexcmds.sty")))
("C:\Program Files\MiKTeX 2.8\tex\generic\oberdiek\pdftexcmds.sty"
("C:\Program Files\MiKTeX 2.8\tex\generic\oberdiek\ifluatex.sty")
("C:\Program Files\MiKTeX 2.8\tex\generic\oberdiek\ltxcmds.sty"))

Package epstopdf Warning: No graphics package `graphic{s,x}' loaded.

)) ("C:\Program Files\MiKTeX 2.8\tex\latex\graphics\graphics.sty"
("C:\Program Files\MiKTeX 2.8\tex\latex\graphics\trig.sty")
("C:\Program Files\MiKTeX 2.8\tex\latex\00miktex\graphics.cfg")
("C:\Program Files\MiKTeX 2.8\tex\xelatex\xetex-def\xetex.def"))
("C:\Program Files\MiKTeX 2.8\tex\latex\pstricks\pstricks.sty"
("C:\Program Files\MiKTeX 2.8\tex\generic\pstricks\pstricks.tex"
`PSTricks' v1.29  <2009/05/19> (tvz)

======================================================================
starting package maintenance...
installation directory: "C:\Program Files\MiKTeX 2.8"
package repository: http://ftp.eq.uc.pt/software/TeX/systems/win32/miktex/tm/packages/
lightweight database digest: ecef59fd2592919972b79117b8fcd1c8
going to download 1520 bytes
going to install 4 file(s) (1 package(s))
downloading http://ftp.eq.uc.pt/software/TeX/systems/win32/miktex/tm/packages/xetex-pstricks.tar.lzma...
1520 bytes, 8.84 KB/Sec
extracting files from xetex-pstricks.tar.lzma...
miktex-xetex.exe: Windows API error 87: The parameter is incorrect.

miktex-xetex.exe: Data: C:\ProgramData\MiKTeX\2.8\miktex\config\1567d83d412396067c84a669e65114a0.fndb
======================================================================
("C:\Program Files\MiKTeX 2.8\tex\generic\pstricks\pstricks.con"))
("C:\Program Files\MiKTeX 2.8\tex\latex\xcolor\xcolor.sty"
("C:\Program Files\MiKTeX 2.8\tex\latex\00miktex\color.cfg")))
(C:\xxxx\Desktop\untitled-6.aux)
! Undefined control sequence.
<recently read> \c@lor@to@ps 

l.8 \psframe(0.7,2)(3.3,3)

? 

我有什么特别的事情要做吗?

谢谢编辑:

这是代码:

\documentclass{article}
\usepackage{epstopdf}
\usepackage{graphics}
\usepackage{pstricks}
\begin{document}
\begin{figure}
\begin{pspicture}(4,5)
\psframe(0.7,2)(3.3,3)
\rput(2,2.5){First Example}
\end{pspicture}
\end{figure}
\end{document}
4

2 回答 2

1

我无法从部分日志结果中看到,但看起来 pstricks 加载正常,因为它已经到了那么远:您可以进一步查看结果以检查,它会列出它使用的 pstricks 包。我可以看到两个问题。首先,你需要一个

\usepackage{graphics}

其次,您需要从我可以在 TeXworks 中看到的下拉菜单中选择 DVI。它应该说像 LaTex + DVI + PDF 这样的东西。您可以将 pdflatex 与 pstricks 一起使用(参见例如http://www.coli.uni-saarland.de/~fouvry/how-do-I.html),但 dvi 更容易。如果你走 pdflatex 路线,第一步是:

\usepackage{epstopdf}

省略这个包是导致我们上面看到的错误的原因,但在修复之后会出现其他错误(参见上面的网站)。作为一个未成年人,很高兴看到图片,因为上面的评论显然是必要的,但另外将代码复制并粘贴为文本对我来说复制和尝试很有用(是的,我有点懒惰的)。

于 2010-01-21T08:20:11.017 回答
0

它的 PSTricks,而不是 PDFTricks。

我通过先转换为 PS,然后再转换为 PDF 来解决这个问题。在 TeXNic 中心有一个选项,在顶部的下拉框中,看起来像 LaTeX => PS => PDF

在 TeXlipse 中,您可以通过右键单击项目来设置它,然后选择“latex.exe + dvips.exe + ps2pdf.exe”作为构建命令。

于 2010-02-16T18:01:08.103 回答