Graphics, Figures & TablesMiKTeX and PSTricks

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
coachbennett1981
Posts: 274
Joined: Fri Feb 05, 2010 10:15 pm

MiKTeX and PSTricks

Post by coachbennett1981 »

I forgot my mac at home and need to do some figures, but all I have is a crappy pc. (windows XP). I installed MikTex and can produce a pdf with text and normal code (\dfrac, etc.) I am using TexWorks, but I get the following error for pstricks code:

Code: Select all

[Loading MPS to PDF converter (version 2006.09.02).]
)
Preview: Fontsize 12pt
Preview: PDFoutput 1

Package pst-pdf Warning: pspicture No. 1 undefine

Package pst-pdf Warning: File `untitled-1-pics.pdf' not found.
(pst-pdf)                Use the following commands to create it:
(pst-pdf)                ---------------------------------------------------- 
(pst-pdf)                latex untitled-1.tex
(pst-pdf)                dvips -o untitled-1-pics.ps untitled-1.dvi
(pst-pdf)                ps2pdf untitled-1-pics.ps
(pst-pdf)                ---------------------------------------------------- .
("C:\Documents and Settings\Student\My Documents\untitled-1.aux") )
No pages of output.
Transcript written on untitled-1.log.


Here is my document:

Code: Select all

\documentclass[12pt]{article}
\usepackage{pst-pdf}
\usepackage{pstricks}
\usepackage{pst-plot}
\usepackage{pstricks-add}
\pagestyle{empty}
\begin{document}
\psaxes[Ox=-2](-2,0)(2,3)
\end{document}
Any help would be appreciated

NIck
Last edited by coachbennett1981 on Mon Feb 07, 2011 8:29 pm, edited 1 time in total.

Recommended reading 2024:

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

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

MiKTeX and PSTricks

Post by localghost »

Use the auto-pst-pdf package and enable shell escape by calling the compiler with the »--enable-write18« command line option. Customize your editor settings accordingly.


Thorsten
Attachments
The configuration for shell escape in TeXworks. For MiKTeX insert »--enable-write18«.
The configuration for shell escape in TeXworks. For MiKTeX insert »--enable-write18«.
TeXworks-Preferences-Typesetting-Configuration.png (32.98 KiB) Viewed 6030 times
CrazyHorse
Posts: 351
Joined: Sat Aug 02, 2008 8:47 am

MiKTeX and PSTricks

Post by CrazyHorse »

coachbennett1981 wrote:I forgot my mac at home and need to do some figures, but all I have is a crappy pc. (windows XP). I installed MikTex and can produce a pdf with text and normal code (\dfrac, etc.) I am using TexWorks, but I get the following error for pstricks code:
did you install Perl? http://www.activestate.com/perl

Herbert
coachbennett1981
Posts: 274
Joined: Fri Feb 05, 2010 10:15 pm

Re: MiKTeX and PSTricks

Post by coachbennett1981 »

@Thorsten. I followed your instructions but do not have the same options as your pic does.

Under preferences->Typsetting->(Processing tools I selected edit)->Tool Configuration: I had the following options only:

-e
$pdflatex=q/pdflatex-synctex=1%O %S/
-pdf
$fullname

I added -shell-esscape and ran my file again, however it did not work.

@ Herbert

I went your link, but what is this PERL (like the programming Language)?

Thank you for you time.

Nick
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

MiKTeX and PSTricks

Post by localghost »

With the package replacement I already mentioned in my last reply your code works fine on a MiKTeX 2.9 system with the settings for TeXworks as shown in the attachment. The TeXworks version is that installed by MiKTeX. The shown settings are default except for the additional shell escape parameter.

Code: Select all

\documentclass[12pt]{article}
\usepackage{auto-pst-pdf}
\usepackage{pst-plot}
\usepackage{pstricks-add}

\pagestyle{empty}

\begin{document}
  \psaxes[Ox=-2](-2,0)(2,3)
\end{document}
Perl is a script language. To make such a script work, you will need an interpreter installed. Herbert gave you a link where to get one for free. The reason why you need this is the fact that pdfcrop is involved in the background.
Attachments
The configuration for shell escape in TeXworks on Wind0ws.
The configuration for shell escape in TeXworks on Wind0ws.
TeXworks-Preferences-Typesetting-ToolConfiguration.png (15.83 KiB) Viewed 6011 times
CrazyHorse
Posts: 351
Joined: Sat Aug 02, 2008 8:47 am

MiKTeX and PSTricks

Post by CrazyHorse »

coachbennett1981 wrote: I went your link, but what is this PERL (like the programming Language)?
yes, it is needed for pdfcrop, which cuts the surrounding whitespace from the created figures. If you do not install it, then you have to load

Code: Select all

\usepackage[crop=off]{auto-pst-pdf}
Then the coordinates from pspicture are taken to define the image width/height
However, it is a good idea to install Perl and to crop the white space.

Herbert
coachbennett1981
Posts: 274
Joined: Fri Feb 05, 2010 10:15 pm

Re: MiKTeX and PSTricks

Post by coachbennett1981 »

Thank you for you help. Great advice. I will work with this tonight.

Nick
Post Reply