[Tex/LaTex] Is it possible to disable old style numbers for specific cases

fontsoldstylenums

Is there a way to disable old style numbering only for specific cases? Right now I have old style numbering enabled globally for my whole document via \usepackage[osf]{libertine}, but I want to disable it only for one block of text.

I am hoping there is a way to simply disable old style for that block of text (which has numbers scattered throughout it) rather than having to add \somecommand{123} for each number instance in the block of text.

Best Answer

Educated guess: enclose the text block in a group and switch to the fxl font.

\documentclass{article}

\usepackage[T1]{fontenc}
\usepackage[osf]{libertine}

\begin{document}

\Large

Some text 0123 with some \emph{456 numbers \textbf{789}} in between.

\begingroup
\usefont{T1}{fxl}{m}{n}\selectfont

Some text 0123 with some \emph{456 numbers \textbf{789}} in between.

\endgroup

Some text 0123 with some \emph{456 numbers \textbf{789}} in between.

\end{document}