I was getting some error while trying to compile my document and after a lot of searching, I found out the [solution] (though not the reason) - while using both packages apacite and hyperref, I must put \usepackage{hyperref} before \usepackage{apacite}.

My question is: how to know in which order I should include the packages? Is there some generic list/ rule of thumb about some common packages?

Also, why the order of packages matter for latex?


1 Answer 1


For the commonly used packages, the documentation of the packages should list any such requirements.

The order matters as soon as two packages change or create the same macro, or one of them changes a macro the other relies upon on loading/setup.

Sometimes that means you cannot use those two packages together, sometimes you have to decide which comes first, and sometimes you need to load them in a particular order (as with hyperref).

In the link provided by Werner the answers mention some packages that can help with ordering the packages, and list some of the known incompatibilities. Keep an eye on the date of the answers/comments though.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .