# [XeTeX] Em-dash

Michiel Kamermans pomax at nihongoresources.com
Fri Apr 30 16:54:49 CEST 2010

On 4/30/2010 7:29 AM, Alan Munn wrote:
>
> On Apr 30, 2010, at 10:16 AM, José Carlos Santos wrote:
>
>> Hi all (yes, it's me again!):
>>
>> If I compile this file:
>>
>> \documentclass{article}
>> \pagestyle{empty}
>> \usepackage{fontspec}
>> \usepackage{xunicode}
>> \usepackage{xltxtra}
>> \begin{document}
>> ---
>> \end{document}
>>
>> with XeLaTeX, then I get a PDF file which contains a single
>> character, namely an em-dash. But if I add, say, \setmainfont{Arial}
>> before \begin{document}, then what I get is ---. Why? Do I have to
>
> No.  When you specify the main font, just specify the Mapping:
>
> \setmainfont[Mapping=tex-text]{Arial}
>
> This tells xelatex to convert the latex conventions (such as --- )
> (and other things) to the proper unicode versions.
>
> It's set by default for CM fonts, I guess.

Just beware that it might also perform other ligature substitutions when
tex mapping is enabled (not a bad thing, just not always desired)

- Mike