Editor's note:

This question addresses a specific case of UTF-8 character not working in LaTeX documents. Refer to Entering Unicode characters in LaTeX for other cases.

It's probably a stupid question, but I cannot find any easy answers online, and the answers are sometimes contradictory.

I am writing a document that uses a few strange alphabets. I want to use some LaTeX variant for typesetting, but nothing works. For example, if I take this document with four example words (one in Russian, one in Czech, one in latin with length indication, one in Vietnamese)


Днепр kůň dominī Ngữ

and put it through xelatex, which people recommend for Unicode, all I get is this

k domin Ng

which is not exactly what I want.

What is the easiest way of putting UTF-8 encoded file on one side and getting actual text on the other side?


To add more information.

I am using Ubuntu operating system, and I want to use some font appropriate for a bigger thesis (something like Computer Modern is fine, although I personally prefer Palatino-style fonts)

  • 3
    With xelatex you don't load inputenc; but you must load fontspec and use a font that has the required glyphs.
    – egreg
    Apr 19, 2014 at 22:30
  • ....OK, sorry it sounds stupid, but what does it actually mean? What fonts do I need (and how do I get them), and what language should I specify if I use more of them in the same document? Apr 19, 2014 at 22:31
  • Instead of saying \usepackage[utf8]{inputenc}, say \usepackage{fontspec}\setmainfont{Arial Unicode}, for example. Apr 19, 2014 at 22:35
  • I will add that I use ubuntu and apt packages (I will add it to the question) Apr 19, 2014 at 22:35
  • 1
    Does this answer your question? Is there any reason to use inputenc? Jun 2, 2022 at 14:54

2 Answers 2


You can use XeLaTeX, but inputenc shouldn't be loaded. Instead use fontspec and define a font that has the required glyphs.

Say you have installed the XITS fonts on your system; then you can do



Днепр kůň dominī Ngữ

If the font is not installed on the system, it's still possible to use it (you need a full TeX Live)



Днепр kůň dominī Ngữ

Another easy choice is Linux Libertine:


\usepackage{libertine} % also loads fontspec

Днепр kůň dominī Ngữ

enter image description here

For getting real multilingual support, you still need either Polyglossia or babel.

  • sorry, where could I found fontspec.spe for tex? Jan 27, 2015 at 16:46
  • @МалъСкрылевъ Not sure to understand.
    – egreg
    Jan 27, 2015 at 17:05
  • @egreg I meant, in my linux installation the file fontspec.spe is absent. So I have to know where is the file is resided. Jan 27, 2015 at 17:11
  • @МалъСкрылевъ I've never heard about fontspec.spe.
    – egreg
    Jan 27, 2015 at 17:12
  • o, sorry, fontspec.sty Jan 27, 2015 at 19:14

I don't use Ubuntu but Ubuntu should provide a package for Linux Libertine (if it is not installed by default) and that supports all of the languages:

Linux Libertine O


\setmainfont{Linux Libertine O}

Днепр kůň dominī Ngữ

To figure out which fonts were installed, I looked in /usr/share/fonts and paid particular attention to the opentype fonts there. I discovered a directory /usr/share/fonts/otf-linux-libertine-ibx/ which contained, for example, /usr/share/fonts/otf-linux-libertine-ibx/LinLibertine_R.otf. Yours will more likely be something like /usr/share/fonts/opentype/LinLibertine-R.otf.

To get basic information about the font, including the name to feed to fontspec:

otfinfo -i /usr/share/fonts/otf-linux-libertine-ibx/LinLibertine_R.otf 

which produced:

Family:              Linux Libertine O
Subfamily:           Regular
Full name:           Linux Libertine O
PostScript name:     LinLibertineO
Version:             Version 5.3.0 
Unique ID:           FontForge 2.0 : Linux Libertine O : 2-7-2012
Designer:            Philipp H. Poll
Designer URL:        http://www.linuxlibertine.org
Manufacturer:        Philipp H. Poll
Vendor URL:          http://www.linuxlibertine.org
Copyright:           Linux Libertine by Philipp H. Poll,
Open Font under Terms of following Free Software Licenses:
GPL (General Public License) with font-exception and OFL (Open Font License).
Created with FontForge (http://fontforge.sf.net)
Sept 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011,2012
License URL:         http://www.fsf.org/licenses/gpl.html AND http://scripts.sil.org/OFL
License Description: GPL- General Public License AND OFL-Open Font License
Vendor ID:           PfEd

To check which scripts (alphabets) the font supports:

otfinfo -s /usr/share/fonts/otf-linux-libertine-ibx/LinLibertine_R.otf 

which gave me:

DFLT            Default
cyrl            Cyrillic
cyrl.SRB        Cyrillic/Serbian
grek            Greek
hebr            Hebrew
latn            Latin
latn.AZE        Latin/Azeri
latn.CRT        Latin/Crimean Tatar
latn.DEU        Latin/German
latn.MOL        Latin/Moldavian
latn.ROM        Latin/Romanian
latn.TRK        Latin/Turkish
math            Mathematical Alphanumeric Symbols

To typeset the languages correctly, you will want to use either polyglossia or babel. It is probably better to try the former first but not all languages are supported. Read the documentation to figure out how to specify and call the languages you need. This will ensure that things like hyphenation are correctly tuned for each of the languages you use in the document.


For Linux Libertine specifically, you may be best off loading libertine as explained in egreg's answer. But if you would prefer to use a font you've got which doesn't have a TeX package, you can use the above method to figure out if it is likely to work and how to specify it to fontspec.

  • 1
    I have marked @egreg's answer, because the libertine package works the best in my case, but thanks for your answer too for all the info, it will be probably helpful too if I (or someone else looking at this question) will get into trouble later. Apr 19, 2014 at 22:48
  • 1
    Thanks @KarelBílek. I am pretty sure libertine does some other stuff so it is definitely best to use that in this case. My answer would be more useful if you wanted to use a system font for which there is not a (fontspec-aware) LaTeX support package. I really picked Libertine because I figured you'd be sure to either have it or have easy access to it via apt. So it made a good illustration of how to find stuff out and apply it (should you need or wish to do so.)
    – cfr
    Apr 19, 2014 at 23:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .