LaTeX forum ⇒ Texmaker and TeXstudioTroubles with accents in LaTeX

Information and discussion about Texmaker, an integrated LaTeX environment for several platforms, and the related TeXstudio
Wheatley
Posts: 1
Joined: Tue Dec 30, 2014 2:45 pm

Troubles with accents in LaTeX

Postby Wheatley » Tue Dec 30, 2014 2:56 pm

Hi, I am using Texmaker 4.4 and Texlive under Ubuntu 14.10 with Unity and I am dealing with some problems with accents (I am Spanish, I need accents).

1. It took me a couple hours but I think accents are now compiling. I was getting some errors when trying to compile and in the final PDF file strange characters were appearing instead of á, é, í and so on.

2. Now my problem is that I am writing on Texmaker and suddenly it starts to write ´a, ´e, ´i... instead of á, é, í...

I googled it and I found some solutions that seem to be useless for me. I have already installed ibus-qt4, I have configured UTF-8 as my encoding and I have these packaged in my LaTeX document (which is compiling right now):
  1. \usepackage{lmodern}
  2. %\usepackage[T1]{fontenc}
  3. \usepackage{amsmath}
  4. \usepackage{amsfonts}
  5. \usepackage{amssymb}
  6. \usepackage[spanish, activeacute]{babel}
  7. \usepackage{mathtools}
  8. \usepackage{graphicx}
  9. \usepackage{float}


Any solution for problem 2? Thanks a lot!
Last edited by Stefan Kottwitz on Tue Dec 30, 2014 3:42 pm, edited 1 time in total.
Reason: inline code changed to code block

Tags:

Ball000
Posts: 2
Joined: Mon Mar 02, 2015 12:37 pm

Postby Ball000 » Wed Mar 04, 2015 10:19 am

Hello, this is my first post on this board, I thought I may drop a line about your problem.

It's related to encodings and the way engines deal with it. Some of them, like XeLaTeX and luaLaTeX (IIRC) don't require you to explicitly say \usepackage[utf8x]{inputenc} (as they wouldn't use 7 bits encodings anyway), but other engines do require it. You didn't mention your engine though.
And if your whole system isn't utf8 (look at the output of the command "locale" in the terminal), you may even have to say \usepackage{ucs}

And you commented out the \usepackage[T1]{fontenc} line: are you sure about it? Your problem could also come from there. I too need to deal with accents (French) and I have this line on my files, IIRC it ensures that the diacritics in fonts are used (mandatory even for hyphening accentuated words in French).

User avatar
Stefan Kottwitz
Site Admin
Posts: 9501
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Wed Mar 04, 2015 10:58 am

Hi Ball000,

welcome to the forum!

Great that you answer a still open question. It can also help anybody who arrives here via google.

So, also some additions by me. :-)

Yes, XeLaTeX and LuaLaTeX use UTF-8 by default. With pdfLaTeX and inputenc, I would prefer utf8 over utf8x, the latter is different but not simply extended. utf8x is a useful alternative for Asian languages. I read it in the inputenc manual, 1.2 UTF-8 encoding support. Ubuntu should use UTF-8, so utf8 should be a safe choice.

Also support to activate \usepackage[T1]{fontenc} for having the accented glyphs.

Stefan
Site admin


Return to “Texmaker and TeXstudio”

Who is online

Users browsing this forum: No registered users and 2 guests