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.

I thought the point of XeTeX was to allow Unicode to work out of the box (in addition to leveraging system fonts). So how come the following does not output anything unless I use the fontspec package?

\documentclass{article}
\usepackage{fontspec}  % must be present
\begin{document}
éʡ
\end{document}

The first character is U+00E7 (present in Latin-1) and the second is U+02A1.

share|improve this question

3 Answers 3

up vote 7 down vote accepted

XeTeX allows easy access to system fonts, but none of the standard formats (here the LaTeX format) load these. Indeed, it's not possible to save system fonts into a format: they have to be loaded when used. As such, when you run xelatex you get almost the same preloaded code as you do with latex or pdflatex (there are a few changes to deal with assigning codes to an extended set of characters). The standard TeX fonts don't have coverage of all of Unicode, so the characters you want to print are simply not available.

It's not absolutely necessary to use fontspec to use system fonts with XeLaTeX: you can load the font directly using the \font primitive, which is extended by XeTeX. However, using fontspec makes life a lot easier. With the standard settings, fontspec will load the Latin Modern font, which includes a lot wider glyph coverage than LaTeX 'out of the box'. It's important to note that you will see only see the glyphs that the font includes: a classic issue is that most western fonts don't cover Chinese, etc., so you need an appropriate font here.

share|improve this answer
    
Thanks. Very clear. –  Dan Aug 10 '12 at 16:47

You need a font that have the characters you want since, unlike most desktop applications, XeTeX does not do automatic font fall back when a requested character is missing from the current font (for good reasons). One of the side effects of loading fontspec is that is makes Latin Modern fonts the default which has wider Unicode coverage than the original Computer Modern fonts, but there is no (and unlikely there will ever be) font that covers the whole Unicode.

share|improve this answer

No, you don't have to use fontspec, but you must change the default Computer Modern fonts. CM fonts do not contain these characters, use a Unicode font instead.

Example:

\documentclass{article}
\font\1="Times New Roman" % For windows
\begin{document}
\1
éʡ
\end{document}
share|improve this answer

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.