I found a conflict between bm an etoolbox because later one redefines \@@end. It happens when it patches \enddocument command.
Code from etoolbox:
\patchcmd\enddocument
{\deadcycles}
{\let\AfterEndDocument\@firstofone
\@afterenddocumenthook
\deadcycles}
{}
{\let\etb@@end\@@end
\def\@@end{%
\let\AfterEndDocument\@firstofone
\@afterenddocumenthook
\etb@@end}}
bm package expects that \@@end will be from latex.ltx Shouldn't etoolbox redefine \@@end only on \enddocument (if \patch\enddocument failed)?
Example with the problem:
\documentclass{article}
\makeatletter
\let\saved@enddocument\enddocument
\def\enddocument{\saved@enddocument}
\makeatother
\usepackage{bm}
\usepackage{etoolbox}
\begin{document}
$\boldsymbol{\sigma}$
\end{document}
Can it be fixed in TL1015?
\enddocumentso thatetoolboxcan't patch it, leaving the 'fall back' of redefining\@@endas the only way to add a hook. It's not at all clear to me why you'd want to force this. – Joseph Wright Mar 19 '15 at 08:16\enddocumentjust to show the problem. You can find a lot of\def\enddocumentdefinitions in TL distributions latex packages. And one of them raised me that problem. – Linuxss Mar 19 '15 at 09:06etoolboxfrom a period of there being no maintainer!) – Joseph Wright Mar 19 '15 at 09:23\AtEndDocument, but this won't work if the class has redefined\enddocumentin some fancy way. – egreg Mar 19 '15 at 09:28\enddocumentdefinitions still honour\AtEndDocument. See also David's comments in chat about\@@end. – Joseph Wright Mar 19 '15 at 09:30\outer\def\bm@end{\noexpand\noexpand\@@end}after loading bm (inside\makeatletter..) – David Carlisle Mar 19 '15 at 10:06