16

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}

2 Answers 2

21

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.

2
  • Thanks, this helps. However, how could I use Bitstream Charter? Does it also have an alternative? Nov 27, 2010 at 22:56
  • (edited to include the answer to that question)
    – Caramdir
    Nov 28, 2010 at 0:15
1

You cannot use any font package except fontspec if you want to enjoy the benefits of Unicode and OpenType. The version of Charter which is freely available is a non-Unicode Type 1 font, so you shouldn't use it. Use e.g. Charis SIL which is based on Charter.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .