{\makeatletter
\newcount\LW@inputdepth\LW@inputdepth0\newcount\LW@lineno
\let\LW@begin\begin
\gdef\begin#1{\def\LW@envname{#1}\def\LW@document{document}
\ifx\LW@envname\LW@document%
\ifnum\LW@inputdepth=0\LW@lineno\inputlineno\fi
\wlog{Latex Watch: preamble length=\the\LW@lineno}\dump\fi\LW@begin{#1}}
\let\LW@IIFE\InputIfFileExists\def\InputIfFileExists#1#2{%
\ifnum\LW@inputdepth=0\LW@lineno\inputlineno\fi
\advance\LW@inputdepth by 1%
\LW@IIFE{#1}{#2}%
\advance\LW@inputdepth by -1}}