summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/chemcono/showkeysff.sty
blob: b6c1a97fd9460ce3c9b9e22a3049272024af2180 (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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
%
%     A T T E N T I O N!
%
%     This file is a modification of
%
%     `showkeys.sty',
%% %%
%% Copyright 1993 1994 1995 1996 1997 1998 1999
%% The LaTeX3 Project and any individual authors listed elsewhere
%% in this file. The showkeys.sty file is part of the Standard LaTeX `Tools Bundle'.
%% -------------------------------------------------------
%%
%%  This file, and all the other files in this bundle as listed below,
%%  may be distributed under the terms of the LaTeX Project Public
%%  License, as described in lppl.txt in the base LaTeX distribution.
%%  Either version 1.0 or, at your option, any later version.
%%
%% File: showkeysff.sty Copyright (C) 1999 Stefan Schulz
%%
%% For usage, look at drftcono.sty and example.tex
%%
\NeedsTeXFormat{LaTeX2e} \ProvidesPackage{showkeysff}
          [1997/06/12 v1.0 Show ffcite, cite, and label keys (DPC)]
\DeclareOption{notref}{\let\SK@ref\@empty}
\DeclareOption{notcite}{\let\SK@cite\@empty}
\DeclareOption{notffcite}{\let\SK@ffcite\@empty}
\let\SK@refcolor\relax
\let\SK@labelcolor\relax
\DeclareOption{color}{\AtEndOfPackage{%
  \RequirePackage{color}%
  \definecolor{refkey}{gray}{.75}%
  \definecolor{labelkey}{gray}{.75}%
  \def\SK@refcolor{\color{refkey}}%
  \def\SK@labelcolor{\color{labelkey}}}}
\DeclareOption{final}{\endinput}
\DeclareOption{draft}{}
\ProcessOptions
\let\SK@label\label
\let\SK@bibitem\@bibitem
\let\SK@lbibitem\@lbibitem
\let\SK@ffbibitem\@ffbibitem
\let\SK@fflbibitem\@fflbibitem
\def\label#1{%
  \@bsphack
  \SK@\SK@@label{#1}%
  \begingroup
    \SK@label{#1}%
  \endgroup
  \@esphack}
\def\@bibitem#1{%
  \SK@bibitem{#1}\SK@\SK@@label{#1}\ignorespaces}
\def\@lbibitem[#1]#2{%
  \SK@lbibitem[#1]{#2}\SK@\SK@@label{#2}\ignorespaces}
\def\@ffbibitem#1{%
  \SK@ffbibitem{#1}\SK@\SK@@label{#1}\ignorespaces}
\def\@fflbibitem[#1]#2{%
  \SK@fflbibitem[#1]{#2}\SK@\SK@@label{#2}\ignorespaces}
\def\SK@#1#2{%
  \protected@edef\@tempa{#2}%
  \expandafter#1\meaning\@tempa\SK@}
\def\SK@@label#1>#2\SK@{%
  \gdef\SK@lab{\smash{\SK@labelcolor\fbox{%
                     \normalfont\small\ttfamily#2}}}%
  \ifvmode
    \if@inlabel
      \global\setbox\@labels\hbox{%
        \llap{\SK@lab\SK@lab@relax
              \kern\@totalleftmargin\kern\marginparsep}%
        \box\@labels}%
    \else
      \dimen@\prevdepth
      \nointerlineskip
      \ifinner
        \skip@\lastskip\unskip
        \advance\skip@\lastskip\unskip
        \setbox\z@\lastbox
        \ifvoid\z@
          \llap{\SK@lab\SK@lab@relax\kern\marginparsep}%
        \else
          \hbox{\box\z@\kern\marginparsep\SK@labx}%
        \fi
        \vskip\skip@
      \else
        \llap{\SK@lab\SK@lab@relax\kern\marginparsep}%
      \fi
      \prevdepth\dimen@
    \fi
  \else
    \csname SK@\@currenvir\endcsname
    \ifSK@equation\else
      \ifmmode
        \SK@labx
      \else
        \ifinner
          \rlap\SK@lab
      \else
          \vadjust{\llap{\SK@lab\kern\marginparsep}}%
        \fi
        \SK@lab@relax
      \fi
    \fi
  \fi}
\AtBeginDocument{%
  \let\SK@eqnnum\@eqnnum
  \def\@tempa{\let\iftagsleft@\iffalse}%
  \ifx\iftagsleft@\undefined\@tempa\fi%
  \let\SK@tagform@\tagform@
  \iftagsleft@
    \def\tagform@#1{%
      \ifx\df@label\@empty
        \SK@lab@relax
      \else
        \expandafter\SK@@label\meaning\df@label\SK@
      \fi
      \llap{\SK@lab\kern\marginparsep}%
      \SK@lab@relax\SK@tagform@{#1}}%
    \def\@eqnnum{%
      \llap{\SK@lab\kern\displaywidth\kern\marginparsep}%
      \SK@lab@relax\SK@eqnnum}%
  \else
    \def\tagform@#1{%
      \ifx\df@label\@empty
        \SK@lab@relax
      \else
        \expandafter\SK@@label\meaning\df@label\SK@
      \fi
      \SK@tagform@{#1}%
      \rlap{\kern\marginparsep\SK@lab}\SK@lab@relax}%
    \def\@eqnnum{\SK@eqnnum\rlap{\kern\marginparsep\SK@lab}%
                     \SK@lab@relax}%
  \fi}
\def\SK@labx{\rlap\SK@lab\global\let\SK@lab\relax}
\def\SK@lab@relax{\global\let\SK@lab\relax}\SK@lab@relax
\newif\ifSK@equation
\let\SK@equation\SK@equationtrue
\let\SK@eqnarray\SK@equationtrue
\toks@\expandafter{\eqnarray}
\edef\eqnarray{\let\noexpand\tagform@\noexpand\SK@tagform@\the\toks@}
\let\SK@align\SK@equationtrue
\let\SK@alignat\SK@equationtrue
\let\SK@xalignat\SK@equationtrue
\let\SK@xxalignat\SK@equationtrue
\let\SK@gather\SK@equationtrue
\let\SK@multline\SK@equationtrue
\let\SK@flalign\SK@equationtrue
\def\SK@def#1{%
  \edef\@tempa{\expandafter\@gobble\string#1}%
  \@ifundefined{\@tempa\space}%
    {\expandafter\let\csname SK@\@tempa\endcsname#1}%
    {\expandafter\let\csname SK@\@tempa\expandafter\endcsname
                         \csname\@tempa\space\endcsname}%
  \expandafter\def\expandafter#1\expandafter{%
        \expandafter\protect\csname\@tempa\space\endcsname}%
  \expandafter\def\csname\@tempa\space\endcsname}
\ifx\SK@ref\@empty
\AtBeginDocument{%
  \ifx\vpageref\@undefined\else
    \SK@def\@@vpageref#1[#2]#3{{%
      \let\label\SK@label
      \SK@@@vpageref#1[#2]{#3}}}%
    \DeclareRobustCommand\vref[1]{%
      \unskip~\ref{#1}%
      {\let\label\SK@label
       \SK@@@vpageref\unskip[\unskip\space]{#1}}}%
  \fi}
\else
\AtBeginDocument{%
  \SK@def\ref#1{\SK@\SK@@ref{#1}\SK@ref{#1}}%
  \SK@def\pageref#1{\SK@\SK@@ref{#1}\SK@pageref{#1}}%
  \ifx\vpageref\@undefined\else
    \SK@def\@@vpageref#1[#2]#3{{%
      \let\label\SK@label\let\ref\SK@ref\let\pageref\SK@pageref
      \leavevmode\unskip\SK@\SK@@ref{#3}\SK@@@vpageref#1[#2]{#3}}}%
    \DeclareRobustCommand\vref[1]{%
      \unskip~\ref{#1}%
      {\let\label\SK@label\let\ref\SK@ref\let\pageref\SK@pageref
       \SK@@@vpageref\unskip[\unskip\space]{#1}}}%
  \fi}
\fi
\ifx\SK@ffcite\@empty
\AtBeginDocument{%
  \ifx\HAR@checkdef\@undefined\else
      \expandafter\let\expandafter
         \SK@HAR@bi\csname\string\harvarditem\endcsname
      \expandafter\def\csname\string\harvarditem\endcsname[#1]#2#3#4{%
        \SK@HAR@bi[#1]{#2}{#3}{#4}\SK@\SK@@label{#4}}%
  \fi}
\else
\AtBeginDocument{%
  \ifx\HAR@checkdef\@undefined
    \ifx\ffciten\@undefined
      \SK@def\ffcite#1#{\SK@ffcitea{#1}}%
    \else
      \SK@def\ffciten#1{\SK@\SK@@ref{#1}\SK@ffciten{#1}}%
    \fi
    \SK@def\ffciteauthor#1{\SK@\SK@@ref{#1}\SK@ffciteauthor{#1}}%
    \SK@def\ffcitefullauthor#1{\SK@\SK@@ref{#1}\SK@ffcitefullauthor{#1}}%
    \SK@def\ffciteyear#1{\SK@\SK@@ref{#1}\SK@ffciteyear{#1}}%
  \else
    \SK@def\HAR@checkdef#1#2{%
      \expandafter\SK@\expandafter\SK@@ref\expandafter{#1}%
      \SK@HAR@checkdef{#1}{#2}}%
      \expandafter\let\expandafter
         \SK@HAR@bi\csname\string\harvarditem\endcsname
      \expandafter\def\csname\string\harvarditem\endcsname[#1]#2#3#4{%
        \SK@HAR@bi[#1]{#2}{#3}{#4}\SK@\SK@@label{#4}}%
  \fi}
\def\SK@ffcitea#1#2{%
  \SK@\SK@@ref{#2}\SK@ffcite#1{#2}}
\fi
\def\SK@@ref#1>#2\SK@{%
  \leavevmode\vbox to\z@{%
    \vss
    \SK@refcolor
    \rlap{\vrule\raise .75em%
       \hbox{\underbar{\normalfont\footnotesize\ttfamily#2}}}}}
\endinput
%%
%% End of file `showkeys.sty'.