%%
%% This is file `showlabels.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% showlabels.dtx  (with options: `package')
%% Style to display labels in the margin
%% This software is copyright, 1999, Norman Gray.
%%
%% This program is free software; you can redistribute it and/or
%% modify it under the terms of the GNU General Public License
%% as published by the Free Software Foundation; either version 2
%% of the License, or (at your option) any later version.
%%
%% This program is distributed in the hope that it will be useful,
%% but WITHOUT ANY WARRANTY; without even the implied warranty of
%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
%% GNU General Public License for more details.
%%
%% You should have received a copy of the GNU General Public License
%% along with this program; if not, write to the Free Software
%% Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
%%
%% Author: Norman Gray, norman@astro.gla.ac.uk.
%% Department of Physics and Astronomy, University of Glasgow, UK
%%
%% See the file LICENCE for a copy of the GPL.
%% You can also find an online copy at http://www.gnu.org/copyleft/gpl.html .
%% RCS Info $Id: showlabels.dtx,v 1.4 1999/07/22 17:28:21 norman Exp $
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{showlabels}[1999/07/22 v1.3c]
\typeout{Package: `showlabels' v1.3c\space<1999/07/22>}
\def\filename{showlabels}
\def\fileversion{v1.3c}
\def\filedate{1999/07/22}
\def\docdate{1999/07/22}
\newif\ifSL@AMS
\expandafter\ifx\csname maketag@@@\endcsname\relax
  \SL@AMSfalse
\else
  \SL@AMStrue
  \typeout{with AMS-LaTeX equation tags}
\fi
\ifSL@AMS
  \let\@maketag@@@=\maketag@@@
  \def\maketag@@@#1{\@maketag@@@{#1}%
  \ifx\df@label\@empty
  \else
    \SL@eqnlrtext{\df@label}%
  \fi}
\else
  \let\@@eqnnum=\@eqnnum
  \def\@eqnnum{\@@eqnnum
  \expandafter\ifx\SL@labeln@me\relax
    \SL@eqnlrtext{???}%
  \else
    \SL@eqnlrtext{\SL@labeln@me}%
    \global\def\SL@labeln@me{\relax}%
  \fi}
  \global\def\SL@labeln@me{\relax}
\fi
\def\showlabelfont{\small\tt}
\def\SL@gobblethree#1#2#3{}
\def\prlabelname#1{%
\expandafter\expandafter\expandafter\SL@gobblethree
    \expandafter\string\csname r@#1\endcsname}
\let\SL@makecaption\@makecaption
\long\def\@makecaption#1#2{{\def\label##1{{\showlabelfont
\{\prlabelname{##1}\}\space}\SL@label{##1}}%
\SL@makecaption{#1}{#2}}}
\let\SL@label\label
\def\label#1{\@bsphack\SL@label{#1}%
  \ifmmode
    \ifSL@AMS\else
      \xdef\SL@labeln@me{\prlabelname{#1}}%
    \fi
  \else
    {\setbox0=\vbox to 0pt{\vss
      \hbox to \columnwidth{\SL@lrtext{#1}}}%
    \dp0=0pt
    \ifvmode
      \nointerlineskip\box0\nobreak
    \else
      \vadjust{\box0\nobreak}%
    \fi}%
  \fi
  \@esphack}
\def\SL@margintext#1{{\showlabelfont\{\prlabelname{#1}\}}}
\def\SL@righttext#1{\hfill\rlap{\quad\SL@margintext{#1}}}
\def\SL@lefttext #1{\llap{\SL@margintext{#1}\quad}\hfill}
\def\SL@alternatetext{%
  \if@outerlabels
    \ifodd\c@page
      \let\SL@next\SL@righttext\else
      \let\SL@next\SL@lefttext\fi
  \else
    \ifodd\c@page
      \let\SL@next\SL@lefttext\else
      \let\SL@next\SL@righttext\fi
  \fi
  \SL@next}
\def\SL@twocoltext{%
  \if@firstcolumn
    \let\SL@next\SL@lefttext
  \else
    \let\SL@next\SL@righttext
  \fi
  \SL@next}
\def\SL@eqnrighttext#1{\rlap{\quad\SL@margintext{#1}}}
\def\SL@eqnlefttext #1{\hbox to 0pt{\kern -\columnwidth
\llap{\SL@margintext{#1}\quad}\hss}}
\def\SL@eqnalternatetext{%
  \if@outerlabels
    \ifodd\c@page
      \let\SL@next\SL@eqnrighttext\else
      \let\SL@next\SL@eqnlefttext\fi
  \else
    \ifodd\c@page
      \let\SL@next\SL@eqnlefttext\else
      \let\SL@next\SL@eqnrighttext\fi
  \fi
  \SL@next}
\def\SL@eqntwocoltext{%
  \if@firstcolumn
    \let\SL@next\SL@eqnlefttext
  \else
    \let\SL@next\SL@eqnrighttext
  \fi
  \SL@next}
\newif\if@outerlabels
\@outerlabelstrue
\DeclareOption{outer}{\@outerlabelstrue}
\DeclareOption{inner}{\@outerlabelsfalse}
\ProcessOptions
\if@twocolumn
  \let\SL@lrtext\SL@twocoltext
  \let\SL@eqnlrtext\SL@eqntwocoltext
\else
  \if@outerlabels
    \if@twoside
  \let\SL@lrtext\SL@alternatetext
  \let\SL@eqnlrtext\SL@eqnalternatetext
    \else
      \let\SL@lrtext\SL@righttext
      \let\SL@eqnlrtext\SL@eqnrighttext
    \fi
  \else
    \if@twoside
  \let\SL@lrtext\SL@alternatetext
  \let\SL@eqnlrtext\SL@eqnalternatetext
    \else
      \let\SL@lrtext\SL@lefttext
      \let\SL@eqnlrtext\SL@eqnlefttext
    \fi
  \fi
\fi
\endinput
%%
%% End of file `showlabels.sty'.
