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.

I'm writing a Dutch / French document, so I defined

\usepackage[dutch,french,british]{babel} 

in my headers, but my french é is being shown as a weird Ãl’.

I tried changing the encoding in Texmaker from UTF-8 to UTF-16 and UTF-32BE but it doesn't do a whole lot.

Can anyone tell me what to do?

share|improve this question
10  
Use UTF-8, but add \usepackage[utf8]{inputenc} to your document. –  egreg Oct 18 '11 at 16:17
2  
or add \usepackage[utf8x]{inputenc} –  Alain Matthes Oct 18 '11 at 16:22
    
Welcome to TeX.sx! Usually, we don't put a greeting or a "thank you" in our posts. While this might seem strange at first, it is not a sign of lack of politeness, but rather part of our trying to keep everything very concise. Upvoting is the preferred way here to say "thank you" to users who helped you. –  doncherry Oct 18 '11 at 16:22
    
I wonder how you are creating your é? are you just using the symbol as is? –  aghsmith Oct 18 '11 at 16:44
1  
egreg if you post it as answer I will mark it :) –  Lucas Kauffman Oct 18 '11 at 17:10
show 2 more comments

1 Answer

up vote 9 down vote accepted

It's not only a question of selecting the correct UTF-8 encoding in the editor; this choice must be told also to LaTeX, which knows nothing about the editor program:

\usepackage[utf8]{inputenc}

should be declared. For best result in all circumstances, it is recommended to use the following pattern

\usepackage[<encodings>]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[<languages>]{babel}

particularly if among the <encodings> there is a cyrillic one (T2A, T2B or T2C). In your case only T1 is necessary:

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[dutch,french,british]{babel}

While the Font guide seems to say that font loading packages should be loaded before fontenc (see this answer) in my experiments it does not happen that LaTeX tries to load other fonts if the pattern is, say,

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[dutch,french,british]{babel}
\usepackage{lmodern}

Of course, if some text is typeset before loading lmodern (for instance, some length is set with \settowidth or similar commands), then the relevant .fd files will be loaded (and the measurement might be wrong if, instead of lmodern one loads kpfonts).

I recommend to follow this pattern (also adding other needed encodings) because in the case of languages written in the cyrillic font inputenc has to know what encodings are loaded. But this is justified also on other bases.

Let's look at the typesetting process as if it were carried on in an old typographer's shop. When a manuscript comes in, the typographer looks at it and goes to fetch the necessary cases: say T1 for the latin alphabet, T2A for the cyrillic letters and T3 for the IPA symbols. This is the fontenc step. Only after having put the cases on the working desk the typographer will start to examine the manuscript letter by letter and chose from one case or the other as told by the found letter (inputenc step). Then the letters will be put on the composition stick following the rules given by the current language (babel step).

share|improve this answer
    
Could you explain why this order / pattern gives the best results? related question: tex.stackexchange.com/questions/2859/… –  matth Nov 21 '11 at 13:33
    
@matth I've added a comment –  egreg Nov 21 '11 at 13:57
add comment

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.