summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/environ
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2013-04-01 22:50:52 +0000
committerKarl Berry <karl@freefriends.org>2013-04-01 22:50:52 +0000
commite6bf1654e9dcecdb03d8172c7493d45fc245783d (patch)
tree7b67b41c045e82359bc5160a0bceac9f53c21351 /Master/texmf-dist/tex/latex/environ
parentfa367f4e88a5506f3680d988fb0e0991f36b162e (diff)
environ (1apr13)
git-svn-id: svn://tug.org/texlive/trunk@29600 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/environ')
-rw-r--r--Master/texmf-dist/tex/latex/environ/environ.sty49
1 files changed, 8 insertions, 41 deletions
diff --git a/Master/texmf-dist/tex/latex/environ/environ.sty b/Master/texmf-dist/tex/latex/environ/environ.sty
index 6a576bf1a66..afecbd08338 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}[2008/06/18 v0.2 A new way to define environments]
+\ProvidesPackage{environ}[2013/04/01 v0.3 A new environment syntax]
+\RequirePackage{trimspaces}
\def\environbodyname#1{\def\env@BODY{#1}}
\environbodyname\BODY
\def\environfinalcode#1{%
@@ -19,18 +20,13 @@
\environfinalcode{\ignorespacesafterend}
\def\longdef@c#1{%
\expandafter\long\expandafter\def\csname#1\endcsname}
-\catcode`\Q=3
-\long\def\trim@spaces#1{\romannumeral-`\q\trim@trim@\noexpand#1Q Q}
-\long\def\trim@trim@#1 Q{\trim@trim@@#1Q}
-\long\def\trim@trim@@#1Q#2{#1}
-\catcode`\Q=11
\unless\ifdefined\collect@body
- \newtoks\@emptytoks
\newtoks\@envbody
\def\collect@body#1{%
\@envbody{\expandafter#1\expandafter{\the\@envbody}}%
\edef\process@envbody{\the\@envbody\noexpand\end{\@currenvir}}%
- \@envbody\@emptytoks \def\begin@stack{b}%
+ \@envbody={}%
+ \def\begin@stack{b}%
\begingroup
\expandafter\let\csname\@currenvir\endcsname\collect@@body
\edef\process@envbody{%
@@ -58,7 +54,8 @@
\long\def\Collect@Body#1{%
\@envbody{\expandafter#1\expandafter{\the\@envbody}}%
\edef\process@envbody{\the\@envbody\noexpand\end{\@currenvir}}%
- \@envbody\@emptytoks \def\begin@stack{b}%
+ \@envbody={}%
+ \def\begin@stack{b}%
\begingroup
\expandafter\let\csname\@currenvir\endcsname\Collect@@Body
\edef\process@envbody{%
@@ -111,7 +108,7 @@
\long\def\env@new#1#2#3[#4]{%
\env@newenvironment{#1}{%
\expandafter\Collect@Body\csname env@#1@parse\endcsname
- }{#4}
+ }{#4}%
\longdef@c{env@#1@parse}##1{%
\csname env@#1@save@env\endcsname##1\env@nil
\csname env@#1@process\endcsname##1\env@nil}%
@@ -124,38 +121,8 @@
\unexpanded\expandafter
\expandafter\expandafter{\trim@spaces{#1}}}}
\long\def\env@ignore#1\env@nil{}
-\newcommand\NewEnvironment{%
- \let\env@newenvironment\newenvironment
- \let\env@newcommand\newcommand
- \Make@Environment}
-\newcommand\RenewEnvironment{%
- \let\env@newenvironment\renewenvironment
- \let\env@newcommand\renewcommand
- \Make@Environment}
-\newcommand\Make@Environment[2]{%
- \expandafter\let\csname env@args@#1\endcsname\ignorespaces
- \env@newenvironment{#1}{%
- \expandafter\Collect@Body\csname env@@#1\endcsname}{\ignorespacesafterend}%
- \longdef@c{env@@#1}##1{%
- \csname env@@@#1\endcsname{%
- \csname env@args@#1\endcsname##1\unskip}}%
- \longdef@c{env@@@#1}##1{#2}}
-\newcommand\EnvironArgs[1]{%
- \@ifnextchar[
- {\Env@Args{#1}}
- {\Env@Args{#1}[0]}}
-\long\def\Env@Args#1[#2]{%
- \@ifnextchar[
- {\Env@@@Args{#1}[#2]}
- {\Env@@Args{#1}[#2]}}
-\long\def\Env@@Args#1[#2]#3{%
- \expandafter\renewcommand\csname env@args@#1\endcsname[#2]{%
- #3\ignorespaces}}
-\long\def\Env@@@Args#1[#2][#3]#4{%
- \expandafter\renewcommand\csname env@args@#1\endcsname[#2][#3]{%
- #4\ignorespaces}}
%%
-%% Copyright (C) 2007 by Will Robertson <wspr81@gmail.com>
+%% Copyright (C) 2007-2008, 2013 by Will Robertson <wspr81@gmail.com>
%%
%% Distributable under the LaTeX Project Public License,
%% version 1.3c or higher (your choice). The latest version of