2

I use lowercase/old style figures in most of my document, but want to use uppercase/lining figures in references (as they're "proper nouns" I think). I'm using the following at the moment:

\newcommand*{\myref}[1]{\liningfigures{\ref{#1}}}

(\liningfigures comes from fontaxes with libertine fonts) but that means that I have to use \myref{id} all over the place. I was wondering what to use so that I can just use \ref as normal.

Hum, while looking for the right terms I found out how to do it. Will post my answer below… if anyone has a better way to do it, feel free to contribute!

Sam Mason
  • 772

1 Answers1

2

This is as simple as capturing the definition of \ref using \let and using it in the new definition:

\let\oldref\ref
\renewcommand*\ref[1]{\liningfigures{\oldref{#1}}}

For more details, see: What is the difference between \let and \def?

Sam Mason
  • 772
  • 1
    This might fail if hyperref is loaded. It's better to use \LetLtxMacro\oldref\ref (with `\usepackage{letltxmacro}). See http://tex.stackexchange.com/questions/88001/when-to-use-letltxmacro – egreg Nov 06 '13 at 12:57
  • I'd already been using hyperref in my document, with no obvious ill effects. Will use LetLtxMacro though. – Sam Mason Nov 06 '13 at 13:22