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.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Do postscript fonts such as libertine (from the libertine-legacy package) or mathpazo have a minus sign that can be accessed when in text mode? What I am trying to do is substitute the normal dash with a minus symbol, following this answer from David Carlisle.

His solution works perfectly when using open type fonts as most of them have a minus character that can be easily accessed:

  \mathcode\expandafter`\string-"8000 }

However, my attempts to do something similar with pdfLaTeX and Libertine or Pagella have been futile. Using a symbol like hyphen (\textendash) works perfectly:

  \mathcode\expandafter`\string-"8000 }

But is not exactly what I want. How can I access the minus symbol of that font? Or, if that is not possible, is it possible to resize the hyphen to "fake" a minus symbol?

Edit: egreg provided the solution below. Embedded into my framework the code is:

\def\yyy{% Thanks to egreg
  \mathcode`-="8000 }
share|improve this question
up vote 2 down vote accepted

The en dash is in position "15 in the T1 encoding:

  \uppercase{\endgroup\def~}{\mathbin{\text{\char"15 }}}
\AtBeginDocument{\mathcode`-="8000 }

Alternatively, there's \textminus in the TS1 encoding:

\AtBeginDocument{\mathcode`-="8000 }

share|improve this answer
But I need a minus, not the en dash...? – Jörg Aug 24 '12 at 15:43
@Jörg There's no minus sign in the T1 encoding. – egreg Aug 24 '12 at 16:28
Brilliant, thanks. But I think there is no need to load amsmath here. – Jörg Aug 24 '12 at 17:52
Sorry, I'm lost. I do not understand that is intended here. Even zooming at huge font size, I cannot see any difference between the customized $-$ with \textminus nor the simple -- in text mode using this MWE. – Fran Aug 24 '12 at 18:03
@Jörg You need at least amstext for \text. – egreg Aug 24 '12 at 19:42

Your Answer


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.