summaryrefslogtreecommitdiff
path: root/obsolete/macros/latex209/contrib/misc/showlabels.sty
blob: 47d445c670e5ceeceaa3bad574ff9b4831791964 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
% showlabels.sty
% gil@svax.cs.cornell.edu (Gil Neiger)
%
% Change \label, \ref, and \pageref to show labels in line
%

\def\ref#1{\@ifundefined{r@#1}{\mbox{\tt#1?}\@warning
   {Reference `#1' on page \thepage \space 
    undefined}}{\edef\@tempa{\@nameuse{r@#1}}\expandafter
    \@car\@tempa \@nil\null}}

\def\pageref#1{\@ifundefined{r@#1}{\mbox{\tt#1?}\@warning
   {Reference `#1' on page \thepage \space 
    undefined}}{\edef\@tempa{\@nameuse{r@#1}}\expandafter
    \@cdr\@tempa\@nil\null}}

\def\label#1{\@bsphack\if@filesw {\let\thepage\relax
	\xdef\@gtempa{\write\@auxout{\string
		\newlabel{#1}{{\@currentlabel}{\thepage}}}}}\@gtempa
	\if@nobreak \ifvmode\nobreak\fi\fi\fi\@esphack
	\mbox{\tt[#1]}}

\def\@citex[#1]#2{\if@filesw\immediate\write\@auxout{\string\citation{#2}}\fi
  \def\@citea{}\@cite{\@for\@citeb:=#2\do
    {\@citea\def\@citea{,}\@ifundefined
       {b@\@citeb}{\mbox{\tt\@citeb?}\@warning
       {Citation `\@citeb' on page \thepage \space undefined}}%
\hbox{\csname b@\@citeb\endcsname}}}{#1}}