1

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

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

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.

9
  • 2
    Are you actually saving the file in UTF-8 encoding? Commented Oct 20, 2016 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
    Commented Oct 20, 2016 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
    Commented Oct 20, 2016 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. Commented Oct 20, 2016 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
    Commented Oct 20, 2016 at 23:36

0

You must log in to answer this question.

Browse other questions tagged .