# Auxhook warning cannot patch document using AtBeginDocument instead

I'm using subfiles within my report (written on sharelatex), when I compile a subfile it produces a warning. Am I doing something wrong or is this normal?

Example

\documentclass[report.tex]{subfiles}
% \usepackage{acronym}
\begin{document}

some text

\end{document}


## Error

/usr/local/texlive/2015/texmf-dist/tex/latex/oberdiek/auxhook.sty Package auxhook Warning: Cannot patch \document, using \AtBeginDocument instead.

When I compile the main document it does not produce this warning.

The raw log file produces this warning

...... Package: auxhook 2011/03/04 v1.3 Hooks for auxiliary files (HO) Package auxhook Warning: Cannot patch \document, (auxhook) using \AtBeginDocument instead. ) (/usr/local/texlive/2015/texmf-dist/tex/latex/oberdiek/kvoptions.sty Package: kvoptions 2011/06/30 v3.11 Key value format for package options (HO) ....

## Packages

I'm using the following packages:

\documentclass[whitelogo]{tudelft-report}
% Used for referencing
\usepackage{natbib}
% For writing remarks in the text (is this going to be used?)
\usepackage{changes}
% used to write and render different subfiles
\usepackage{subfiles}
% used to draw boxed problems
\usepackage{mdframed}
% for subcaptions in combined figures
\usepackage{subcaption}
% used for Epigraphs of course
\usepackage{epigraph}
\usepackage{hyperref}
% used to display pictures
\usepackage{graphicx}
% used to add urls with strange symbols
\usepackage{grffile}
% used for H command in figures
\usepackage{float}
% used for tickz pictures (Causes a warning)
%\usepackage{pgfplots}
%used for the acronym page [printonlyused,withpage] are options
\usepackage{acronym}

% ######################### open section for code appendix #######################
\usepackage[utf8]{inputenc}
\usepackage{listings}
\usepackage{color}
\definecolor{codegreen}{rgb}{0,0.6,0}
\definecolor{codegray}{rgb}{0.5,0.5,0.5}
\definecolor{codepurple}{rgb}{0.58,0,0.82}
\definecolor{backcolour}{rgb}{0.95,0.95,0.92}

• I don't see your error but any file with \documentclass[report]{subfiles} shouldn't have a preamble. (Subfile uses the preamble from report.tex in any "subfile".) The line \usepackage{acronym} should be in report.tex. Try moving your preamble into the main file and see if this fixes the problem. – Andrew Aug 17 '16 at 11:36
• @Andrew Thanks for the reply! Moving the package did not solve it unfortunately. However beginning a blank project indeed does not produce this error indeed. Did not thought of that. I use the TU Delft latex report template which has some lay out already configured. It seems auxhook is being called as a package (although I cannot see where) and produces this warning. I included the raw error log in my main question for clarity. – YouKnowWho Aug 17 '16 at 12:08

Package auxhook Warning: Cannot patch \document, (auxhook) using \AtBeginDocument instead.

My typical use case for package auxhook is that I am using it to provide definition of macros at the begin of the .aux files, before they are used:
• This avoids trouble, if a .aux file is read by another document.
• Also the removal of a package does not invalidate the .aux files because of undefined commands.