Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using vim+LaTeX with Scandinavian characters

Tags:

vim

ubuntu

latex

I want to create a lab write-up with LaTeX in Ubuntu, however my text includes Scandinavian characters and at present I have to type them in using /"a and "/o etc. Is it possible to get the latex-compiler to read these special characters when they are typed in as is? Additionally, I would like vim to "read" Finnish: Now when I open a .tex-document containing Scandinavian characters, they are not displayed at all in vim. How can I correct this?

like image 324
Zequj Avatar asked Dec 30 '22 03:12

Zequj


2 Answers

For latex, use the inputenc option:

\usepackage[utf8]{inputenc}

Instead of utf8, you may use whatever else fits you, like latin1, as well.

Now the trick is to make your terminal run the same character encoding. It seems that it runs a character/input encoding that doesn't fit your input right now.

For this, refer to the "Locale" settings of your distribution. You can always check the locale settings in the terminal by issueing locale. These days, UTF8 locales are preferred as they work with every character imaginable. If your terminal's environment is set up correctly, vim should happily work with all your special characters without mourning.

like image 161
ypnos Avatar answered Jan 01 '23 16:01

ypnos


To find out in which encoding Vim thinks the document is, try:

:set enc

To set the encoding to UTF-8, try:

:set enc=utf8
like image 43
Kaarel Avatar answered Jan 01 '23 17:01

Kaarel