我使用 MikTeX,几分钟前更新了所有软件包。问题是 XeLaTeX 产生了一种奇怪的结果,透明部分变得不透明。这不是由 preview
讨论的tikz、预览包和 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}
latex-dvips-ps2pdf
使用produce编译上述代码
然而,使用编译相同的代码xelatex
会产生
屏幕截图取自 Adobe Acrobat Reader。
我有xetex.def
如下内容。
.................. 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'.
编译时加载的文件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.
答案1
安装 TeXLive 2011 后,我得到了预期的输出。因此这是 MikTeX 的问题。
编辑:今天(2012 年 5 月 18 日),我用 MikTeX 的 XeLaTeX 编译了代码,不幸的是,这个问题仍然存在。我希望 MikTeX 维护者能尽快修复这个问题。
编辑:今天(2014 年 6 月 4 日),我用 MikTeX 的 XeLaTeX 编译了代码,这个问题已经修复了。我不知道修复的具体日期。谢谢,你们是英雄!
答案2
透明度与 miktex 中的 pgf/xetex 一起工作(我现在没有时间制作与您的示例完全对应的示例):
\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}