• No results found

The upref package American Mathematical Society Michael Downes updated by Barbara Beeton Version 2.04, 2007/03/14

N/A
N/A
Protected

Academic year: 2021

Share "The upref package American Mathematical Society Michael Downes updated by Barbara Beeton Version 2.04, 2007/03/14"

Copied!
2
0
0

Bezig met laden.... (Bekijk nu de volledige tekst)

Hele tekst

(1)

The upref package

American Mathematical Society

Michael Downes

updated by Barbara Beeton

Version 2.04, 2007/03/14

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 amsart version 1.2, upright references must be obtained via \usepackage{upref}.

2

Implementation

Give package name, date, version.

\NeedsTeXFormat{LaTeX2e}[1995/06/01] \ProvidesPackage{upref}[2007/03/14 v2.04]

\@noref Give a warning if a cited reference isn’t defined. \newcommand{\@noref}[1]{%

\G@refundefinedtrue

\nfss@text{\reset@font\bfseries ??}%

\@latex@warning{Reference ‘#1’ on page \thepage\space undefined}% }

\@setref 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 com-mand.

Since \@setref is modified by the hyperref package, delay the definition until \AtBeginDocument. Then check whether hyperref is loaded. If it is, we have to redefine some control sequences that hyperref defined in order to get upright references even in a hyperref environment. [tjk,bnb, 2004/07/29]

Get around a restriction in an internal AMS package (shaderef) by equating its command \printref to \textup; this applies consistently regardless of other circumstances that have unwanted effects. [dmj,bnb, 2005/05/17]

\AtBeginDocument{%

\providecommand\printref{\textup}% \@ifpackageloaded{hyperref}{%

(2)

2 THE UPREF PACKAGE

We overload \Hy@setref@link as this is where the upright references get clob-bered. Used in overloaded \@setref. \sw@slant is usually applied by \textup, but the specials inserted by the hyperlink get in the way of testing for whether an italic correction is necessary; restore the test. [dmj,bnb, 2005/09/22]

If the link happens to be at the beginning of a paragraph, \sw@slant will produce an error, since neither nor a check for italic correction is valid in vertical mode. For reasons not apparent, this may also occur in some other situations, e.g., following a proof heading containing a cross reference (jams561el). Add \leavevmode to compensate. [dmj,bnb, 2007/02/14] \def\Hy@setref@link#1#2#3#4#5#6\@nil#7{% \begingroup \leavevmode \sw@slant \toks0{\hyper@@link{#5}{#4}}% \toks1\@xp{#7{\printref{#1}\hbox{}}{#2}{#3}{#4}{#5}}% \edef\x{\endgroup\the\toks0{\the\toks1}}\x }%

We should not have to overload \@setref, but there is a chance that an author is using an old version of hyperref which does not use \Hy@setref@link in \@setref. \def\@setref#1#2#3{% \ifx#1\relax \@xp\protect\@noref{#3}% \else \@xp\Hy@setref@link#1\@empty\@empty\@nil{#2}% \fi }% }{% \def\@setref#1#2#3{\ifx#1\relax \protect\@noref{#3}% \else \protect\printref{\@xp#2#1\hbox{}}% \fi }% }% }

\@upn The function \@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.

\providecommand\@upn{\textup}

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

Referenties

GERELATEERDE DOCUMENTEN

error, warning, self-warning If the snapshot package is invoked with the error option and also the document contains a \RequireVersions state- ment, then each subsequent

more infor mation more infor m at ion more info rmation more infor mation more infor mation more infor m at ion more info rmation more infor mation more infor m a tion more in for m

Exclusion ends with the first detected \end{〈name〉}, even if there are additional \begin{〈name〉} declarations in the skipped text; that is, nesting of environments is not

A trade-off between main memory space and hash size; using \Invalid@@ saves 14 bytes of main memory for each use of \Invalid@, at the cost of one control sequence name. \Invalid@

\x@calc@shift@rf To start, we need to know two quantities: the number of align structures in the current row and the “effective length” of the row, defined as the distance from the

The amsopn package provides a command \DeclareMathOperator for defining new ‘math operator names’ similar to the standard function names \sin, \lim, \max, etc.. Standard

Perhaps \accentedsymbol should use \newsavebox, but I don’t know of any compelling reason at the moment.[mjd,5-Sep-1994] \accentedsymbol can only produce a single size of the

If you used the plain.tex versions of \matrix, \pmatrix, or \cases in a doc- ument and then later converted the document to use the amsmath package (or one of the AMS