1

I seem to be getting spurious text (red text) containing the name of the environment, when using \NewDocumentEnvironment (blue text) to define a custom minipage environment with TeXLive2012:

enter image description here

Things work just fine if I use \NewEnviron (brown text), or \newenvironment (green text) instead of \NewDocumentEnvironment (blue text), or with TeXLive2011:

enter image description here

Since this seems to be a very basic example I am thinking that my TeXLive2012 is still corrupted somehow as per my earlier problem:

Question:

Am I the only one who is having this problem? If so can someone look thru the \listfiles and let me know if something is out of wack.

Aside:

  • Is the issue with the \color{} affecting vertical alignment a known issue? Try commenting out the \color{} in any of the definitions of the custom environments to see what I mean. If this warrants a separate question, I'd be happy to post one.

Code:

\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}

Output of \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
Peter Grill
  • 223,288

0 Answers0