Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am trying to get an en-dash by using two '-' characters, but instead of appearing as one long en-dash symbol, I'm getting --. Any idea how I can get an unbroken en-dash?

share|improve this question
3  
Please post a minimal example and which engine and format you are using (LaTeX, pdfLaTeX, XeLaTeX, ...) It could be a problem with ligatures, font, or just with your viewer. Zoom in, try a different viewer or print it. –  Stefan Kottwitz Aug 7 '11 at 22:02
2  
You should get an unbroken endash by default. Are you using xelatex or special font package, etc.? –  frabjous Aug 7 '11 at 22:02
    
Try \textendash although I get an endash using two '-' characters. And, while we're on the topic, an even longer dash is produced by the \textemdash command –  DJP Aug 8 '11 at 1:20
    
Apparently '--' doesn't produce an en-dash in math-mode; it works fine in text mode. –  Isaac Kleinman Aug 8 '11 at 1:40
add comment

1 Answer

up vote 22 down vote accepted

Are you perhaps trying to do this within math mode? If, so that needs special attention:

\documentclass{article}
\usepackage{amsmath}
\begin{document}

Outside of math mode  13--17 works.

In math mode this does not work as the dashes represent a minus operation:
\[a = d\ 17--21\]

In math mode you need to:
\[a = d \hbox{ 17--21}\]
or if you have the amsmath pacakge:
\[a = d \text{ 16--19}\]
\end{document}
share|improve this answer
    
Yes, I realized my mistake, I was trying to get the en-dash from within math mode; it works fine in text mode. –  Isaac Kleinman Aug 8 '11 at 1:37
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.