# How to generate an en-dash (–) other than “--”

I am preparing a poster based on a specific template I have to use. The template uses Arial as font. Strangely, typing "--" (for example for page ranges in references) does not result in an en-dash (–), but rather two visible hyphen characters "-"'s. Is there an alternative way to generate an en-dash directly?

• `\textendash`?. Though you should probably investigate why this happens. – gusbrs Jan 31 at 15:02
• @user3825755 You possibly have an outdated version of `fontspec`. What TeX distribution are you using? – egreg Jan 31 at 16:26
• TeXLive 2013, so might indeed be outdated – user3825755 Jan 31 at 16:27
• @PeterGrill Not exactly a duplicate. The linked answer implies that the OP was using `--` in math mode. But this is a problem with outdated `fontspec` where `--` is used in text mode. The best solution should be to just update `fontspec`. – Ruixi Zhang Jan 31 at 20:03
• @user3825755 And Mico is right: you should update your installation, especially if you’d like the solutions we post here to work for you! – Davislor Feb 1 at 5:56

Here's a compilation of solutions, roughly ranked in descending order by importance. This answer incorporates information gleaned from comments below the original query -- e.g., that XeLaTeX and thus the `fontspec` package are in use.

• TeXLive2013 is seriously out of date as of February 2019. Do yourself a big favor and update your TeX distribution to TeXLive2018. An immediate benefit of performing this update is that you won't have to specify the option `Ligatures=TeX` when executing `\setmainfont`, `\setsansfont`, etc. I.e., this option is now among the defaults.

As @Davislor has pointed out in a comment, it is actually still necessary, even under the latest TeXLive distribution, to specify `Ligatures=TeX` if `babelfont` is in use. Nevertheless, you'll come to appreciate the many small and large improvements that have occurred in TeXLive and its packages (including `fontspec`) over the past 5 years.

• When executing `\setmainfont`, `\setsansfont`, etc., be sure to specify the option `Ligatures=TeX`. (For TeX, creating the en-dash from `--` involves ligation.)

• Write `\textendash` instead of `--`.

• If you are a glutton for punishment :-), you could write either `\char"2013` or `\symbol{2013}` instead of `--`. See @Davislor's answer for more information. :-)

• If you don't mind twisting your fingers into pretzel-like shapes, by all means enter the Unicode en-dash symbol directly from your keyboard. See some of the other answers for possibilities... The precise key and finger-twist combination needed to output an en-dash will depend both on the operating system (MacOS? Windows? something else?) and the national keyboard that's active.

• Thanks for the detailed compilation. Yes, I should and will update my TeXLive version. – user3825755 Feb 1 at 8:02

For those using Debian Linux with a German keyboard (I know you're out there), the “Alt Gr” key in conjunction with the hyphen key produces the en dash, and the “Alt Gr” in conjunction with the underbar (Shift-hyphen) produces the em dash.

• Thanks. Works well under Linux Mint. Under Windows 10 using "Alt Gr" plus the minus-sign key on the numpad produces an em-dash. – Martin Scharrer Feb 1 at 6:34

I believe that if you use UTF8 encoding (either through LuaLaTeX, XeLaTeX, or through the inputenc package) you can just type it directly into the editor.

The shortcut for the en-dash is:

"Alt+0150" for Windows

"OPT+-" for Mac

And I don't know what the shortcut is in Linux, but I'm sure you can google it and find out. Alternatively you can just copy and paste it from somewhere.

If you are an Emacs user, the following sequence of keystrokes will input the Unicode en-dash character (hex: 2013)

``````C-x 8 Return 2013 Return
``````
• Even easier, `C-x 8 Return en dash Return` – Thérèse Jan 31 at 17:42

With `fontspec` loaded and the TU encoding selected, you can enter either `\char{"2013}`, `\symbol{2013}` or `^^^^2013`. There’s no real reason to type any of those instead of `\textendash`, but I mention them for completeness.