Take the 2-minute tour ×
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.

I am trying to get Unicode characters to compile into a PDF file using XeLaTeX. My MWE looks like this:

\documentclass[11pt]{article}
\begin{document}

Here is α, β, and finally γ.

\end{document}

When I compile to PDF I get

Here is , , and finally .

My Unicode characters do not show up. Could anyone point out my problem?

share|improve this question
add comment

1 Answer 1

up vote 12 down vote accepted

The default font, Computer Modern Roman, just does not have the glyphs for these Unicode characters. There are several possibilities to point out:

Math symbols

If the intended use of the characters is as shortcuts for \alpha, \beta, etc., then use the newunicodechar package:

\usepackage{newunicodechar}

\newunicodechar{α}{\alpha}
...

Internationalised typesetting

If you're looking to typeset a document (or part of a document) in the Greek language, use the polyglossia package:

\usepackage{polyglossia}

\setotherlanguage{greek}
\newfontfamily\greekfont[Script=Greek,Ligatures=TeX]{Times New Roman} % Has Greek characters

...

\begin{greek} ελληνικά \end{greek}

Random usage

If you need these characters for occasional use in the normal text, you can also use the fontspec package without polyglossia to load a font that has the glyphs. You can do it either globally (change the font altogether) or just for these characters:

\usepackage{fontspec}

\newfontfamily\timesfont[Ligatures=TeX]{Times New Roman}

...

The Greek letter alpha follows: {\timesfont α}
share|improve this answer
    
Concerning newunicodechar, is there a package that collects a large list of existing shortcuts, especially for mathematics and the occasional foreign symbol? –  Greg Graviton Apr 22 '12 at 12:53
2  
@GregGraviton: I had the same question. I made a package for that available on github: github.com/olivierverdier/Unixode –  Olivier Jun 15 '12 at 8:35
add comment

Your Answer

 
discard

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.