I am trying to convert the figures of a mixed string over which I have no control, say

+1 (234) 567 890 abcd

to old style when using the kurier font.
I know of \oldstylenums, but it switches to the OML encoding which does not support symbols such as "+", "(", etc

After trying out several things (like parsing the string with xstring and substituting the numbers for \oldstylenums{number} -- I got stuck with annoying TeX expansion issues), I finally found a way to do it by redefining the normal math font version and declaring the numbers as a special category of symbols, i.e.


I can then simply use $+1 (234) 567 890 abcde$. To solve the math spacing issue, I actually do

$\StrSubstitute{+1 (234) 567 890 abcde}{ }{$ $}$

But it's probably the ugliest hack I've writtent since a long long time...

Any idea on how to do this in an elegant way?

2 Answers 2


Highly inefficient, but for limited use it might be good:



\pmos{+1 (234) 567 890 abcd}

The \sbox0{\oldstylenums{0}} is there to ensure loading of the correct font before LaTeX tries to use it for \pmos (Poor man's old style), so load your font package before this code.

  • Thanks! Not quite handsome, but definitely better than my solution. I just need to find why it is conflicting with my code (your case example works, but \pmos{} doesn't produce any oldstyle figures when used in my complex class so far :(
    – Xavier
    Commented Dec 17, 2011 at 2:25
  • I am sorry, but I cannot understand why this solution (of which I must confess I understand almost nothing...) is "definitely better than the original" which seems to work perfectly on my file...thanks! Commented Aug 3, 2013 at 6:56
  • @FilippoAlbertoEdoardo The original changes the appearance of all digits in math mode.
    – egreg
    Commented Aug 3, 2013 at 16:45
  • @egreg: Thanks, I see. So, most probably, I misunderstood what the OP wanted. Since I do want to change all digits (meaning: in each single occurrency of math mode), I am opting for the OP's version. By the way, since I was trying the same but got stuck, can you tell me where/how can one figure out that the slots corresponding to oldstyle numbers are "31-"39? Commented Aug 4, 2013 at 6:34
  • @FilippoAlbertoEdoardo Normally, oldstyle figures are meant to be used inside text, while modern figures are meant to be used in equations, tables, etc. So the ability to chose which one to use is definitely an improvement.
    – Xavier
    Commented Aug 4, 2013 at 7:19

Are you willing and able to switch from (pdf)latex to XeLaTeX? (If you're running either TeXLive2011 or MikTeX2.9, you have XeLaTeX.) If so, there's good news: the Kurier font family is available in OpenType format, making it very straightforward to use with XeLaTeX. The following MWE shows how you might go about using XeLaTeX for your purposes:

% !TEX program = xelatex
+1 (234) 567 8900 abcd

enter image description here

  • Unfortunately no, the code has to be 100% compatible with LaTeX. I should have specified that.
    – Xavier
    Commented Dec 17, 2011 at 1:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .