XeTeXLong dash with other fonts in XeLatex

Information and discussion about XeTeX, an alternative for pdfTeX based on e-Tex
Post Reply
curiouslearn
Posts: 105
Joined: Fri Nov 30, 2007 11:32 pm

Long dash with other fonts in XeLatex

Post by curiouslearn »

Hello,

I am using Garamond font through XeLatex. How can one get em-dash or en-dash in this case. The usual technique of typing "--" for en-dash and "---" for em-dash does not work. I read on the Xetex page that this is because some fonts other than Computer Modern do not have the ligatures to make this conversion. What is the solution?

Thanks.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
meho_r
Posts: 823
Joined: Tue Aug 07, 2007 5:28 pm

Long dash with other fonts in XeLatex

Post by meho_r »

Did you try with Mapping option:

Code: Select all

\usepackage{fontspec}
\usepackage{xltxtra}
\usepackage{xunicode}

\defaultfontfeatures{Scale=MatchLowercase,Mapping=tex-text}
Mapping=tex-text should make all tex commands regarding double quotes, dashes etc. available. You can declare it the way I mentioned for applicability through whole document (recommended) or use it as an option of a particular font (e.g. \setmainfont[Mapping=tex-text]{Adobe Garamond Pro})
curiouslearn
Posts: 105
Joined: Fri Nov 30, 2007 11:32 pm

Re: Long dash with other fonts in XeLatex

Post by curiouslearn »

Thanks meho_r. I have not tried that. I will try that.
Post Reply