UFT8 inside the formula?

Is there a way I can use UFT8 (say greek chars) inside the formula?

For example I want latex to render:

$α$


as

$\alpha$


(actually the question comes from mathjax -- there You can do it, but now I need to use latex -- and I get issues with utf from pdftex).

-

If you don't want to depend on a specific compiler, you can use the newunicodechar package together with inputenc in the following way:

\documentclass{article}

\usepackage[utf8]{inputenc}
\usepackage{newunicodechar}
\newunicodechar{α}{\alpha}

\begin{document}

$α$

\end{document}


Unfortunately you will have to manually declare every single unicode character that you want to use in this way. The unixode package does this for some common characters. I myself also compiled a list of those characters that I came across until now.

-
\documentclass{article}

\usepackage{unicode-math}

\begin{document}
$α$

\end{document}


Compile this with XeLaTeX or LuaLaTeX.

-
The problem is that I might not be able to choose a compiler. You see I'm trying to get epub out of html in sphinx. And it uses pdftex -- and I can't find where it is specified. –  Adobe Sep 12 '12 at 13:03
Had to roll back your tags on the question. We don't tag questions based on the answers. –  canaaerus Sep 12 '12 at 13:12
OK, I just thought it might help others in searching. –  mbork Sep 12 '12 at 13:16
Random thought: if all else fails, you can always put a script called pdftex in your ~/bin directory, and make it call xe(la)tex or whatnot, and make sure this is the first directory in your \$PATH. Extremely dirty hack, but in a pinch... –  mbork Sep 12 '12 at 18:14