The \listfiles
command will give the list of all loaded files (and therefore also packages) at the end of the .log
file, but how do I determine from inside LaTeX, whether package A was loaded before package B or vice versa?
[Tex/LaTex] How to determine in which order packages have been loaded
packages
Best Answer
You can access the list as a comma separated list of filenames in
\@filelist
If you need this check after
\begin{document}
use\listfiles
so LaTeX saves that information.\listfiles
doesto iterate over this list.
So for example you could define
then using this as:
will type out
if that is in fact the case.
As noted in the comments you might want to use different comand names in production code, also if the two
.sty
are removed from the test you can test other files such as class and def files that are listed by LaTeX, but would need to explicitly use the extension, so\test{marginnote.sty}{geometry.sty}