Document ClassesInstalling PSTricks Help

Information and discussion about specific document classes and how to create your own document classes.
edc
Posts: 11
Joined: Sat May 24, 2008 1:46 pm

Installing PSTricks Help

Post by edc »

I am in need of some help with installing PSTricks. I'm getting the necessary files from ftp://ftp.ctan.org/tex-archive/graphics/pstricks/ which I linked to from http://tug.org/PSTricks/main.cgi/.

According to the readme, the following steps need to occur:

a - You have to move all the files from the "generic" subdirectory
to a directory part of your TEXINPUTS environment variable, or to add it
in your TEXINPUTS list of paths.

b - If you are a LaTeX user (and not only a plain TeX one), you have
to do the same thing for the "latex" subdirectory, which define LaTeX
wrappers for all the PSTricks files.

a - If you use the "dvips" DVI to PostScript converter, you have
to move all the files from the "dvips" subdirectory to a directory part
of your DVIPSHEADERS environment variable, or to add it in your DVIPSHEADERS
list of paths.

I'm using the ProText installation on a PC, and I put the files above in C:\Program Files\MiKTeX 2.7\ in the generic, latex, and dvips subfolders.

Here's what I've tried:

Code: Select all

\documentclass{amsart}
\title{Why Won't This Fucking Work!?}
\author{Ed}
\date{\today}

% Check if we are compiling under latex or pdflatex, and include the
% appropriate graphics package
\ifx\pdftexversion\undefined
  \usepackage[dvips]{graphicx}
\else
  \usepackage[pdftex]{graphicx}
\fi

\usepackage{pstricks}
\usepackage{pst-node}
\usepackage{pst-tree}
\usepackage{pst-plot}

\begin{document}

\begin{figure}[h]
\begin{pspicture}(0,0)(3,3)
\psframe(0.7,2)(3.3,3)
\end{pspicture}
\end{figure}

\end{document}
and this gives me the following four errors:

! Undefined control sequence.
<recently read> \c@lor@to@ps

1.23 \psframe(0.7,2)(3.3,3)

! Undefined control sequence.
\XC@usec@lor ...string \color@ #1#2\endcsname \@@
\fi \space
1.23 \psframe(0.7,2)(3.3,3)

! Undefined control sequence.
<recently read> \c@lor@to@ps

1.23 \psframe(0.7,2)(3.3,3)

! Undefined control sequence.
\XC@usec@lor ...string \color@ #1#2\endcsname \@@
\fi \space
1.23 \psframe(0.7,2)(3.3,3)

On the other hand, this works without error:

Code: Select all

\documentclass{amsart}
\title{Why Won't This Fucking Work!?}
\author{Ed}
\date{\today}

% Check if we are compiling under latex or pdflatex, and include the
% appropriate graphics package
\ifx\pdftexversion\undefined
  \usepackage[dvips]{graphicx}
\else
  \usepackage[pdftex]{graphicx}
\fi

\usepackage{pstricks}
\usepackage{pst-node}
\usepackage{pst-tree}
\usepackage{pst-plot}

\begin{document}

\begin{figure}[h]
\begin{pspicture}(0,0)(3,3)
\end{pspicture}
\end{figure}

\end{document}
I'm kind of at a loss, and my guess is it's something elementary, so please help a LaTeX newbie out!

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

daleif
Posts: 199
Joined: Wed Nov 19, 2008 12:46 am

Re: Installing PSTricks Help

Post by daleif »

Any reason why you do this by hand and not just update/upgrade you LaTeX installation?

As the miktex package manager to install the new version for you. That is a lot easier than trying to do it by hand.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Installing PSTricks Help

Post by localghost »

As daleif already mentioned, modern LaTeX distributions have a package manager to install missing packages very easy. You didn't say something about your LaTeX system so we can only guess. If we'd know that, giving help would be much easier.


Best regards
Thorsten¹
daleif
Posts: 199
Joined: Wed Nov 19, 2008 12:46 am

Re: Installing PSTricks Help

Post by daleif »

The OP is using ProTeXt which is MikTeX plus tools
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Installing PSTricks Help

Post by localghost »

daleif wrote:The OP is using ProTeXt which is MikTeX plus tools
Ah, now I got it, too. In this mass of text I failed to notice that. Thanks for pointing that out.
edc
Posts: 11
Joined: Sat May 24, 2008 1:46 pm

Re: Installing PSTricks Help

Post by edc »

So I went ahead and updated all my packages with the automatic MikTeX function and the problem still persists, with the same error messages. Any other ideas?
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Installing PSTricks Help

Post by localghost »

After a closer look at the error message I can see what is wrong. You can't compile with pdflatex when using PSTricks (PostScript Tricks). But you can use the pst-pdf package to have PSTricks graphics with pdflatex. A special build profile for TeXnicCenter is given in another topic [1]. Follow very carefully the advices. As an alternative you can try the auto-pst-pdf package.

[1] Problems with pstricks :S
daleif
Posts: 199
Joined: Wed Nov 19, 2008 12:46 am

Re: Installing PSTricks Help

Post by daleif »

Might be a better idea to switch to TiKz/PGF which can do moch the same as PStricks, and works in latex + dvips and with pdflatex
edc
Posts: 11
Joined: Sat May 24, 2008 1:46 pm

Installing PSTricks Help

Post by edc »

Nice...things seem to be working sort of...

I think I'm getting the definition of the build right, as I've changed all the necessary paths to be exact.

However, when I try the following:

Code: Select all

\documentclass{amsart}
\title{Why Won't This Fucking Work!?}
\author{Ed}
\date{\today}

\usepackage{pst-pdf,pst-text,pstricks-add}

\begin{document}

\begin{figure}
\psset{linecolor=lightgray}
\begin{pspicture}[showgrid=true](-5,-3)(5,3)
\pstextpath[c]{\pscurve(-5,0)(-2.5,-2)(0,2)(2.5,-2)(5,0)}
    {\color{blue}\large Esta frase sinuosa y peculiar est\'a escrita a lo largo de la curva $y=x^4-2x^2$}
\end{pspicture}
\end{figure}

\end{document}
I get two warnings that say "pspicture No. 1 undefined." and "File `PSTry-pics.pdf' not found." Afterwards it spits these directions, but I'm really not sure what it wants me to do:

Use the following commands to create it:
----------------------------------------------
latex PSTry.tex
dvips -o PSTry-pics.ps PSTry.dvi
ps2pdf PSTry-pics.ps
----------------------------------------------

I'm on a PC, and it looks like the above are linux commands, and it seems that they're asking me to do what the build is supposed to do anyway...any ideas on this one?

Oh, and thank you for the assistance, both of you. If I keep on having issues with this, I might just use the other package that is compatible.
daleif
Posts: 199
Joined: Wed Nov 19, 2008 12:46 am

Re: Installing PSTricks Help

Post by daleif »

no those works fine on windows as well.
Post Reply