Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

latex-dvips-ps2pdf compilation sequence produces a weird result when I change the grid style. The problem does not happen when I compile the same code with xelatex.

\documentclass[dvipsnames,pstricks,border=12pt]{standalone}


\newpsstyle{gridstyle}
{
    gridcolor=Red!20,
    gridlabelcolor=Blue,
    subgridcolor=Green!20
}

\begin{document}
\begin{pspicture}[showgrid=true](-2,-2)(2,2)
\end{pspicture}
\end{document}

With latex-dvips-ps2pdf:

enter image description here

With xelatex:

enter image description here

The latest edit

It seems to me this problem has been fixed by a package or class author silently. I have just tried and the problem disappeared!

share|improve this question
    
I get a Ghostscript error if I do simpdftex latex test (which is a wrapper for latex+dvips+ps2pdf). The PDF is produced, but the error is /undefined in Blue. –  egreg Dec 21 '11 at 0:09
1  
with current TL2012 everything is fine with xelatex and ps2pdf –  Herbert Sep 29 '12 at 9:42
    
@Herbert: Yes. I just tried it. Thanks. –  Please don't touch Sep 29 '12 at 9:45
    
@Herbert: Why are the grid labels not in math mode? I noticed the minus sign looks like a hyphen. –  Please don't touch Sep 29 '12 at 9:47
1  
the grid is done on PS side. If you want it like LaTeXs math mode then suppress the labels on PS side and use \psaxes –  Herbert Sep 29 '12 at 9:49
show 2 more comments

2 Answers 2

up vote 4 down vote accepted

in some special cases the color definition table is missing in the pdf output. In such cases a

\documentclass[dvipsnames,pstricks,border=12pt,
  prologue%%    option for package xcolor
]{standalone}

should help. Then the package xcolor wrote the color table into the PS and then PDF file. Such a special case maybe the use of the documentclass standalone which creates a single image which then is included in a document which knows nothing about the color Blue. By the way: Using the prologue option in any case doesn't hurt.

share|improve this answer
add comment

(Not really an answer, but too long for a comment)

Running simpdftex latex test, where simpdftex is a wrapper for latex+dvips+ps2pdf, I get a Ghostscript error in the ps2pdf phase:

Error: /undefined in Blue
Operand stack:
   -56.9055
Execution stack:
[...]

The PDF is produced and doesn't show the numbers.

However, as soon as I change Blue into blue or Blue!100, the error disappears and the numbers are correctly produced.

The same error happens if I change Red!20 into Red or into another named color without a blending specification.

It seems a bug in the dvips driver for PSTricks.

share|improve this answer
1  
In my further investigation, gridlabelcolor is the source of problem. It cannot accept any colors defined in dvipsnames. –  Please don't touch Dec 21 '11 at 3:03
    
PSTricks has no driver for colors ... –  Herbert Sep 29 '12 at 10:05
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.