来自 \NewDocumentEnvironment 的无关文本(损坏的 TeXLive2012?)

来自 \NewDocumentEnvironment 的无关文本(损坏的 TeXLive2012?)

当我使用(蓝色文本)通过 TeXLive2012\NewDocumentEnvironment定义自定义环境时,我似乎得到了包含环境名称的虚假文本(红色文本) :minipage

在此处输入图片描述

\NewEnviron如果我使用(棕色文本)或\newenvironment(绿色文本)而不是\NewDocumentEnvironment (蓝色文本),或者使用 TeXLive2011,一切就都可以正常工作:

在此处输入图片描述

由于这似乎是一个非常基本的例子,我认为我的 TeXLive2012 仍然以某种方式损坏,就像我之前的问题一样:

问题:

只有我一个人遇到这个问题吗?如果是这样,有人可以看看\listfiles并告诉我是否有问题吗?

在旁边:

  • 影响垂直对齐的问题是否是\color{}已知问题?尝试注释掉\color{}自定义环境的任何定义中的 ,以了解我的意思。如果这需要单独的问题,我很乐意发布一个。

代码:

\documentclass{article}

\usepackage{xcolor}% To highilight the suprious text.
\usepackage{xparse}
\usepackage{environ}
\usepackage{showframe}


%% This is OK ONLY in TeXLive2011, NOT TeXLive2012  .
%%
%% With TeXLive2012, this produces supurious text in
%% the output containing the name of this environment.
\NewDocumentEnvironment{MyMinipageX}{%
    O{c}%
    G{0.50}%
    }{%
    \begin{minipage}[#1]{#2\linewidth}%
    \color{blue}%
}{%
    \end{minipage}%
    \ignorespacesafterend%
}{}%


%% This is OK in both TeXLive2011 and TeXLive2012.
\NewEnviron{MyMinipageY}[2][c]{%
    \begin{minipage}[#1]{#2\linewidth}%
        \color{brown}%
        \BODY%
    \end{minipage}%
    \ignorespacesafterend%
}%

%% This is OK in both TeXLive2011 and TeXLive2012.
\newenvironment{MyMinipageZ}[2][c]{%
    \begin{minipage}[#1]{#2\linewidth}%
    \color{green}%
}{%
    \end{minipage}%
    \ignorespacesafterend%
}%


\listfiles

\begin{document}
\color{red}% So that any spurious text is highlighted

% -------------------------- \NewDocumentEnvironment
\begin{MyMinipageX}[t]{0.10}
    A
\end{MyMinipageX}
\begin{MyMinipageX}[t]{0.10}
    B
\end{MyMinipageX}

% -------------------------- \NewEnviron
\begin{MyMinipageY}[t]{0.10}
    C
\end{MyMinipageY}
\begin{MyMinipageY}[t]{0.10}
    D
\end{MyMinipageY}

% -------------------------- \newenvironment
\begin{MyMinipageZ}[t]{0.10}
    E
\end{MyMinipageZ}
\begin{MyMinipageZ}[t]{0.10}
    F
\end{MyMinipageZ}
\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)
  xcolor.sty    2007/01/21 v2.11 LaTeX color extensions (UK)
   color.cfg    2007/01/18 v1.5 color configuration of teTeX/TeXLive
  pdftex.def    2011/05/27 v0.06d Graphics/color for pdfTeX
infwarerr.sty    2010/04/08 v1.3 Providing info/warning/error messages (HO)
 ltxcmds.sty    2011/11/09 v1.22 LaTeX kernel commands for general use (HO)
  xparse.sty    2012/08/14 v4091 L3 Experimental document command parser
   expl3.sty    2012/08/14 v4091 L3 Experimental code bundle wrapper
 l3names.sty    2012/07/16 v3990 L3 Namespace for primitives
l3bootstrap.sty    2012/07/16 v3991 L3 Experimental bootstrap code
    etex.sty    1998/03/26 v2.0 eTeX basic definition package (PEB)
l3basics.sty    2012/08/08 v4069 L3 Basic definitions
 l3expan.sty    2012/08/10 v4073 L3 Argument expansion
    l3tl.sty    2012/07/16 v3991 L3 Token lists
   l3seq.sty    2012/07/16 v3991 L3 Sequences and stacks
   l3int.sty    2012/07/16 v3991 L3 Integers
 l3quark.sty    2012/08/08 v4065 L3 Quarks
   l3prg.sty    2012/08/08 v4061 L3 Control structures
 l3clist.sty    2012/07/16 v3991 L3 Comma separated lists
 l3token.sty    2012/08/08 v4069 L3 Experimental token manipulation
  l3prop.sty    2012/07/16 v3991 L3 Property lists
   l3msg.sty    2012/08/10 v4077 L3 Messages
  l3file.sty    2012/08/08 v4059 L3 File and I/O operations
  l3skip.sty    2012/07/16 v3991 L3 Dimensions and skips
  l3keys.sty    2012/07/16 v3991 L3 Experimental key-value interfaces
    l3fp.sty    2012/08/14 v4089 L3 Floating points
   l3box.sty    2012/07/16 v3991 L3 Experimental boxes
l3coffins.sty    2012/07/20 v4011 L3 Coffin code layer
 l3color.sty    2012/07/16 v3991 L3 Experimental colour support
l3luatex.sty    2012/08/03 v4049 L3 Experimental LuaTeX-specific functions
l3candidates.sty    2012/05/12 v3633 L3 Experimental additions to l3kernel
showframe.sty    2011/02/24 v0.1i showframe (new impl., RN)
 eso-pic.sty    2010/10/06 v2.0c eso-pic (RN)
atbegshi.sty    2011/10/05 v1.16 At begin shipout hook (HO)
   ifpdf.sty    2011/01/30 v2.3 Provides the ifpdf switch (HO)
  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
pdftexcmds.sty    2011/11/29 v0.20 Utility functions of pdfTeX for LuaTeX (HO)
ifluatex.sty    2010/03/01 v1.3 Provides the ifluatex switch (HO)
epstopdf-base.sty    2010/02/09 v2.5 Base part for package epstopdf
  grfext.sty    2010/08/19 v1.1 Manage graphics extensions (HO)
kvdefinekeys.sty    2011/04/07 v1.3 Define keys (HO)
kvoptions.sty    2011/06/30 v3.11 Key value format for package options (HO)
kvsetkeys.sty    2012/04/25 v1.16 Key value parser (HO)
etexcmds.sty    2011/02/16 v1.5 Avoid name clashes with e-TeX commands (HO)
epstopdf-sys.cfg    2010/07/13 v1.3 Configuration of (r)epstopdf for TeX Live
supp-pdf.mkii

相关内容