Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

When I’m using pdfLaTeX, my preamble usually contains

\usepackage[utf8]{inputenc}

and

\usepackage[T1]{fontenc}

Should these two be loaded in any particular order? What problems could arise if they’re loaded in the “wrong” order?

On a related topic, I know that fontenc should come after font packages, as described in Should the fontenc package be loaded before or after font packages?, so I’d move font packages along with inputenc – unless there’s a catch as well, which would indicate something like
1) font package(s) 2) inputenc 3) fontenc?

share|improve this question

1 Answer 1

No the order doesn't matter as inputenc contains some code to avoid "order problems".

Some background: inputenc with option utf8 doesn't set up definitions for every unicode character as everyone knows who got once the message ! Package inputenc Error: Unicode char \u8:... not set up for use with LaTeX.

Instead it loads a .dfu for each font encoding declared by fontenc (naturally only if the dfu exists) so that there exist input definitions for the chars that can be printed with this font encodings.

fontenc puts all the font encodings it has been called with or which have been loaded by default in a list \cdp@list. inputenc process this list and loads the corresponding .dfu (e.g. T1.dfu) and then redefines \DeclareFontEncoding@ so that from now on every \DeclareFontEncoding will load the .dfu directly.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.