2

I've read the below answer : Font selection in XeTeX for specific characters

but I need a solution that works with pdflatex instead of xetex.

2
  • 3
    Welcome to TeX.SX! It's better to make your questions (and answers) self-contained rather than directing people to other pages via links.
    – user30471
    May 15, 2015 at 12:36
  • My question clear!How to change the font of the numbers in a tex. I mean I am using a font, but I don't like it for my numbers, it there a way to use separate font for numbers, without changing to math.
    – maryam
    May 16, 2015 at 13:59

1 Answer 1

10

There is no correspondent in pdflatex of the “interchar tokens” feature of XeTeX. Making digits active for expanding them to add a font call is not a choice, as you want digits also for things like \linebreak[2] which would break painfully.

The only way out is to define a macro:

\newcommand{\printnum}[1]{{\fontfamily{...}\selectfont#1}}

where ... should be the family name of the font you want to use; then, to print a number with that font, say

\printnum{42}

You must log in to answer this question.

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