2

I am editing LaTeX with Emacs. I would like to write in French. At the moment I have to write special French characters for instance like this: \'e prints é. If I write directly é in Emacs, the character will not be shown in the resulting pdf.

It seems that it is possible to write special characters directly in Emacs, which will be shown directly in the pdf. Does anyone know me how to this set up?

Caramdir
  • 89,023
  • 26
  • 255
  • 291
SoftTimur
  • 19,767

1 Answers1

7

To handle variety of input encodings used for different groups of languages (to be able to insert all the language-specific special characters directly from your keyboard instead of using macros) you can use the inputenc package:

\usepackage[<encoding>]{inputenc}

The declared <encoding> must be the same of your text editor, but most editors let you choose whichever encoding you like, so for example, if you prefer to use the utf8 encoding (Unicode), you can say:

\usepackage[utf8]{inputenc}

Furthermore, to overcome some shortcomings of the default LaTeX font encoding OT1, is a good idea to use the T1 encoding; this can be done by using

\usepackage[T1]{fontenc}

Additionally, to let LaTeX know how to hyphenate the language(s) you are using, to translate the predefined names, and to use language-specific typographic rules, you need the babel package.

So, in your specific case, you can use something like the following:

\documentclass{article}
\usepackage[frenchb]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\begin{document}

\section{J’accuse...!}
Puisqu'ils ont osé, j'oserai aussi, moi.  La vérité, je la dirai, car j'ai promis de la dire, 
si la justice, régulièrement saisie, ne la faisait pas, pleine et entière.  Mon devoir est de 
parler, je ne veux pas être complice.  Mes nuits seraient hantées par le spectre de l'innocent 
qui expie là-bas, dans la plus affreuse des tortures, un crime qu'il n'a pas commis. 

\end{document}

enter image description here

Caramdir
  • 89,023
  • 26
  • 255
  • 291
Gonzalo Medina
  • 505,128