Graphics, Figures & Tablespstricks not working

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
ofeyrpf
Posts: 7
Joined: Wed Feb 18, 2009 7:19 pm

pstricks not working

Post by ofeyrpf »

Hi,
Is there any reason the following little bit of /pstricks should not work? I can't see what is wrong.

Code: Select all

\documentclass[a4paper,12pt]{report}
\pagestyle{myheadings}
\usepackage{pstricks} 
\usepackage{enumitem}
\begin{document}
\begin{enumerate}%[resume]
\item {\bf Problems:} Measure the following lines with a ruler or measuring tape.\\
\begin{pspicture}(0,0)
\psline(2,1)(3,2)
\psline(3,2)(3,5)
\psline(3,5)(5,6)
\rput(1,6){(a)}
\psline(7,6)(10,5)
\psline(10,5)(7,2)
\psline(7,2)(11,2)
\rput(6,6){(b)}
\end{pspicture}
\end{enumerate}
\end{document}
Any help would be greatly appreciated.
Thanks,
Shane

Recommended reading 2024:

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

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

User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

pstricks not working

Post by Johannes_B »

What is not working?
Did you run this with latex or xelatex? pdflatex can't do pstricks on its own.

Best regards
Johannes
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
ofeyrpf
Posts: 7
Joined: Wed Feb 18, 2009 7:19 pm

pstricks not working

Post by ofeyrpf »

Hi,

I am using MikTex (On Windows) and pdfLaTex. I tried all allowed options and they all give errors except BibTex which outputs nothing.

Error:

Code: Select all

......
("C:\Program Files (x86)\MiKTeX 2.9\tex\generic\oberdiek\ifpdf.sty"))))
(C:\Users\sam\Desktop\TestPSTricks.aux)
("C:\Program Files (x86)\MiKTeX 2.9\tex\context\base\supp-pdf.mkii"
[Loading MPS to PDF converter (version 2006.09.02).]
)
! Undefined control sequence.
<recently read> \c@lor@to@ps 
                             
l.12 \psline(
             2,1)(3,2)
? 
Thanks,
Shane
ofeyrpf
Posts: 7
Joined: Wed Feb 18, 2009 7:19 pm

pstricks not working

Post by ofeyrpf »

The following typed into the command line creates a dvi file where I can see the pstricks line I am trying to draw. But it does not appear in the pdf.

Code: Select all

latex TestPSTricks.tex
dvips TestPSTricks.dvi
ps2pdf -dAutoRotatePages#/None TestPSTricks.ps 
Thanks,
Shane
Post Reply