XWIKI-10291: Formulas are not showing up in PDF documents if document is not public
* Implemented a hackish solution ATM so that I can merge it in the 5.4.x branch without introducing anything risky. The real fix is very complex and I've been working on it for a few days already. I hope I'll be able to get out of the rabbit hole and commit it at some point...