From edff6978ed8be78204ec233620efc63086eedf27 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sun, 11 Oct 2009 00:13:29 +0000 Subject: new latex package docmute (10oct09) git-svn-id: svn://tug.org/texlive/trunk@15754 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/latex/docmute/docmute.sty | 38 +++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 Master/texmf-dist/tex/latex/docmute/docmute.sty (limited to 'Master/texmf-dist/tex/latex/docmute') diff --git a/Master/texmf-dist/tex/latex/docmute/docmute.sty b/Master/texmf-dist/tex/latex/docmute/docmute.sty new file mode 100644 index 00000000000..644178c3862 --- /dev/null +++ b/Master/texmf-dist/tex/latex/docmute/docmute.sty @@ -0,0 +1,38 @@ +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{docmute}[2009/10/08 v1.1 Input standalone documents] +\def\docmute@docenv{document} +\long\def\docmute@gobblepreamble#1\begin#2{% + \def\docmute@thisenv{#2}% + \ifx\docmute@thisenv\docmute@docenv + \docmute@afterpreamble + \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 + \let\documentclass=\docmute + \ignorespaces +} +\DeclareOption{nested}{% + \let\docmute@atbegindoc=\begingroup + \let\docmute@atenddoc=\relax +} +\ProcessOptions -- cgit v1.2.3