I try to write with accents (spanish) but the pdf doesn't show any accented character. Here's my preamble:

\documentclass[11pt, spanish]{report}

On the one hand if select 'UTF8 encoding' the .tex doesn't compile. On the other hand, if I select, for example, 'latin1 encoding' the .tex does compile, but there are no accentuated characters in the pdf.

I also have some .tex files from years ago which compiled and wrote accents but not now.

  • 2
    Are you actually saving the file in UTF-8 encoding? – Herb Schulz Oct 20 '16 at 22:05
  • Yes, if I select 'Document' -> 'Character Encoding' -> 'UTF8' with this preamble doesn't compile. If I select another 'Latin1' does compile but without showing accentuated characters – user25578 Oct 20 '16 at 22:19
  • Exactly which editor are you using? Might be useful to know which OS you are using as well (some OSes has tools we can use to check files). It sounds like the file is actually being saved as latin1 by default. Most editors cannot change the chosen encoding (though some can) – daleif Oct 20 '16 at 22:24
  • 1
    The saved file encoding and the encoding declared in the inputenc option have to match you can use either encoding (or other encodings) as long as the option matches the actual encoding. – David Carlisle Oct 20 '16 at 22:24
  • I've already checked the actual encoding with the command 'file -bi filename.tex' and the result is UTF8. I actually removed the whole texlive and reinstalled but the problem remains.. – user25578 Oct 20 '16 at 23:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.