[Tex/LaTex] UTF8 not working in LuaTeX in TeXLive 2010

luatexunicode

I've been trying to set a document using lualatex in my TeXLive 2010 installation. Unfortunately, the non-ASCII characters are left out from the output. In the following minimal document produces a PDF with no warnings or errors but it only contains the second line. Using the inputenc package results in an error Unicode char ... not set up for use with LaTeX.

\documentclass{minimal}
\begin{document}
číčí
abcd
\end{document}

pdflatex handles the document fine. My version of lualatex is

This is LuaTeX, Version beta-0.60.2-2010071421 (Web2C 2010) (rev 3736)

Thanks for any pointers.

EDIT: For bonus points, how would I use the Bitstream Charter fonts? I use the mathdesign package, but with them (and even when loading fontspec, fontenc and/or luaotfload), the non-ASCII characters are missing :/

\usepackage[bitstream-charter]{mathdesign}

Best Answer

You need to actually load a font that includes these characters. By default, lualatex uses the computer modern fonts. You can select a font with the fontspec package. Just loading fontspec without explicitly setting a font, makes lualatex use the latin modern fonts, which include the characters.

\documentclass{minimal}
\usepackage{fontspec}
\begin{document}
číčí
abcd
\end{document}

gives latin modern

You can load any OTF or TTF font with the fontspec package. For details see the fontspec manual. I do not know if there is an Unicode aware version of Bitstream Charter, but you can use Charis SIL, which is based on it:

\documentclass{minimal}
\usepackage[charter]{mathdesign}  % sets the math font
\usepackage{fontspec}
\setmainfont{Charis SIL}          % sets the document font
\begin{document}
číčí abcd $abcd$
\end{document}

Charis SIL and mathdesign

Note that you have to include mathdesign before \setmainfont so that it doesn't override the document font.