[Tex/LaTex] harvard-thesis template and error using bm package

errorstemplates

I have a following problem. I use harvard-thesis package to write my thesis and I have a problem, when I want to use a package bm. Here is a minimal example. Using this code:

%!TEX TS-program = xelatex
%!TEX encoding = UTF-8 Unicode

\documentclass{harvard-thesis}

\usepackage{amssymb, amsthm}
\usepackage{graphicx,xspace}
\usepackage{bm}
\usepackage{epsfig}
\usepackage{enumitem}
\usepackage{xcolor}
\usepackage{gensymb}
\usepackage{todonotes}
\newcommand{\todoMaciej}[1]{\todo[color=red!40]{\textsc{Maciej} says: #1}}
\newcommand{\todoPiotr}[1]{\todo[color=blue!40]{\textsc{Piotr} says: #1}}


\usepackage{tikz}
\usetikzlibrary{decorations,calc,through}
\usetikzlibrary{decorations.pathmorphing}
\usetikzlibrary{decorations.pathreplacing}



\usepackage{hyperref}


\begin{document}

$\bm{\alpha}$

\end{document}

I obtain a following error:

./thesis.tex:113 Undefined control sequence.
\Call@AtVeryEndDocument ...cumentHook \@undefined
                                                  \global \let \Call@AtVeryE...
l.113 $\bm{\alpha}
                  $
?

This error occurs with both LaTeX and XeLaTeX. I use as an editor TeXShop. Template I use can be found here.

Best Answer

Your example isn't very minimal, I found a harvard-thesis class file on github, but it used other non standard packages and fonts I haven't got so I couldn't really run it.

However the main thing I think causing the problem is

\RequirePackage{mathspec}

I haven't looked at mathspec at all but I have looked at unicode-math and bm is largely incompatible with the extended math primitives in xelatex and luatex.

I have an extended version half finished that mostly works with xetex, but it still generated an error on your document.

If you are using unicode math fonts that have the math alphabet blocks (eg STIX, Cambria Math,..) Then you don't really need bm at all you can access bold alpha directly as unicode character U+1D6C2 (𝛂)

Related Question