[Tex/LaTex] Writing French characters

accentseditorsfrenchtexmaker

This question is (almost) exactly the same as this one :
How to write directly French characters in Emacs and print them in LaTeX? You may read his question instead of mine, the only difference (I spotted) is that the OP uses Emacs and I use Windows Vista and Miktex. I have tried the proposed solution, but it doesn't work on my computer. Unfortunately, I can't post comments below the answer.

I am using Miktex (on Windows Vista) which I only recently downloaded ("complete" version). I have encountered problems with special characters. I can't write é,è,à… directly on my keyboard, instead I have to write \'e, \`e, \`a etc which is very cumbersome.

I am really ignorant when it comes to computers and software, I hope somebody can help me resolve this issue!

EDIT : I am using Texmaker. Also, I downloaded the complete Miktex from a french university but didn't get any further packages. Is the package babel included in the "complete Miktex" download?

Finally, when I say the proposed solution doesn't work

Best Answer

The problem is that TeXmaker seems to encode the files in Latin-1 instead of UTF-8. Latin-1 is an obsolete encoding standard, but there is still a lot of software that hasn't switched to using Unicode yet.

If you use

\usepackage[utf8]{inputenc}

then LaTeX obviously gets confused when the file is actually encoded in Latin-1.

You have two options:

  1. Configure TeXmaker to use UTF-8: in Options → Configure TeXmaker → Editor set “Editor Font Encoding” to UTF-8 (thanks, @Torbjorn).
  2. You can use

     \usepackage[latin1]{inputenc}
    

    instead.

Going forward I'd recommend the first option as UTF-8 is what more and more software is going to use (as it solves a lot of long-standing problems). But the second option is certainly a fast workaround for existing files. Alternatively there are of course many other editors that use UTF-8 by default.

Related Question