# Fontspec en- and em-dash ligatures

When producing en- or em-dashes with fontspec enabled i XeLaTeX, the ligatures are not produced, it simply prints -- and ---.

MWE:

\documentclass{article}
\usepackage{fontspec}
\setmainfont{Linux Libertine}
% \usepackage{libertine}

\begin{document}

So let's try an en-dash: 32--34 wonder what that will look like?
How about the em-dash---does it makes any difference?

\end{document}


Produces this result:

If in stead I load the commented Libertine-package instead, everything works fine and produces the following output:

Any suggestions?

• You may want to load package libertine. It takes care of all this stuff and provides you with other useful macros. It also sets biolinum as the sans font (but you can prevent that giving the option rm). – Johannes_B Oct 27 '14 at 7:43
• You probably have an old version of fontspec, because the last version sets Ligatures=TeX by default. – egreg Oct 27 '14 at 7:45
• @Johannes_B As I wrote in my question, that is a solution, but my question was why it didn't work with fontspec. – Stenskjaer Oct 27 '14 at 8:04
• libertine does the exact same thing internally. It tests for the engine and loads fontspec itself. Less trouble for you. – Johannes_B Oct 27 '14 at 8:07

To enable the TeX-Shortcuts, setting the fonts should look like this:

\usepackage{fontspec}
\defaultfontfeatures{Ligatures=TeX}
\setmainfont{Linux Libertine}