[Tex/LaTex] Unicode characters not displaying in XeTeX

unicodexetex

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?

Best Answer

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 α}