Sign up ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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)

share|improve this question
With xelatex you don't load inputenc; but you must load fontspec and use a font that has the required glyphs. – egreg Apr 19 '14 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? – Karel Bílek Apr 19 '14 at 22:31
Instead of saying \usepackage[utf8]{inputenc}, say \usepackage{fontspec}\setmainfont{Arial Unicode}, for example. – Sean Allred Apr 19 '14 at 22:35
I will add that I use ubuntu and apt packages (I will add it to the question) – Karel Bílek Apr 19 '14 at 22:35
The fontspec package provides macros such as \setmainfont, with which you can select the font that should be used in the document. Do familiarize yourself with the user guide of the fontspec package. Just which font family, or families, you should use is hard to tell without more detailed knowledge of your typesetting needs. – Mico Apr 19 '14 at 22:36

2 Answers 2

up vote 8 down vote accepted

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.

share|improve this answer
The last thing worked perfectly! Thanks! – Karel Bílek Apr 19 '14 at 22:45
sorry, where could I found fontspec.spe for tex? – Малъ Скрылевъ Jan 27 at 16:46
@МалъСкрылевъ Not sure to understand. – egreg Jan 27 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 at 17:11
@МалъСкрылевъ I've never heard about fontspec.spe. – egreg Jan 27 at 17:12

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:
Manufacturer:        Philipp H. Poll
Vendor URL:
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 (
Sept 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011,2012
License URL: AND
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.

share|improve this answer
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. – Karel Bílek Apr 19 '14 at 22:48
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 '14 at 23:12

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.