# newcommand for use \oldstylenums of another font

How I can define a new command to use the old-style numbers of the package `gfsartemisia` within the default font in pdflatex ?

I tried something like:

``````\newcommand{\oldnum}[1]{{\fontfamily{artemisia}\oldstylenums{#1} \selectfont}}
``````

in the preamble to use

``````Some text with default font \oldnum{123} more text with default font
``````

but doesn't work.

-

The GFS Artemisia fonts have old style numbers in `\scshape`, so the solution should be
``````\newcommand{\oldnum}[1]{{\fontfamily{artemisia}\scshape #1}}
Each font choosing declaration has an implicit `\selectfont`.
In any case, `\selectfont` should go before the text that we want to be affected by the font selection. Notice also that `\oldstylenums` is an instruction that tells LaTeX to get the digits from a math font, so it doesn't obey `\fontfamily` settings.