# -*- mode: Perl -*-
# /=====================================================================\ #
# |  subfiles.sty                                                       | #
# | Implementation for LaTeXML                                          | #
# |=====================================================================| #
# | Part of LaTeXML:                                                    | #
# |  Public domain software, produced as part of work done by the       | #
# |  United States Government & not subject to copyright in the US.     | #
# |---------------------------------------------------------------------| #
# | Bruce Miller <bruce.miller@nist.gov>                        #_#     | #
# | http://dlmf.nist.gov/LaTeXML/                              (o o)    | #
# \=========================================================ooo==U==ooo=/ #
package LaTeXML::Package::Pool;
use strict;
use warnings;
use LaTeXML::Package;

#======================================================================
# Redefine \documentclass to do nothing
DefMacro('\documentclass OptionalSemiverbatim SkipSpaces Semiverbatim []', undef);
# And {document} environment likewise, but only after the main document starts.
AtBeginDocument(sub {
    DefEnvironment('{document}', "#body", beforeDigest => sub {
        AssignValue(inPreamble => 0);
        return; });
});
# Define \subfiles to be \input
Let('\subfile', '\input');

# And that's it!
#======================================================================
1;
