mdframed 中的字体颜色始终是黑色

mdframed 中的字体颜色始终是黑色

在 Linux 中构建下面的 MWE 时(Centos,TeXLive 2013,mdframed=1.9b,2013/07/01),我在正文中的红色圆角矩形内获得了淡黄色上的预期红色文本,在底部的 PGF 单节点图中获得了全黄色上的红色文本。[第一张图片]

在 Windows 7 (Cygwin、TeXLive 2014、mdframed=1.9b,2013/07/01) 中构建下面的 MWE 时,我得到了意外正文中红色圆角矩形内淡黄色底面为黑色文字,底部 PGF 单节点图中全黄色底面为红色文字。[第二张图片]

编辑:在所有情况下我都使用 xelatex。使用 luatex 和 pdflatex 我得到了黄色上的红色,正如期望和预期的那样。

当我修改 MWE (注释掉\usepackage[tikz]{mdframed}并取消注释)\usepackage{mdframed}时,我在正文中得到了红色文本,文本内部是淡黄色的红色非圆角矩形(正如我所料),在底部的 PGF 单节点图中,红色文本是全黄色的。[第三张图像;我认为由于 PDF 渲染而隐藏了顶部和左侧的线条 - 当我更改缩放级别时它们就在那里]

在 Windows/Cygwin 下使用 framemethod=tikz 时,它似乎忽略了 mdframed 中的 fontcolor 指令(并且font={c\color{red},经过测试但未在 MWE 中显示;font={\sffamily}如 MWE 输出中所示执行预期操作)。

MWE 底部包含 TikZ 图片,用于验证 TikZ 颜色是否有效。此外,字体颜色在 mdframed 之外的其他地方(未显示)也可以使用。

为什么会发生这种情况?我该怎么办?

\documentclass[letterpaper,10pt,onecolumn,twoside]{article}
\usepackage{tikz}
\usepackage{xcolor}
\usepackage[tikz]{mdframed}
%\usepackage{mdframed}
\usepackage{lipsum}

\tikzset{
  main node/.style={rectangle,draw=red,thick,fill=yellow,
                    rounded corners,font=\color{red}\sffamily},
}

\begin{document}

\lipsum[1]
\begin{mdframed}[linecolor=red,roundcorner=3pt,backgroundcolor=yellow!60,
                 font={\sffamily},fontcolor=red]
\lipsum[2]
\end{mdframed}
\lipsum[3]

\bigskip\noindent
\begin{tikzpicture}
\node[main node]{Red on yellow\strut};
\end{tikzpicture}

\end{document}

''\listfiles'' 输出,按预期工作

 *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)
    tikz.sty    2010/10/13 v2.10 (rcs-revision 1.76)
     pgf.sty    2008/01/15 v2.10 (rcs-revision 1.12)
  pgfrcs.sty    2010/10/25 v2.10 (rcs-revision 1.24)
everyshi.sty    2001/05/15 v3.00 EveryShipout Package (MS)
  pgfrcs.code.tex
 pgfcore.sty    2010/04/11 v2.10 (rcs-revision 1.7)
graphicx.sty    1999/02/16 v1.0f Enhanced LaTeX Graphics (DPC,SPQR)
  keyval.sty    1999/03/16 v1.13 key=value parser (DPC)
graphics.sty    2009/02/05 v1.0o Standard LaTeX Graphics (DPC,SPQR)
    trig.sty    1999/03/16 v1.09 sin cos tan (DPC)
graphics.cfg    2010/04/23 v1.9 graphics configuration of TeX Live
   xetex.def    2013/04/29 v0.96 LaTeX color/graphics driver for XeTeX (RRM/JK)

  pgfsys.sty    2010/06/30 v2.10 (rcs-revision 1.37)
  pgfsys.code.tex
pgfsyssoftpath.code.tex    2008/07/18  (rcs-revision 1.7)
pgfsysprotocol.code.tex    2006/10/16  (rcs-revision 1.4)
  xcolor.sty    2007/01/21 v2.11 LaTeX color extensions (UK)
   color.cfg    2007/01/18 v1.5 color configuration of teTeX/TeXLive
 pgfcore.code.tex
pgfcomp-version-0-65.sty    2007/07/03 v2.10 (rcs-revision 1.7)
pgfcomp-version-1-18.sty    2007/07/23 v2.10 (rcs-revision 1.1)
  pgffor.sty    2010/03/23 v2.10 (rcs-revision 1.18)
 pgfkeys.sty
 pgfkeys.code.tex
  pgffor.code.tex
    tikz.code.tex
mdframed.sty    2013/07/01 1.9b: mdframed
kvoptions.sty    2011/06/30 v3.11 Key value format for package options (HO)
 ltxcmds.sty    2011/11/09 v1.22 LaTeX kernel commands for general use (HO)
kvsetkeys.sty    2012/04/25 v1.16 Key value parser (HO)
infwarerr.sty    2010/04/08 v1.3 Providing info/warning/error messages (HO)
etexcmds.sty    2011/02/16 v1.5 Avoid name clashes with e-TeX commands (HO)
ifluatex.sty    2010/03/01 v1.3 Provides the ifluatex switch (HO)
  xparse.sty    2013/07/28 v4582 L3 Experimental document command parser
   expl3.sty    2013/07/28 v4582 L3 Experimental code bundle wrapper
 l3names.sty    2012/12/07 v4346 L3 Namespace for primitives
l3bootstrap.sty    2013/07/28 v4581 L3 Experimental bootstrap code
    etex.sty    1998/03/26 v2.0 eTeX basic definition package (PEB)
l3basics.sty    2013/07/28 v4581 L3 Basic definitions
 l3expan.sty    2013/07/24 v4565 L3 Argument expansion
    l3tl.sty    2013/07/28 v4581 L3 Token lists
   l3seq.sty    2013/07/28 v4581 L3 Sequences and stacks
   l3int.sty    2013/07/28 v4581 L3 Integers
 l3quark.sty    2013/07/21 v4564 L3 Quarks
   l3prg.sty    2013/07/28 v4581 L3 Control structures
 l3clist.sty    2013/07/28 v4581 L3 Comma separated lists
 l3token.sty    2013/07/28 v4581 L3 Experimental token manipulation
  l3prop.sty    2013/07/28 v4581 L3 Property lists
   l3msg.sty    2013/07/28 v4581 L3 Messages
  l3file.sty    2013/07/28 v4581 L3 File and I/O operations
  l3skip.sty    2013/07/28 v4581 L3 Dimensions and skips
  l3keys.sty    2013/07/28 v4581 L3 Experimental key-value interfaces
    l3fp.sty    2013/07/09 v4521 L3 Floating points
   l3box.sty    2013/07/28 v4581 L3 Experimental boxes
l3coffins.sty    2012/09/09 v4212 L3 Coffin code layer
 l3color.sty    2012/08/29 v4156 L3 Experimental color support
l3luatex.sty    2013/07/28 v4581 L3 Experimental LuaTeX-specific functions
l3candidates.sty    2013/07/24 v4576 L3 Experimental additions to l3kernel
   ifpdf.sty    2011/01/30 v2.3 Provides the ifpdf switch (HO)
etoolbox.sty    2011/01/03 v2.1 e-TeX tools for LaTeX
zref-abspage.sty    2012/04/04 v2.24 Module abspage for zref (HO)
zref-base.sty    2012/04/04 v2.24 Module base for zref (HO)
kvdefinekeys.sty    2011/04/07 v1.3 Define keys (HO)
pdftexcmds.sty    2011/11/29 v0.20 Utility functions of pdfTeX for LuaTeX (HO)
 auxhook.sty    2011/03/04 v1.3 Hooks for auxiliary files (HO)
atbegshi.sty    2011/10/05 v1.16 At begin shipout hook (HO)
needspace.sty    2010/09/12 v1.3d reserve vertical space
md-frame-1.mdf    2013/07/01\ 1.9b: md-frame-1
  lipsum.sty    2011/04/14 v1.2 150 paragraphs of Lorem Ipsum dummy text
 ***********

\listfiles输出,未按预期工作

 *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)
    tikz.sty    2013/12/13 v3.0.0 (rcs-revision 1.142)
     pgf.sty    2013/12/18 v3.0.0 (rcs-revision 1.14)
  pgfrcs.sty    2013/12/20 v3.0.0 (rcs-revision 1.28)
everyshi.sty    2001/05/15 v3.00 EveryShipout Package (MS)
  pgfrcs.code.tex
 pgfcore.sty    2010/04/11 v3.0.0 (rcs-revision 1.7)
graphicx.sty    2014/04/25 v1.0g Enhanced LaTeX Graphics (DPC,SPQR)
  keyval.sty    2014/05/08 v1.15 key=value parser (DPC)
graphics.sty    2009/02/05 v1.0o Standard LaTeX Graphics (DPC,SPQR)
    trig.sty    1999/03/16 v1.09 sin cos tan (DPC)
graphics.cfg    2010/04/23 v1.9 graphics configuration of TeX Live
   xetex.def    2014/04/28 v4.01 LaTeX color/graphics driver for XeTeX (RRM/JK)

  pgfsys.sty    2013/11/30 v3.0.0 (rcs-revision 1.47)
  pgfsys.code.tex
pgfsyssoftpath.code.tex    2013/09/09  (rcs-revision 1.9)
pgfsysprotocol.code.tex    2006/10/16  (rcs-revision 1.4)
  xcolor.sty    2007/01/21 v2.11 LaTeX color extensions (UK)
   color.cfg    2007/01/18 v1.5 color configuration of teTeX/TeXLive
 pgfcore.code.tex
pgfcomp-version-0-65.sty    2007/07/03 v3.0.0 (rcs-revision 1.7)
pgfcomp-version-1-18.sty    2007/07/23 v3.0.0 (rcs-revision 1.1)
  pgffor.sty    2013/12/13 v3.0.0 (rcs-revision 1.25)
 pgfkeys.sty
 pgfkeys.code.tex
 pgfmath.sty
 pgfmath.code.tex
  pgffor.code.tex
    tikz.code.tex
mdframed.sty    2013/07/01 1.9b: mdframed
kvoptions.sty    2011/06/30 v3.11 Key value format for package options (HO)
 ltxcmds.sty    2011/11/09 v1.22 LaTeX kernel commands for general use (HO)
kvsetkeys.sty    2012/04/25 v1.16 Key value parser (HO)
infwarerr.sty    2010/04/08 v1.3 Providing info/warning/error messages (HO)
etexcmds.sty    2011/02/16 v1.5 Avoid name clashes with e-TeX commands (HO)
ifluatex.sty    2010/03/01 v1.3 Provides the ifluatex switch (HO)
  xparse.sty    2014/05/05 v4740 L3 Experimental document command parser
   expl3.sty    2014/05/20 v4814 L3 programming layer (loader)
   ifpdf.sty    2011/01/30 v2.3 Provides the ifpdf switch (HO)
expl3-code.tex    2014/05/20 v4814 L3 programming layer
    etex.sty    1998/03/26 v2.0 eTeX basic definition package (PEB)
etoolbox.sty    2011/01/03 v2.1 e-TeX tools for LaTeX
zref-abspage.sty    2012/04/04 v2.24 Module abspage for zref (HO)
zref-base.sty    2012/04/04 v2.24 Module base for zref (HO)
kvdefinekeys.sty    2011/04/07 v1.3 Define keys (HO)
pdftexcmds.sty    2011/11/29 v0.20 Utility functions of pdfTeX for LuaTeX (HO)
 auxhook.sty    2011/03/04 v1.3 Hooks for auxiliary files (HO)
atbegshi.sty    2011/10/05 v1.16 At begin shipout hook (HO)
needspace.sty    2010/09/12 v1.3d reserve vertical space
md-frame-1.mdf    2013/07/01\ 1.9b: md-frame-1
  lipsum.sty    2011/04/14 v1.2 150 paragraphs of Lorem Ipsum dummy text
 ***********

\listfiles输出,在 Linux 服务器上更新,不是预期的输出

 *File List*
 article.cls    2014/09/29 v1.4h Standard LaTeX document class
  size10.clo    2014/09/29 v1.4h Standard LaTeX file (size option)
    tikz.sty    2013/12/13 v3.0.0 (rcs-revision 1.142)
     pgf.sty    2013/12/18 v3.0.0 (rcs-revision 1.14)
  pgfrcs.sty    2013/12/20 v3.0.0 (rcs-revision 1.28)
everyshi.sty    2001/05/15 v3.00 EveryShipout Package (MS)
  pgfrcs.code.tex
 pgfcore.sty    2010/04/11 v3.0.0 (rcs-revision 1.7)
graphicx.sty    2014/10/28 v1.0g Enhanced LaTeX Graphics (DPC,SPQR)
  keyval.sty    2014/10/28 v1.15 key=value parser (DPC)
graphics.sty    2014/10/28 v1.0p Standard LaTeX Graphics (DPC,SPQR)
    trig.sty    1999/03/16 v1.09 sin cos tan (DPC)
graphics.cfg    2010/04/23 v1.9 graphics configuration of TeX Live
   xetex.def    2015/03/25 v4.04 LaTeX color/graphics driver for XeTeX (TeX Liv
e/RRM/JK)
  pgfsys.sty    2013/11/30 v3.0.0 (rcs-revision 1.47)
  pgfsys.code.tex
pgfsyssoftpath.code.tex    2013/09/09  (rcs-revision 1.9)
pgfsysprotocol.code.tex    2006/10/16  (rcs-revision 1.4)
  xcolor.sty    2007/01/21 v2.11 LaTeX color extensions (UK)
   color.cfg    2007/01/18 v1.5 color configuration of teTeX/TeXLive
 pgfcore.code.tex
pgfcomp-version-0-65.sty    2007/07/03 v3.0.0 (rcs-revision 1.7)
pgfcomp-version-1-18.sty    2007/07/23 v3.0.0 (rcs-revision 1.1)
  pgffor.sty    2013/12/13 v3.0.0 (rcs-revision 1.25)
 pgfkeys.sty
 pgfkeys.code.tex
 pgfmath.sty
 pgfmath.code.tex
  pgffor.code.tex
    tikz.code.tex
mdframed.sty    2013/07/01 1.9b: mdframed
kvoptions.sty    2011/06/30 v3.11 Key value format for package options (HO)
 ltxcmds.sty    2011/11/09 v1.22 LaTeX kernel commands for general use (HO)
kvsetkeys.sty    2012/04/25 v1.16 Key value parser (HO)
infwarerr.sty    2010/04/08 v1.3 Providing info/warning/error messages (HO)
etexcmds.sty    2011/02/16 v1.5 Avoid name clashes with e-TeX commands (HO)
ifluatex.sty    2010/03/01 v1.3 Provides the ifluatex switch (HO)
  xparse.sty    2015/06/15 v5630 L3 Experimental document command parser
   expl3.sty    2015/06/15 v5630 L3 programming layer (loader)
expl3-code.tex    2015/06/15 v5630 L3 programming layer
l3unicode-data.def    2015/03/01 v5544 L3 Unicode data
l3xdvipdfmx.def
etoolbox.sty    2015/05/04 v2.2 e-TeX tools for LaTeX (JAW)
zref-abspage.sty    2012/04/04 v2.24 Module abspage for zref (HO)
zref-base.sty    2012/04/04 v2.24 Module base for zref (HO)
kvdefinekeys.sty    2011/04/07 v1.3 Define keys (HO)
pdftexcmds.sty    2011/11/29 v0.20 Utility functions of pdfTeX for LuaTeX (HO)
   ifpdf.sty    2011/01/30 v2.3 Provides the ifpdf switch (HO)
 auxhook.sty    2011/03/04 v1.3 Hooks for auxiliary files (HO)
atbegshi.sty    2011/10/05 v1.16 At begin shipout hook (HO)
needspace.sty    2010/09/12 v1.3d reserve vertical space
md-frame-1.mdf    2013/07/01\ 1.9b: md-frame-1
  lipsum.sty    2014/07/27 v1.3 150 paragraphs of Lorem Ipsum dummy text
 ***********

期望和想要

不期望也不想要

意料之中但并非所愿

答案1

这似乎是介于mdframed和之间的错误xelatex,比我服务器上的更新。当我在服务器上更新 TeXLive 时,我得到了xelatex比以前更新的结果,并且得到了与xelatex我工作站上的结果一致的结果。(进一步的研究细节如上所示。)

从上面的评论来看,xelatex还存在我尚未遇到的其他问题。我切换到lualatex现在获得了预期的结果。

相关内容