prettyref.sty 977 B

12345678910111213141516171819202122232425262728293031323334353637
  1. %%
  2. %% This is file `prettyref.sty',
  3. %% generated with the docstrip utility.
  4. %%
  5. %% The original source files were:
  6. %%
  7. %% prettyref.dtx (with options: `style')
  8. %%
  9. %% Copyright (c) 1995 Kevin Ruland
  10. %%
  11. %%
  12. %% prettyref v3.0
  13. %%
  14. %% Copyright 1995,1998. by Kevin Ruland kevin@rodin.wustl.edu
  15. %%
  16. \ProvidesPackage{prettyref}[1998/07/09 v3.0]
  17. \def\newrefformat#1#2{%
  18. \@namedef{pr@#1}##1{#2}}
  19. \newrefformat{eq}{\textup{(\ref{#1})}}
  20. \newrefformat{lem}{Lemma \ref{#1}}
  21. \newrefformat{thm}{Theorem \ref{#1}}
  22. \newrefformat{cha}{Chapter \ref{#1}}
  23. \newrefformat{sec}{Section \ref{#1}}
  24. \newrefformat{tab}{Table \ref{#1} on page \pageref{#1}}
  25. \newrefformat{fig}{Figure \ref{#1} on page \pageref{#1}}
  26. \def\prettyref#1{\@prettyref#1:}
  27. \def\@prettyref#1:#2:{%
  28. \expandafter\ifx\csname pr@#1\endcsname\relax%
  29. \PackageWarning{prettyref}{Reference format #1\space undefined}%
  30. \ref{#1:#2}%
  31. \else%
  32. \csname pr@#1\endcsname{#1:#2}%
  33. \fi%
  34. }
  35. \endinput
  36. %%
  37. %% End of file `prettyref.sty'.