TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

It seems to me this problem related to PSTricks so I have to modify the previous question.

\psset{fillstyle=solid,linecolor=red} that I define globally outside the preview environment can affect the graphics object. But why do I have to put \psset{fillcolor=green} inside the preview environment to make it works?


% the following setting will be ignored by preview
% \psset{fillcolor=green}

% Thus the setting must be inside the preview, does it seem strange to you?
\psframebox{Karl's students}

Is fillcolor very special in this case?

share|improve this question
I think that's how preview works. Only the stuff between the preview environment gets executed after \begin{document}. Otherwise use crop option instead of preview in the class options. – percusse Mar 15 '13 at 15:05
@percusse: See my update because I just found that it is heavily related to fillcolor option. – kiss my armpit Mar 15 '13 at 15:07
It's not related to \preview. The issue comes up whether you use preview or not. It seems to have to do with where you call \psset. Setting things in the preamble doesn't always have the desired effect. Not sure why at this point. If you place your \psset{fillcolor=green} immediately after begin{document} it will work, but not if you place it inside the preamble. – A.Ellett Mar 15 '13 at 18:00
up vote 2 down vote accepted

If you look inside pstricks.sty, at the very end of the package you will find the following line:

  \psset{fillcolor=white}%      hv 0.33
%  \let\pst@color=\relax%
% LaTeX used `\color@endgroup' instead. RN 2004-05-06

Thus trying to set fillcolor inside the preamble will be defeated once you hit \begin{documnent}

share|improve this answer


share|improve this answer
But what is the purpose of setting fillcolor=white at the begin document in pstricks.sty? – kiss my armpit Apr 4 '13 at 15:06
Problems when there is no defined fillcolor – Herbert Apr 4 '13 at 15:10
Why wasn't it put at the bottom of pstrick.sty but not inside \AtBeginDocument (because our global \psset{} is always below \usepackage{pstricks})? – kiss my armpit Apr 4 '13 at 15:16
because no one should set it to undefined – Herbert Apr 4 '13 at 15:24
I meant \psset{fillcolor=white} should be defined at the bottom of pstricks.sty but not inside \AtBeginDocument{}. So this setting can be overridden by us via \psset{fillcolor=<other color>} that we put below \usepackage{pstricks}. – kiss my armpit Apr 4 '13 at 15:28

This weird feature has been disabled in the current pstricks.sty.

share|improve this answer
@texenthusiast: No. It has not been mentioned in the news letter yet. – kiss my armpit Apr 7 '13 at 6:00

Your Answer


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.