Attempt to fix the toc not being generated... most actions moved to
footer. Still not working...