I've been using LaTeX for a while and I've read a lot of discussion about fonts encodings.

Some suggest to use T1 fonts adding \usepackage[T1]{fontenc}, other suggest to add nothing, other suggest to use T1 in addition to the package ae while others say this is deprecated and another font should be used instead ...

I'm very confused, is there some updated resource that explains the issue well and settles the matter?

In my experience adding nothing works fine but sometimes i need additional character sets such as bold small caps, in this case I can use the T1 encoding but the quality is poor. Everything seems to be fixed if I use the ae or the lmodern packages. What's really happening and what should I really do?

PS: I'm sorry if this has been asked before, I've found a lot of discussion about this but I'm posting in the hope to get a definitive answer.

PPS: Currently I'm using latex + dvips + ps2pdf. I prefer to use pdflatex if I can but, as I work with other, this is not always possible.

  • 1
    There's a nice explanation what foontenc does in the following post (tex.stackexchange.com/questions/44694/fontenc-vs-inputenc?rq=1)
    – jjdb
    Apr 12, 2013 at 20:55
  • You might want to start with egregs answer to the related question tex.stackexchange.com/questions/44694/fontenc-vs-inputenc "poor quality" in a pdf usually means you have picked up a bitmap font which is OK for printing at a fixed size but does not scale, most modern fonts are available in scalable formats that allow pdf to be zoomed. lmodern set implements a good collection of the classic tex font styles but with more modern font technology so is a good place to start. Apr 12, 2013 at 20:58
  • What’s your goal? If you’re looking for a good setup for accented characters in Latin script, this question is a duplicate of Automatically change é to \'e – most convenient setup for accented letters?. I posted the setup there that I seems to be the best to me.
    – doncherry
    Apr 12, 2013 at 21:06
  • 3
    Don't use package ae, it is outdated. See l2tabu.
    – Mensch
    Apr 12, 2013 at 21:10
  • Hi thanks for all the comments. I'm looking a) to understand what's going on. b) for a way to have good quality fonts, possibily when using smallcaps+bold or other sets. Writing accented characters works fine for me, as I always use utf8 and \usepackage[utf8]{fontenc}.
    – Rev2
    Apr 12, 2013 at 21:34

2 Answers 2


The basic rule is: Try if you get better results using \usepackage[T1]{fontenc} in your document.

The explanation: when you write English text you can probably get by without this line and you will not experience any differences/difficulties in most situations.

When Knuth introduced TeX, he shipped it with the font called 'Computer Modern'. This font has only a very limited character set (compared with today's OpenType fonts). For example characters like 'ö' and 'ü' were not present. This does no harm if you don't typeset any languages that use these characters. But as soon as you have to render them, you can help by combining two dots '¨' on top of 'o' or 'u'. There is a TeX primitive for that: \accent. This has the side-effect of disabling hyphenation, which is not acceptable.

Thus one day TeX users came up with an agreement on how to encode fonts that can render most European languages (the T1 encoding). This encoding tells which code to put in the DVI or PDF file when the users requests an 'ö' or 'ü'. Now that these characters don't have to be composed by two glyphs anymore, they donn't break hyphenation.

Now why bother with T1 if you don't have these funny characters? When you prepare a font for LaTeX, you have to create font metric files (tfm). Since T1 is the most used encoding these days (in Europe for sure), some people don't bother anymore with non-T1 encodings and thus a font might not be available in the old and default OT1 encoding.

BUT: when you stick to Computer Modern, you might want to keep the old encoding (and not use T1), since the PostScript variant (which leads to better rendering results) is only available with the OT1 encoding. For T1 encoded Computer Modern (which you have to use when you need hyphenation in words with these special characters), you could use the ae package or change your font to cm-super (by not loading ae and changing the encoding to T1 - but I wouldn't want to do that). I strongly suggest to use the Computer Modern replacement called 'Latin Modern' which comes in several flavors (PostScript Type 1, OpenType fonts). Activate it by \usepackage{lmodern}.

  • Thank you. So, if I understand correctly, the way to go is T1 fonts + lmodern. That what I was using and it seems to be working fine.
    – Rev2
    Apr 13, 2013 at 14:15

A XeLaTeX alternative

The OP explicitly names LaTeX in the title of the question. There is a related compiler called XeLaTeX which is intended to handle foreign characters in a smoother way than LaTeX. I thought it would be useful to mention it here. I've been using it for a while to typeset French with great success. The following piece of code in the preamble will check whether XeLaTeX is being called and load programs accordingly.

In the code below, to be inserted within the preamble, I load the public domain font Libertine. This is just an illustration: in this case, setting the font with the setmainfont command options is quite tedious, so a specific package named libertine was created to make it easier to set the font.

\usepackage[oldstyle]{libertine}% public domain font % alternative to \setmainfont line commented out below
\usepackage{ifxetex}% load different packages with/without XeLaTex
    \usepackage{fontspec}% provides \setmainfont
    %\setmainfont[Numbers=OldStyle,Ligatures=Common,Mapping=tex-text]{Linux Libertine O}% public domain font % or use the libertine package instead
\else  % packages below are not needed with utf8 based engines

When I looked it up a while back, I found it to be a good combination (experts please correct me if I'm wrong). I'm not a XeLaTeX guru or anything, I just found that it helped me with my French texts a great deal and adopted it rather recently.

  • There is no point in loading libertine here, is there?
    – cfr
    Apr 25, 2016 at 11:06
  • this line was meant as an example of setting a font, which is usually done with the setmainfont command, but for the Libertine font there is a dedicated package that makes it easier to load.
    – PatrickT
    Apr 26, 2016 at 10:33
  • But don't you need to load it after fontspec? Or does it defer processing until begin document, for example? (It doesn't obviously do that - I had a quick look - but it is quite complex, so I'm not ruling it out.)
    – cfr
    Apr 26, 2016 at 11:50
  • @cfr That's a good question, I hadn't thought of it (scratches head), but I've just tested it (on a simple example) and the libertine package appears to work whether it's loaded at the start of the preamble or at the end.
    – PatrickT
    Apr 26, 2016 at 14:01
  • you can play around with this as I have to see for yourself: pastebin.com/n9GvHaix
    – PatrickT
    Apr 26, 2016 at 14:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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