[XeTeX] Problem with Mapping=tex-text

Jonathan Kew jonathan_kew at sil.org
Thu Oct 18 18:23:46 CEST 2007


On 18 Oct 2007, at 4:54 pm, Chaiwat Jidogang wrote:

> Hi,
>
> I think I have some problem with text mapping.
> I want to use the default Computer Modern fonts and I want the usual
> TeX code produce `single-quote', ``double-quote'', en-dash (--), and
> em-dash (---),
> so I put \defaultfontfeatures{Mapping=tex-text} in, as shown below.
> However, xelatex the following code didn't produce the quotes and
> dashes as I want.
>
> Could anyone tell me what I'm missing. The following are my code.
>
> %----------------------------------------------------
> \documentclass[11pt,a4paper,twoside,openright]{report}
> \usepackage{fontspec}
> \defaultfontfeatures{Mapping=tex-text}
>
> \begin{document}
> ``quote''
>
> en-dash (--)
>
> em-dash (---)
> \end{document}
> %----------------------------------------------------

If you just want the CM fonts, you don't need the fontspec package at  
all; you could just remove the lines

> \usepackage{fontspec}
> \defaultfontfeatures{Mapping=tex-text}

from your document. (But then, why use XeTeX at all? Standard TeX or  
pdfTeX would work just as well.)

If you do want fontspec, perhaps to define some fonts elsewhere in  
your document, you can use the [cm-default] option to ensure it loads  
the CM fonts. Otherwise, it will load OpenType Latin Modern fonts by  
default, and apparently doesn't apply the tex-text mapping. (With CM,  
you don't need this as it's implemented in the old TFM files.)

The \defaultfontfeatures command sets defaults for any fonts *later*  
defined with fontspec, but it won't add features to the fonts that  
were already set.

JK



More information about the XeTeX mailing list