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 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?

share|improve this question

1 Answer 1

up vote 6 down vote accepted

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

share|improve this answer
1  
"J'accuse", great example :-) –  ℝaphink Aug 28 '11 at 5:38
1  
Additionally, XeTeX/LuaTeX manage unicode natively without any kind of settings. –  ℝaphink Aug 28 '11 at 5:38

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.