[Tex/LaTex] Should the fontenc package be loaded before or after font packages

font-encodingsfontsincompatibilitypackages

I seem to recall reading somewhere that fontenc should be loaded either before or after the packages loading fonts, but I cannot remember which. I don't see differences between loading it before and after. Was what I read incorrect, or is there a preferred package loading order and why?

Best Answer

fntguide is my standard go-to reference for these kinds of questions. Here's the entirety of what it has to say about the matter:

Warning: If you wish to use T1-encoded fonts other than the 'cmr' family then you may need to load the package (e.g. times) that selects the fonts before loading fontenc (this prevents the system from attempting to load any T1- encoded fonts from the `cmr' family).

In other words, there are no (non-pathological) dependencies in the load order that affect the final output. Compilation efficiency, however, might be less in one direction than the other. I used to load fonts then fontenc but, as I have never noticed a downside effect, solely for code tidiness, now lump it with my other encoding code before loading fonts.