%%% ====================================================================
%%%  @LaTeX-file{
%%%     filename        = "upref.dtx",
%%%     version         = "1.2d",
%%%     date            = "1999/11/29",
%%%     time            = "12:52:33 EST",
%%%     checksum        = "40884 112 484 4238",
%%%     author          = "American Mathematical Society",
%%%     copyright       = "Copyright 1996 American Mathematical Society,
%%%                        all rights reserved.  Copying of this file is
%%%                        authorized only if either:
%%%                        (1) you make absolutely no changes to your copy,
%%%                        including name; OR
%%%                        (2) if you do make changes, you first rename it
%%%                        to some other name.",
%%%     address         = "American Mathematical Society,
%%%                        Technical Support,
%%%                        Electronic Products and Services,
%%%                        P. O. Box 6248,
%%%                        Providence, RI 02940,
%%%                        USA",
%%%     telephone       = "401-455-4080 or (in the USA and Canada)
%%%                        800-321-4AMS (321-4267)",
%%%     FAX             = "401-331-3842",
%%%     email           = "tech-support@ams.org (Internet)",
%%%     codetable       = "ISO/ASCII",
%%%     keywords        = "latex, amslatex, ams-latex, cross references",
%%%     supported       = "yes",
%%%     abstract        = "This is a LaTeX package that provides printing
%%%                        of \cn{ref}s in an upright font even if the
%%%                        current context is italic or slanted.",
%%%     docstring       = "The checksum field above contains a CRC-16
%%%                        checksum as the first value, followed by the
%%%                        equivalent of the standard UNIX wc (word
%%%                        count) utility output of lines, words, and
%%%                        characters.  This is produced by Robert
%%%                        Solovay's checksum utility.",
%%%  }
%%% ====================================================================
%
%\iffalse
%<*driver>
\documentclass{amsdtx}
\begin{document}
\title{The \pkg{upref} package}
\author{American Mathematical Society\and Michael Downes}
\date{Version \fileversion, \filedate}
\hDocInput{upref.dtx}
\end{document}
%</driver>
%\fi
%
% \maketitle
%
% \MakeShortVerb\|
%
% \section{Introduction}
%
%    This package changes the \cn{ref} command so that it never applies
%    a slanted font shape to its argument, regardless of context. This
%    was the default behavior in \cls{amsart} version 1.1. Starting with
%    version 1.2 it must gotten by special request via
%    |\usepackage{upref}|.
%
% \StopEventually{}
%
% \section{Implementation}
%    Give package name, date, version.
%    \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}% LaTeX 2.09 can't be used (nor non-LaTeX)
[1994/12/01]% LaTeX date must December 1994 or later
\ProvidesPackage{upref}[1999/11/29 v1.2d]
%    \end{macrocode}
%
%  \begin{macro}{\@setref}
%  \begin{macro}{\@noref}
%    If the current fontshape is italic or slanted, we want to switch to
%    upright/roman for printing the number of a \cn{ref}. This requires
%    changing the \cs{@setref} command.
%    \begin{macrocode}
\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}%
}
%    \end{macrocode}
%  \end{macro}
%  \end{macro}
%
%  \begin{macro}{\@upn}
%    The function \cs{\@upn} is used to force theorem numbers and
%    similar elements to be upright in sloped or italic contexts.
%    If a suitable italic font with upright numbers and punctuation is
%    available, this function should be redefined to be a no-op.
%    \begin{macrocode}
\providecommand\@upn{\textup}
%    \end{macrocode}
%  \end{macro}
%
%    The usual \cs{endinput} to ensure that random garbage at the end of
%    the file doesn't get copied by \fn{docstrip}.
%    \begin{macrocode}
\endinput
%    \end{macrocode}
%
% \CheckSum{27}
% \Finale
