The upref package

American Mathematical Society  Michael Downes

28 October 1996 Version 1.02

1 Introduction

This package changes the \ref command so that it never applies a slanted font shape to its argument, regardless of context. This was the default behavior in amsart version 1.1. Starting with version 1.2 it must gotten by special request

via \usepackage{upref}.

2 Implementation

Give package name, date, version.

  \NeedsTeXFormat{LaTeX2e}% LaTeX 2.09 can't be used (nor non-LaTeX)
  [1994/12/01]% LaTeX date must December 1994 or later
  \ProvidesPackage{upref}[1996/10/28 v1.2b]

If the current fontshape is italic or slanted, we want to switch to upright/roman for printing the number of a \ref. This requires changing the

\@setref command.
  \def\@setref#1#2#3{\ifx#1\relax
      \protect\@noref{#3}%
    \else
      \protect\textup{\expandafter#2#1\hbox{}}%
    \fi}
  \newcommand{\@noref}[1]{%
    \G@refundefinedtrue
    \nfss@text{\reset@font\bfseries ??}%
    \@latex@warning{Reference `#1' on page \thepage\space undefined}%
  }

The usual \endinput to ensure that random garbage at the end of the file doesn’t get copied by docstrip.

  \endinput