I’ve found out that I can exclude parts of a wiki page from being exported into pdf for the normal process. From https://www.xwiki.org/xwiki/bin/view/FAQ/How%20to%20exclude%20some%20content%20from%20PDF%20export
Is there a similar method to remove the toc macro in latex? The velocitty code for the normal pdf export doesn’t work for latex.
All you need to do is provide an override that does nothing.
Now if you want to selectively ignore the toc macro depending on some conditions, it’s a bit more complex and one idea is to also override the toc macro template but instead of doing nothing, add an IF in it based on some condition. For example you could decide that the following syntax would ignore the toc when used:
Is it possible to override this for all pages? At the moment I have to hide all tocs during PDF export. (Even pages created by other users). Most people don’t even have permission to use a script macro. It would be useful to have a pdf export template with script support (before the pdf file is completely generated with the template, there is a script attached to the template that would allow me to go through all pages with Groovy and remove toc)