From a6245664998d01f3d861b64a3df3a6e429d1a049 Mon Sep 17 00:00:00 2001
From: Karl Berry <karl@freefriends.org>
Date: Wed, 14 Apr 2010 00:26:30 +0000
Subject: docmute 1.2 (13apr10)

git-svn-id: svn://tug.org/texlive/trunk@17851 c570f23f-e606-0410-a88d-b1316a301751
---
 Master/texmf-dist/tex/latex/docmute/docmute.sty | 40 ++++++++++++-------------
 1 file changed, 20 insertions(+), 20 deletions(-)

(limited to 'Master/texmf-dist/tex/latex/docmute/docmute.sty')

diff --git a/Master/texmf-dist/tex/latex/docmute/docmute.sty b/Master/texmf-dist/tex/latex/docmute/docmute.sty
index 644178c3862..5bbaf7cd1a4 100644
--- a/Master/texmf-dist/tex/latex/docmute/docmute.sty
+++ b/Master/texmf-dist/tex/latex/docmute/docmute.sty
@@ -1,38 +1,38 @@
 \NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{docmute}[2009/10/08 v1.1 Input standalone documents]
+\ProvidesPackage{docmute}[2010/04/12 v1.2 Input stand-alone documents]
 \def\docmute@docenv{document}
 \long\def\docmute@gobblepreamble#1\begin#2{%
   \def\docmute@thisenv{#2}%
   \ifx\docmute@thisenv\docmute@docenv
-    \docmute@afterpreamble
+    \begin{document}%
   \else
     \expandafter\docmute@gobblepreamble
   \fi
 }
-\def\docmute@afterpreamble{%
-  \docmute@atbegindoc
-  \def\enddocument{%
-    \docmute@atenddoc
-    \aftergroup\ignorespaces
-    \endinput
-  }%
-  \ignorespaces
-}
 \let\docmute@document=\document
 \let\docmute@enddocument=\enddocument
-\let\docmute@atbegindoc=\relax
-\def\docmute@atenddoc{%
-  \let\enddocument=\docmute@enddocument
-  \begingroup
-}
 \let\docmute=\docmute@gobblepreamble
 \def\document{%
   \docmute@document
+  \countdef\docmute@nestinglevel=1
   \let\documentclass=\docmute
+  \renewenvironment{document}{%
+    \endgroup
+    \advance \docmute@nestinglevel 1%
+    \ignorespaces
+  }{%
+    \advance \docmute@nestinglevel -1%
+    \ifnum\docmute@nestinglevel=0
+      \docmute@enddocument
+    \else
+      \begingroup
+      \@ignoretrue
+      \def\@currenvir{document}%
+      \endinput
+    \fi
+  }%
   \ignorespaces
 }
-\DeclareOption{nested}{%
-  \let\docmute@atbegindoc=\begingroup
-  \let\docmute@atenddoc=\relax
-}
+\DeclareOption{nested}{}% for backwards compatibility only
 \ProcessOptions
+
-- 
cgit v1.2.3

