12

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

enter image description here

However, compiling the same code with xelatex produces

enter image description here

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.
5
  • I get the expected result (xetex.def has the same version). Can you add also the result from adding \listfiles?
    – egreg
    Dec 12, 2011 at 11:19
  • I have version 2.23 of PSTricks; that's the only difference.
    – egreg
    Dec 12, 2011 at 11:32
  • what version of xdvipdfmxdo you have? Run in a terminal xdvipdfmx -h. I have xdvipdfmx-0.7.8 by Jonathan Kew and Jin-Hwan Cho
    – user2478
    Dec 12, 2011 at 11:38
  • I've tried also on a Ubuntu box (TeX Live 2011): same result as on Mac OS X.
    – egreg
    Dec 12, 2011 at 12:25
  • 1
    then it looks like a problem with the MiKTeX version of xdvipdfmx because it is no problem to run the example with TeXLive on Windows
    – user2478
    Dec 12, 2011 at 13:48

2 Answers 2

7

Once I have installed TeXLive 2011, I got the expected output. Thus it is MikTeX's issue.

EDIT: Today (May 18, 2012), I compiled the code with MikTeX's XeLaTeX and unfortunately, this issue still exists. I hope MikTeX maintainers will fix this as soon as possible.

EDIT: Today (June 4, 2014), I compile the code with MikTeX's XeLaTeX and this issue has been fixed. I don't know the exact date when it was fixed. Thanks, you are the heros!

4
+100

Transparency works with pgf/xetex in miktex (I don't have the time now to make an exact counterpart of your example):

\documentclass{article}
\usepackage{pgf}

\begin{document}

\makebox[0pt][l]{\rule{12em}{10pt}}%
\color{red}%
\rule{1em}{14pt} ABC
\pgfsetfillopacity{0.5}%
\rule{1em}{14pt} ABC
\pgfsetfillopacity{1}%
\rule{1em}{14pt} ABC


\end{document}
5
  • sure, but that was not the problem. Running your document with xelatex -no-pdf <file> and an additional xdvipdfmx <file.xdv> run should give the same result. With TeXLive it does ...
    – user2478
    Dec 13, 2011 at 8:47
  • @Herbert I only meant to say that transparency in itself works with xetex so the source of the problem could also be somewhere in the pstricks files or some configuration file (and not in the binary). Could you sent me the log-file? Then I will it compare with mine. Dec 13, 2011 at 11:28
  • that was already said that XeTeX on TeXLive has no problems. Above you'll find a log file from the original poster.
    – user2478
    Dec 13, 2011 at 12:01
  • 1
    @Herbert: The output above is not a log-file but a terminal output. Also it is from a system (miktex) where the example fails - as it fails for me too I don't need this log but one from texlive where it works. Dec 13, 2011 at 12:30
  • ah sorry, will send it with private mail in a couple of minutes
    – user2478
    Dec 13, 2011 at 12:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .