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:
\def\yyy{%
\bgroup\uccode`\~\expandafter`\string-%
\uppercase{\egroup\edef~{\noexpand\text{\char"2212\relax}}}%
\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:
\def\yyy{%
\bgroup\uccode`\~\expandafter`\string-%
\uppercase{\egroup\edef~{\noexpand\text{\llap{\textendash}\relax}}}%
\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
\begingroup\uccode`~=`-
\uppercase{\endgroup\def~}{\mathbin{\text{\llap{\textminus}}}}
\mathcode`-="8000 }
amsmathhere. – Jörg Aug 24 '12 at 17:52amstextfor\text. – egreg Aug 24 '12 at 19:42