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.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to edit a exam using a template I found on internet (article using mathexam package) but since I have to use special characters of Brazilian portuguese (like á, à, ç, ã, õ, ô, â, ê) my final .pdf was not showing how I intended. The characters do not appear on the output, after compiling, by simply typing them on the code like I do in most of my other .tex documents (using babel and inputec packages).

But when I created a new .tex and was editing it to add on the current question, it finally worked. I think it must have something to do with codification of the file, but I have no idea how to change that option on the files.

What was actually happening?

In my documents I always use \usepackage[latin1]{inputenc}. How can I know if some file has different codification, and how to change it properly?

***I work on TeXnicCenter under WIN7 system.

Below is the example:

\usepackage[left=1in, right=1in, top=1in, bottom=1in]{geometry}

\ExamName{Simplificação de Raízes}


Coment with á é ã ç, ....}
   \item Calc something1.  
     \item $\frac{\sqrt{x+1} - 2}{x-3}$\answer
     \item $\frac{\sin(4x)}{8x}$\answer[1in plus 1fill]
   \item Calc something2 
      \[\lim_{x\rightarrow 2} x^5  -2x^2 + 4x + -7 = 0\]\noanswer[2.5in]
   \item Find...   
share|improve this question
most editors will (somehow) show you the file encoding but I do not know that one. However if the file is not latin1 it is probably UTF-8 so changing the inputenc option to [utf8] will probably fix it – David Carlisle May 17 '14 at 14:05
up vote 3 down vote accepted

If your posted example is saved as iso-8859-1 (latin1) it runs without error and produces the expected result.

If it is saved as UTF-8 it produces

enter image description here

Spurious accented A are a sure sign that the multi-byte UTF-8 characters are being interpreted as latin-1.

There are tools to convert back to latin1, but Unicode is the future, so possibly a better option is to tell LaTeX that you are using utf-8


Then your document works again

share|improve this answer

You also have to load:


or whatever font you please, provided it exists in T1 encoding, so as to ensure correct hyphenation of words with accented letters.

share|improve this answer
@David Carlisle: I once happened to get missing accented characters just because I had forgotten to load fontenc and lmodern, thereby using the default Computer Modern. Did something change in this respect more or less recently? – Bernard May 17 '14 at 15:19
@David Carlisle: !!! I don't understand what could have happened. Anyway, I'll modify my answer. – Bernard May 17 '14 at 17:03
+1 (deleted earlier comments:-) – David Carlisle May 17 '14 at 17:05

Your Answer


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.