2

Well, I open a document .tex that uses this preamble:

\documentclass[a4paper,11pt,twoside]{report}
\usepackage[brazil]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

and the font codification is UTF-8. The problem is that some, just some, words are not accentuated, and in the place of the accent, a question mark like this �, appears. Here are some examples:

Word on the document (wrong)              correct word
         n�mero                              número
        Estat�sticas                      estatísticas  

Is there any way to solve this problem without having to rewrite all the words?

5
  • 1
    Are you referring to the output generated when you compile the document, or the input contained within the .tex file when viewed in your editor? If it is the latter, which editor are you using?
    – Werner
    Nov 9, 2011 at 0:44
  • Could you copy and paste the words in question from your .tex file? If I compile a document with your preamble and the words taken from your "correct word" column, everything works fine.
    – Jake
    Nov 9, 2011 at 0:44
  • 1
    It seems that your editor is using an encoding different from utf8 (the encoding of your document). Please make sure that both encodings are the same. Nov 9, 2011 at 1:05
  • @Werner I am referring to the .tex as a input; it was not generated by me. I'm using TeXMaker, by TexLive. Nov 9, 2011 at 2:10
  • @Jake Well, as a matter of fact, the words that I pasted on the first column are from the .tex file. Nov 9, 2011 at 2:11

1 Answer 1

4

Texmaker (or any editor for that matter) should be configured in order to render the correct input, as well as the corresponding output. The following is taken from the Texmaker documentation:

1.1 Configuring the editor

Before compiling your first document, you must set the encoding used by the editor ("Configure Texmaker" -> "Editor" -> "Editor Font Encoding"). Then, you should use the same encoding in the preamble of yours TeX documents (example: \usepackage[latin]{inputenc}, if you use the "ISO-8859-1" encoding for the editor).

Note: while opening a file, you're warned if the document can't be decoded correctly with the default encoding and the program lets you choose an other encoding (without modifying the default encoding).

4
  • Thank you @Werner! Is the any way to convert a .tex file between encondings, or a encoding that accept more than one style os characters? Daily I use UTF8. Nov 9, 2011 at 2:48
  • 1
    I am not very familiar with input encodings, since I use TeXnicCenter that doesn't provide that functionality.
    – Werner
    Nov 9, 2011 at 2:52
  • 1
    As a matter of information, if the operational system used is ubuntu, the gedit can be used to convert between encodings; its just "save as" the document, and then choose the encoding. Nov 9, 2011 at 3:03
  • 1
    @Rodrigo: there's a command line program called iconv which converts text from one encoding to another encoding. It might be useful for a batch of files. :) Nov 9, 2011 at 10:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .