summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/environ
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2014-05-04 21:43:33 +0000
committerKarl Berry <karl@freefriends.org>2014-05-04 21:43:33 +0000
commitce474d87225a325bc73c84890b079a2a1b8a635c (patch)
treeddc5cfbd999829028662a8d8f804d5c5c6d6a80e /Master/texmf-dist/tex/latex/environ
parentc5ab811ed86fca6665ac80b83b72a714e7d93397 (diff)
environ (4may14)
git-svn-id: svn://tug.org/texlive/trunk@33821 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/environ')
-rw-r--r--Master/texmf-dist/tex/latex/environ/environ.sty27
1 files changed, 16 insertions, 11 deletions
diff --git a/Master/texmf-dist/tex/latex/environ/environ.sty b/Master/texmf-dist/tex/latex/environ/environ.sty
index afecbd08338..8cf854b9767 100644
--- a/Master/texmf-dist/tex/latex/environ/environ.sty
+++ b/Master/texmf-dist/tex/latex/environ/environ.sty
@@ -11,7 +11,8 @@
%%
%% License information appended.
%%
-\ProvidesPackage{environ}[2013/04/01 v0.3 A new environment syntax]
+%% ^^A Test that \RenewEnvironment works correctly:
+\ProvidesPackage{environ}[2014/05/04 v0.3 A new way to define environments]
\RequirePackage{trimspaces}
\def\environbodyname#1{\def\env@BODY{#1}}
\environbodyname\BODY
@@ -80,11 +81,9 @@
\fi
\process@envbody}
\def\NewEnviron{%
- \let\env@newcommand\newcommand
\let\env@newenvironment\newenvironment
\env@NewEnviron}
\def\RenewEnviron{%
- \let\env@newcommand\renewcommand
\let\env@newenvironment\renewenvironment
\env@NewEnviron}
\def\env@NewEnviron#1{%
@@ -106,23 +105,29 @@
\@temptokena\expandafter[\env@finalcode]%
}}
\long\def\env@new#1#2#3[#4]{%
+ \longdef@c{env@#1@BODY\expandafter}\expandafter{\env@BODY}%
\env@newenvironment{#1}{%
\expandafter\Collect@Body\csname env@#1@parse\endcsname
}{#4}%
\longdef@c{env@#1@parse}##1{%
\csname env@#1@save@env\endcsname##1\env@nil
\csname env@#1@process\endcsname##1\env@nil}%
- \expandafter\env@newcommand
- \csname env@#1@save@env\endcsname#2{\env@save}%
- \expandafter\env@newcommand
- \csname env@#1@process\endcsname#2{#3\env@ignore}}
-\long\def\env@save#1\env@nil{%
- \expandafter\edef\env@BODY{%
+ \expandafter\let\csname env@#1@save@env\endcsname\relax
+ \expandafter\let\csname env@#1@process\endcsname\relax
+ \expandafter\newcommand
+ \csname env@#1@save@env\endcsname#2{%
+ \expandafter\expandafter\expandafter
+ \env@save\csname env@#1@BODY\endcsname}%
+ \expandafter\newcommand
+ \csname env@#1@process\endcsname#2{#3\env@ignore}%
+}
+\long\def\env@save#1#2\env@nil{%
+ \edef#1{%
\unexpanded\expandafter
- \expandafter\expandafter{\trim@spaces{#1}}}}
+ \expandafter\expandafter{\trim@spaces{#2}}}}
\long\def\env@ignore#1\env@nil{}
%%
-%% Copyright (C) 2007-2008, 2013 by Will Robertson <wspr81@gmail.com>
+%% Copyright (C) 2007-2014 by Will Robertson <wspr81@gmail.com>
%%
%% Distributable under the LaTeX Project Public License,
%% version 1.3c or higher (your choice). The latest version of