[Tex/LaTex] How to run PSTricks in TeXShop

pstrickstexshop

Why can't I run the following command in my TeXShop?

\documentclass{article}
\usepackage{pstricks-add} 

\begin{document} 
\psset{algebraic=true} 
\pspicture(-2,-0.5)(2,2) 
\psline{<->}(-2,0)(2,0) 
\psline{->}(0,-0.5)(0,2) 
\psplot{-1.5}{1}{x*x+x} 
\endpspicture 
\end{document}  

Best Answer

In TeXShop, you can choose the TeX and DVI item from the Typeset menu, and then compile your document. Alternatively, (and a better solution) you can put the following line in your file:

% !TEX TS-program = latex

as the first line of your document. (This line can be generated by TeXShop by choosing the Program item from the Macros menu, and choosing latex from the list provided by the macro.)

Related Question