[Tex/LaTex] LaTeX does not print words correctly: inputenc/fontenc problem

font-encodingsinput-encodings

I'm using a MacBook Pro and TeXShop. I am writing a philosophy thesis and fairly new to LaTeX.

In my preamble I have put

\documentclass[a4paper,12pt]{article}
\linespread{1.5}
\usepackage[francais,english]{babel} 
\usepackage[utf8]{inputenc} 
\usepackage[T1]{fontenc} 
\usepackage[round]{natbib}
\usepackage{epigraph}
\usepackage{makeidx}
\usepackage{url}
\usepackage{color}
\usepackage[colorlinks=true, pdfstartview=FitV, linkcolor=blue, citecolor=blue, urlcolor=blue]{hyperref}
\usepackage[nottoc]{tocbibind}
\setcounter{tocdepth}{12}
\usepackage{eurosym}
\usepackage{ragged2e}
\begin{document}

 These earlier firms, were far more powerful; they commanded armies and fleets

\bibliographystyle{plainnat}
\bibliography{biblio.bib}
\printindex
\end{document}

However, in the pdf I get:
"These earlier rms, were far more powerful; they commanded armies and eets"

Also, I want to use french characters (i.e. é è ç ô ê, etc), but I still have to type
`e
and so on.

I have googled, and played a bit with [latin1] but don't find an answer; please help.

Best Answer

Don't use the and characters in the input, but write firms and fleets.

Also add the following "magic" line at the beginning of your file

% !TEX encoding = UTF-8 Unicode

This will ensure that TeXShop interprets your file as UTF-8.

If your text has already many instances of and , you can consider adding the following to your preamble:

\usepackage{newunicodechar}
\newunicodechar{fi}{fi}
\newunicodechar{fl}{fl}

but it's best to stick with normal input.

Accented characters will be treated correctly.

Here's an example:

% !TEX encoding = UTF-8 Unicode
\documentclass[a4paper,12pt]{article}
\linespread{1.5}
\usepackage[francais,english]{babel} 
\usepackage[utf8]{inputenc} 
\usepackage[T1]{fontenc} 
\usepackage[round]{natbib}
\usepackage{epigraph}
\usepackage{makeidx}
\usepackage{url}
\usepackage{color}
\usepackage[colorlinks=true, pdfstartview=FitV, linkcolor=blue, citecolor=blue, urlcolor=blue]{hyperref}
\usepackage[nottoc]{tocbibind}
\setcounter{tocdepth}{12}
\usepackage{eurosym}

\usepackage{newunicodechar}
\newunicodechar{fi}{fi}
\newunicodechar{fl}{fl}

\usepackage{ragged2e}

\begin{document}

 These earlier firms, were far more powerful; they commanded armies and fleets

 These earlier firms, were far more powerful; they commanded armies and fleets

 Garçon, été, l'Hôpital, Génève

\bibliographystyle{plainnat}
\bibliography{biblio.bib}
\printindex
\end{document}

enter image description here