I use MikTeX and have updated all packages several minutes ago. The problem is that XeLaTeX produces a weird result where the transparency parts become opaque. It is not caused by preview
as discussed in Transparency in tikz, preview package and xelatex.
\documentclass{article}
\usepackage{pstricks}
\usepackage[active,tightpage]{preview}
\PreviewEnvironment{pspicture}
\setlength{\PreviewBorder}{0bp}
\begin{document}
\begin{pspicture}(-2,-2)(2,2)
\psset{fillstyle=solid}
\psline[linecolor=blue,linewidth=12pt](-2,-2)(2,2)
\psframe[fillcolor=red,opacity=0.5](-1,-1)(1,1)
\end{pspicture}
\end{document}
Compiling the above code with latex-dvips-ps2pdf
produces
However, compiling the same code with xelatex
produces
The screenshots were taken from Adobe Acrobat Reader.
I have xetex.def
as follows.
.................. trimmed for simplicity .....................
%% Version History
%%
%% 2009/11/21 [KB] Version v0.94 merge the two 0.93's.
%%
%% 2009/10/28 [RRM] Version v0.93 fix big-point incompatibility;
%%
........................ trimmed for simplicity ......................
\ProvidesFile{xetex.def}
[2009/11/22 v0.94 LaTeX color/graphics driver for XeTeX (RRM/JK)]
........................ trimmed for simplicity ......................
\endinput
%%
%% End of file `xetex.def'.
The loaded files when compiling with xelatex
:
This is XeTeX, Version 3.1415926-2.3-0.9997.5 (MiKTeX 2.9)
entering extended mode
(F:\opacity.tex
LaTeX2e <2011/06/27>
Babel <v3.8m> and hyphenation patterns for english, afrikaans, ancientgreek, ar
abic, armenian, assamese, basque, bengali, bokmal, bulgarian, catalan, coptic,
croatian, czech, danish, dutch, esperanto, estonian, farsi, finnish, french, ga
lician, german, german-x-2009-06-19, greek, gujarati, hindi, hungarian, iceland
ic, indonesian, interlingua, irish, italian, kannada, kurmanji, lao, latin, lat
vian, lithuanian, malayalam, marathi, mongolian, mongolianlmc, monogreek, ngerm
an, ngerman-x-2009-06-19, nynorsk, oriya, panjabi, pinyin, polish, portuguese,
romanian, russian, sanskrit, serbian, slovak, slovenian, spanish, swedish, swis
sgerman, tamil, telugu, turkish, turkmen, ukenglish, ukrainian, uppersorbian, u
senglishmax, welsh, loaded.
("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\base\article.cls"
Document Class: article 2007/10/19 v1.4h Standard LaTeX document class
("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\base\size10.clo"))
("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\pstricks\pstricks.sty"
("C:\Program Files (x86)\MiKTeX 2.9\tex\generic\pstricks\base\pstricks.tex"
("C:\Program Files (x86)\MiKTeX 2.9\tex\generic\xkeyval\pst-xkey.tex"
("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\xkeyval\xkeyval.sty"
("C:\Program Files (x86)\MiKTeX 2.9\tex\generic\xkeyval\xkeyval.tex"
("C:\Program Files (x86)\MiKTeX 2.9\tex\generic\xkeyval\keyval.tex"))))
("C:\Program Files (x86)\MiKTeX 2.9\tex\generic\pstricks\base\pst-fp.tex"
`pst-fp' v0.05, 2010/01/17 (hv))
`PSTricks' v2.23 <2011/09/04> (tvz)
("C:\Program Files (x86)\MiKTeX 2.9\tex\xelatex\xetex-pstricks\pstricks.con"
("C:\Program Files (x86)\MiKTeX 2.9\tex\generic\pstricks\config\xdvipdfmx.cfg")
) ("C:\Program Files (x86)\MiKTeX 2.9\tex\xelatex\xetex-pstricks\pstricks.con"
("C:\Program Files (x86)\MiKTeX 2.9\tex\generic\pstricks\config\xdvipdfmx.cfg"
Using PSTricks configuration for XeTeX+xdvipdfmx
))) ("C:\Program Files (x86)\MiKTeX 2.9\tex\generic\pstricks\base\pst-fp.tex")
("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\xcolor\xcolor.sty"
("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\00miktex\color.cfg")
("C:\Program Files (x86)\MiKTeX 2.9\tex\xelatex\xetex-def\xetex.def")))
("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\preview\preview.sty"
("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\preview\prtightpage.def"))
No file opacity.aux.
Preview: Fontsize 10pt
Preview: PDFoutput 1
Preview: Tightpage 0 0 0 0
[1] (F:\opacity.aux)
*File List*
article.cls 2007/10/19 v1.4h Standard LaTeX document class
size10.clo 2007/10/19 v1.4h Standard LaTeX file (size option)
pstricks.sty 2011/10/31 v0.52 LaTeX wrapper for `PSTricks' (RN,HV)
pstricks.tex 2011/09/04 v2.23 `PSTricks' (tvz,hv)
pst-xkey.tex 2005/11/25 v1.6 PSTricks specialization of xkeyval (HA)
xkeyval.sty 2008/08/13 v2.6a package option processing (HA)
xkeyval.tex 2008/08/13 v2.6a key=value parser (HA)
pst-fp.tex 2011/09/04 v2.23 `PST-fp' (hv)
xcolor.sty 2007/01/21 v2.11 LaTeX color extensions (UK)
color.cfg 2007/01/18 v1.5 color configuration of teTeX/TeXLive
xetex.def 2009/11/22 v0.94 LaTeX color/graphics driver for XeTeX (RRM/JK)
preview.sty 2010/02/14 11.86 (AUCTeX/preview-latex)
prtightpage.def
***********
)
Output written on opacity.pdf (1 page).
Transcript written on opacity.log.
xetex.def
has the same version). Can you add also the result from adding\listfiles
?xdvipdfmx
do you have? Run in a terminalxdvipdfmx -h
. I havexdvipdfmx-0.7.8 by Jonathan Kew and Jin-Hwan Cho
xdvipdfmx
because it is no problem to run the example with TeXLive on Windows