blob: 644178c386241864e90f15f5376594a7e9cb9245 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
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
|