0

I have a LaTeX document where I use the packages mdframed and dblfnote that seem to fight each other. Whenever I compile, I get the (non critical) log message:

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

I searched many webpages to try to solve this problem. Many of them shows discussion about the very same message, but for different cases and with no clear explanation or workaround.

Can anyone explain me what's going on and how I proceed to vanish this error? Here is a piece of code as an example of the situation:

\documentclass{article}

\usepackage[a4paper,
                left=10mm, top=10mm, right=10mm, bottom=10mm,
                headheight=0mm, footskip=0mm, marginparsep=0mm, headsep=0mm,
                showframe]{geometry}

%-> Make footnote two-columns
\usepackage{dblfnote}
    \DFNalwaysdouble
    \DFNruleboth

%-> To create coloured boxes:
\usepackage[framemethod=tikz]{mdframed}

%-> Defining the environment for the COMMENTS:
\newenvironment{info}{%
    \begin{mdframed}[hidealllines=true,backgroundcolor=blue!10]
        \textbf{Obs.:}\par
    }{%
    \end{mdframed}%
    }

\usepackage{lipsum}


\begin{document}
\lipsum[1]

\textbf{%
Suppose here is one paragraph I write and add footnote comments\footnote{Comments like additional information which is important but not substantial for the text.} like more about some people. For instance, when I talk about Aristotle\footnote{384–322 BC, was an ancient Greek philosopher and scientist born in the city of Stagira, Chalkidiki, in the north of Classical Greece.} I add in footnote where and when he lived.%
}

\lipsum[2]

\begin{info}
    I like to add extra very important information in highlighted boxes.
\end{info}

\lipsum[3]

\end{document}
  • 1
    That is not an error or conflict, it is a warning telling you that one method one of the packages tried failed, so it is resorting to a different method. Does your document work? (not at pc so cannot check), it is works just ignore the warning. – daleif Jul 26 '18 at 17:44
  • 1
  • 2
    That is not always possible. We emit a similar warning in the memoir class whenever the caption package is used. The caption package provides more flexibility than base memoir, but it will only do its thing if the caption setup already provided is soli ar to the base classes. So if memoir detects caption, we reset caption macros to basic standards and warn the user that none of the memoir caption configuration macros will give any effect. I see it more as a courtesy to the user, instead of hiding stuff behind the users back. – daleif Jul 26 '18 at 17:59
  • 1
    What if at some point you need to hook into whatever thst aux hook is doing, then it is rather important to know that it is taking the atbegindocument route and not the redef document route. – daleif Jul 26 '18 at 18:00
  • 1
    @daleif dblfnote appears to have been minimally updated for 2e. (Absolutely minimally.) It really probably shouldn't be used. (It is certainly using macros it shouldn't be using with current LaTeX.) – cfr Jul 27 '18 at 2:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.