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.

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).

share|improve this question

2 Answers 2

up vote 8 down vote accepted

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.

share|improve this answer
\documentclass{article}

\usepackage{unicode-math}

\begin{document}
$α$

\end{document}

Compile this with XeLaTeX or LuaLaTeX.

share|improve this answer
    
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

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.