## LaTeX forum ⇒ XeTeX ⇒ -- en-dash problem

Information and discussion about XeTeX, an alternative for pdfTeX based on e-Tex
victorclaessen
Posts: 12
Joined: Thu Dec 16, 2010 2:09 pm

### -- en-dash problem

Hi,

I'm using XeLaTeX to write a thesis using the Arno Pro font. I've noticed that -- isn't automatically translated to an en-dash when I use that font. However when I type \textendash, I *do* get an en-dash. Why is this happening? And can I fix it?

Kind regards,

Vic

Minimal (ok ok quasi-minimal) working example:

\documentclass[b5paper,10pt,twoside,openright]{memoir} \usepackage{xltxtra}\usepackage{fixltx2e}  \setromanfont{Arno Pro}	 \begin{document}-\\--\\---\\\textendash\\\textemdash\end{document}
Last edited by victorclaessen on Thu Jan 20, 2011 1:49 am, edited 1 time in total.

frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am
You need to make sure you're using the tex-text mapping.

You can do this font-by-font, but it's easiest just to do once and for all with the command:

\defaultfontfeatures{Mapping=tex-text}

or equivalently
\defaultfontfeatures{Ligatures=TeX}

in your preamble. I usually do this right after loading the fontspec package. (fontspec is loaded by xltxtra in your case.) See sec. 12.1 of its manual.

victorclaessen
Posts: 12
Joined: Thu Dec 16, 2010 2:09 pm
Thanks! The first line solved it.

I also tried the second line, but if I add that (right after xltxtra), then I get this error.

! Package xkeyval Error: TeX' undefined in families Ligatures'. See the xkeyval package documentation for explanation.Type  H <return>  for immediate help.  ... l.28 \setromanfont{Arno Pro}

But (to me) that is not important, because the first line worked well.

Thanks again!

Vic

frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am
The commands do the same thing so you certainly don't need both. I'd guess, however, that you're using an older version of fontspec than I am, in which case the command is what you need anyway.

Return to “XeTeX”

### Who is online

Users browsing this forum: Baidu [Spider] and 1 guest