On 28/09/2023 19:31, Juan Manuel Macías wrote:
Starting with \documentclass, the order is important in certain cases
and not so important in others. And, anyway, you can always use a hook
like \AtBegin... \AtEnd..., etc.

I am judging from my past experience. Besides \usepackage{cmap} that was necessary to be put immediately after \documentclass, there were issues with order of \usepackage for hyperref and some other packages.

Custom commands may require some attention as well. There is an example of reusing year in .xmpdata and document title in the pdfx docs. Such cases may be more subtle. In the case of .xmpdata command must be defined at the moment when the file is loaded, so it is not important either command definition or \begin{filecontents*} placed first (.xmpdata may be provided directly as well). In the case of \DocumentMetadata it is not obvious if commands may defined later.

Reply via email to