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.

As a native English speaker, I've mostly been allowed the luxury of pretending that ASCII is enough, and have been able to treat font encodings as not my problem. I've seen lots of advice that I ought to include \usepackage[T1]{fontenc} in my preamble. (See, for instance, p. 337 of The LaTeX Companion.) What isn't really adequately explained is why I ought to do so.

So, if I am writing in English and have to make only occasional use of things like G\"odel, what does following the advice really get me?

share|improve this question
6  
I checked what I had written on p.337 of the LaTeX Companion, but the advice there says "OT1 is not adviable for languages other than English" (so I acknowledged that you may pretend you write in ASCII :-). But in addition to that it also gives all the explanations like hyphenation not working etc. So I'm not sure why it isn't adequately explained. –  Frank Mittelbach Nov 26 '12 at 22:04
    
If you choose to include \usepackage[T1]{fontenc}, installing the cmssuper package may be necessary to ensure high quality PDFs. –  badroit Apr 17 at 19:04
add comment

2 Answers

up vote 181 down vote accepted

Note that this is font encoding (determines what kind of font is used), not input encoding.

The default font encoding (OT1) of TeX is 7-bit and uses fonts that have 128 glyphs, and so do not include the accented characters as individual glyphs. So a letter ö is made by adding an accent to the existing 'o' glyph.

The T1 font encoding is an 8-bit encoding and uses fonts that have 256 glyphs. So an 'ö' is an actual single glyph in the font. Many of the older fonts have had T1 variants devised for them as well, and many newer fonts are available only in T1. I think "Computer Modern" was originally OT1, and "Latin Modern" is T1. (Look at OT1 font encoding and T1 font encoding.)

If you don't use \usepackage[T1]{fontenc},

share|improve this answer
5  
Yes, hyphenation for languages with accented characters is the main reason that requires T1 font encoding. –  Jukka Suomela Jul 30 '10 at 18:58
4  
Yep, definitely load lmodern (or some other font package) when you use T1. –  Will Robertson Jul 31 '10 at 2:37
6  
The bigger problem is that without T1 you cannot copy/paste a name with a non-ascii glyph without getting them split up into their components. –  Christopher Oezbek Aug 13 '10 at 16:43
    
@Christopher: You will have the same problem even if you use T1 in combination with something like ae. –  Jukka Suomela Aug 15 '10 at 19:18
2  
@Jukka: I am not sure why you would still use the ae package. –  Christopher Oezbek Aug 22 '10 at 10:04
show 4 more comments

In addition to the reasons listed by @ShreevatsaR why the T1 font encoding is advisable even when writing (primarily) in the English language, there are two more reasons that were missing from his list:

  • TeX is only able to apply ligatures and kernings between characters when these characters are real glyphs from the same font. In OT1 (with 128 glyphs) you only have more or less ASCII characters and all diacritics etc are missing.

  • Searching in the output is not working whenever a diacritic character is being used as that ends up being a complicated box structure in the output and not a character.

So to stay with your example of the occasional G\"odel: if the font designer has decided that because of the shape of the G it needs some kerning to a following o or ö then he can specify this in T1 but not in OT1 (for the ö as that is not a single glyph in that font encoding). And there are a lot of kerning adjustments between characters.

The second point means that if somebody is searching through your papers (put up on the web as pdf's, for example) for the name Gödel, then the name wouldn't be found.

So in short the T1 fonts simply give slightly better output whenever there is a single diacritic char used, because kerning is better, hyphenation still works, cut-and-paste still works from the output and searching in the output works properly as well.

share|improve this answer
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.