# PSTricks will not compile

\documentclass[12pt]{article}
\usepackage[paperheight=9in,paperwidth=13.24in,margin=0in]{geometry}
\usepackage{pstricks}
\usepackage{graphicx}
\begin{document}
\thispagestyle{empty}
\psset{unit=1in}
\begin{pspicture}(13.24in,9in)
\psframe[fillstyle=solid,fillcolor=Maroon](0,0)(13.24,9)

\end{pspicture}

\end{document}


I am following a tutorial outlined here: How can I design a book cover?

I am following the Robbers book.

Everything seems fine until I paste the \psframe[fillstyle=solid,fillcolor=Maroon](0,0)(13.24,9)

What could be the problem?

-

It seems you are using pdflatex to compile. Somehow, pstricks is not friendly with pdflatex. To compile documents that use pstricks, you should use either xelatex or latex->dvips->ps2pdf. To do so, you should run

xelatex yourtexfile.tex


from the command prompt. If you have an editor (which one you are using?), it will certianly have a button for this.

Or you may use the same pdflatex by adding pdf option to pstricks

\usepackage[svgnames,pdf]{pstricks}


But for this you should have the latest version of pstricks. The following code works for me with pdflatex (though I get 2 badboxes).

\documentclass[12pt]{article}
\usepackage[paperheight=9in,paperwidth=13.24in,margin=0in]{geometry}
\usepackage[svgnames,pdf]{pstricks}
\usepackage{graphicx}
\begin{document}
\thispagestyle{empty}
\psset{unit=1in}
\noindent
\begin{pspicture}(13.24in,9in)
\psframe[fillstyle=solid,fillcolor=Maroon](0,0)(13.24,9)
\end{pspicture}
\end{document}


If you need more help to know how to use xelatex or latex->dvips->ps2pdf routes, please let us know with some details like which editor and tex distribution you are using.

# Edit:

You can make xelatex work with texmaker. First install a latest version of texmaker (make it a fresh install). Then pull the dropdown menu (by clicking the arrow tip next to pdflatex as in picture). Scroll down to get xelatex ans select it. Now you should get the button saying xelatex instead of pdflatex.

Don't forget to remove pdf option from pstricks while using xelatex.

-
the pdf option doesn't work in all cases ... –  Herbert Jan 14 '13 at 16:28
@Harish Kumar I do get a pdf output running xelatex from the command line. However, I do not get any output in my editor using the pdflatex code you posted. I have run this code in both Gummi and Texmaker, with the same bad result. I am not sure how to invoke xetex from within these systems. –  Paul Jan 14 '13 at 16:38
@Herbert True. But why? If pstricks works with pdflatex always and if the command names become less alien, I swear I will join pstricks gang also ;-). It has lot of goodies which I like but you know ... My humble request with you is -- please do something to get pstricks work with pdflatex always. –  Harish Kumar Jan 14 '13 at 23:42
@HarishKumar One TeX.SX question example where [pdf] has problem. You might be aware of PSTricks using pdflatex at TUG 2010 and Basics of PSTricks at river-valley.tv where TUG Proc videos are available –  texenthusiast Jan 15 '13 at 0:21
@HarishKumar: it needs an environment pspicture or postscript for the embedded PSTricks code. Then it will always work. –  Herbert Jan 15 '13 at 8:13

use

\usepackage[dvipsnames]{pstricks}


to activate the color names. And don't forget the \noindent

[...]
\psset{unit=1in}\noindent
\begin{pspicture}(13.24,9)
[...]

-

Maroon is not a predefined color, you need to load the xcolor package with the dvipsnames option. Adding the following line underneath the \usepackage[...]{geometry} should make it work: \usepackage[dvipsnames]{xcolor}.

This sample works for me:

\documentclass[12pt]{article}
\usepackage[paperheight=9in,paperwidth=13.24in,margin=0in]{geometry}
\usepackage[dvipsnames]{xcolor}
\usepackage{pstricks}
\usepackage{graphicx}
\begin{document}
\thispagestyle{empty}
\psset{unit=1in}
\begin{pspicture}(13.24in,9in)
\psframe[fillstyle=solid,fillcolor=Maroon](0,0)(13.24,9)
\end{pspicture}

\end{document}

-
Alternatively you can also add the svgnames/dvipsnames specification into the option of the documentclass, this will be passed on to the pstricks package, which will then hand it on to the xcolor package when it's loaded: \documentclass[12pt,svgnames]{article} –  myrtille Jan 14 '13 at 14:39
The above code does not work for me. Here is the output of the log file pastebin.ubuntu.com/1530953 –  Paul Jan 14 '13 at 14:51
use xelatex or latex->dvips->ps2pdf –  Herbert Jan 14 '13 at 15:04
This is probably a stupid question, but how do I invoke xelatex? I have looked on the internet, but can not seem to find an answer. –  Paul Jan 14 '13 at 15:42
which editor do you use? –  Herbert Jan 14 '13 at 16:25