summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/hyper/cweb.hyp
blob: b528e8126f2e38b528cfa001d1ed592b352f141a (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
%%
%% This is file `cweb.hyp',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% hyper.dtx  (with options: `cweb')
%% 
%% File: hyper.dtx Copyright (C) 1995--1999 Michael Mehlich
%% This program can be redistributed and/or modified under the terms
%% of the LaTeX Project Public License Distributed from CTAN
%% archives in directory macros/latex/base/lppl.txt; either
%% version 1 of the License, or any later version.
\def\fileversion{V4.2d}
\def\filedate{1999/03/09}
\def\docdate{1999/03/09}
%%
%% \CharacterTable
%% {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%%  Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
%%  Digits        \0\1\2\3\4\5\6\7\8\9
%%  Exclamation   \!     Double quote  \"     Hash (number) \#
%%  Dollar        \$     Percent       \%     Ampersand     \&
%%  Acute accent  \'     Left paren    \(     Right paren   \)
%%  Asterisk      \*     Plus          \+     Comma         \,
%%  Minus         \-     Point         \.     Solidus       \/
%%  Colon         \:     Semicolon     \;     Less than     \<
%%  Equals        \=     Greater than  \>     Question mark \?
%%  Commercial at \@     Left bracket  \[     Backslash     \\
%%  Right bracket \]     Circumflex    \^     Underscore    \_
%%  Grave accent  \`     Left brace    \{     Vertical bar  \|
%%  Right brace   \}     Tilde         \~}
%%
\InputIfFileExists{\CwebBaseClass.hyp}{}%
  {\PackageError{hyper}{\CwebBaseClass.hyp not found.\MessageBreak
               Please choose another base document class for cweb\MessageBreak
               or redefine \string\CwebBaseClass to point to a\MessageBreak
               modification document class for the base document class
              }{}%
  }%
\RequirePackage{defpattern}
\chardef\hyper@CatUsCode=\catcode`\_
\catcode`\_=\CatLetter
\let\hyper@cweb@refstepcounter=\hyper@refstepcounter
\def\refstepcounter#1{%
    \def\@tempa{#1}%
    \ifx \@tempa\cweb@string@chunk%
       \protected@edef\@currenthyper{cweb.\cweb@refchunk}%
       \hyper@settype{chunk}%
       \protected@edef\@currentlabel{\cweb@refchunk}%
    \else%
       \hyper@setcurrent%
       \hyper@settype{chunk}%
       \hyper@cweb@refstepcounter{#1}%
    \fi%
}
\let\hyper@CwebRefName\CwebRefName
\def\CwebRefName#1:#2\X{%
    \ifmmode  \gdef\cwbb@toggle_text{\null$\null}%
    \else  \let\cwbb@toggle_text\relax%
    \fi%
    \cwbb@toggle_text%
    \expandafter\ifx\csname hyper@cweb.#1\endcsname\relax%
       \expandafter\ifx\csname hyper@new@cweb.#1\endcsname\relax%
          \PackageWarning{hyper}%
                   {Hyper reference for `cweb.#1' on page \hyper@thepage\space undefined}%
          \hyper@change1\relax%
          \hyper@undef@color{%
             $\langle\,${\cwbb@tex \cwbb@check_dot{#2}\CwebRefNumber{#1}}$\,\rangle$%
          }%
       \else%
          \hyperreference{cweb.#1}{%
             $\langle\,${\cwbb@tex \cwbb@check_dot{#2}\CwebRefNumber{#1}}$\,\rangle$%
          }%
       \fi%
    \else%
       \hyperreference{cweb.#1}{%
          $\langle\,${\cwbb@tex \cwbb@check_dot{#2}\CwebRefNumber{#1}}$\,\rangle$%
       }%
    \fi%
    \cwbb@toggle_text%
}
\ifcase \cweb@structure
    %% hierarchic
    \let\hyper@cwbb@marginal_chunkno\cwbb@marginal_chunkno%
    \def\cwbb@marginal_chunkno{%
      \let\hyper@thechunk\thechunk%
      \def\thechunk{\hyperanchor{cweb.\arabic{chunk}}{\hyper@thechunk}}%
      \hyper@cwbb@marginal_chunkno%
      \let\thechunk\hyper@thechunk%
    }
  \or
    %% flat
    \let\hyper@M\M%
    \def\M#1{%
      \let\hyper@thechunk\thechunk%
      \def\thechunk{\hyperanchor{cweb.\arabic{chunk}}{\hyper@thechunk}}%
      \hyper@M{#1}%
      \let\thechunk\hyper@thechunk%
    }
\fi
\let\hyper@CwebCREt\CwebCREt
\let\hyper@CwebCRsEt\CwebCRsEt
\def\CwebCREt{!}
\def\CwebCRsEt{?}
\defpattern\hyper@split@CwebCrossRef[#2]{\hyperreference{cweb.#2}{#2}}
\defpattern\hyper@split@CwebCrossRef[ #2]{\hyper@split@CwebCrossRef[#2]}
\defpattern\hyper@split@CwebCrossRef[#2,#3]{%
  \hyper@split@CwebCrossRef[#2], %
  \hyper@split@CwebCrossRef[#3]%
}
\defpattern\hyper@split@CwebCrossRef[#2!#3]{%
  \hyper@split@CwebCrossRef[#2]\hyper@CwebCREt%
  \hyper@split@CwebCrossRef[#3]%
}
\defpattern\hyper@split@CwebCrossRef[#2?#3]{%
  \hyper@split@CwebCrossRef[#2]\hyper@CwebCRsEt%
  \hyper@split@CwebCrossRef[#3]%
}
\def\hypersplit@CwebCrossRef[#1]{%
  \edef\hyper@tmp{#1}%
  \expandafter\hyper@split@CwebCrossRef\expandafter[\hyper@tmp]%
}
\let\hyper@CwebCrossRef\CwebCrossRef
\def\CwebCrossRef#1#2.{%
  \hyper@CwebCrossRef{#1}{\hypersplit@CwebCrossRef[#2]}.%
}
\let\hyper@CwebRefList\CwebRefList
\def\hyper@CwebRefName@RefList#1:#2\X{%
  \hyper@CwebRefName\hypersplit@CwebCrossRef[#1]:#2\X%
}
\def\CwebRefList{%
  \let\hyper@CwebReadPPList\CwebReadPPList%
  \let\CwebReadPPList\relax%
  \hyper@CwebRefList%
  \let\X\hyper@CwebRefName@RefList
  \def\CwebCrossRef##1##2.{%
    \quad {\reset@font\footnotesize ##1~\hypersplit@CwebCrossRef[##2].}%
  }%
  \let\CwebReadPPList\hyper@CwebReadPPList%
  \CwebReadPPList%
}
\let\hyper@CwebIndexEntry\CwebIndexEntry
\let\hyper@CwebIndexDeclared\CwebIndexDeclared
\def\CwebIndexDeclared#1]{|#1|}
\defpattern\hyper@cwebindex[#2]{\hyperreference{cweb.#2}{#2}}
\defpattern\hyper@cwebindex[|#2|]{%
  \hyperreference{cweb.#2}{\hyper@CwebIndexDeclared#2]}%
}
\defpattern\hyper@cwebindex[#2, #3]{%
  \hyper@cwebindex[#2], \hyper@cwebindex[#3]%
}
\def\hyper@cweb@index#1{%
  \edef\hyper@tmp{#1}%
  \expandafter\hyper@cwebindex\expandafter[\hyper@tmp]%
}
\def\CwebIndexEntry#1, #2.{%
  \hyper@CwebIndexEntry#1, \hyper@cweb@index{#2}.%
}
\catcode`\_=\hyper@CatUsCode
\endinput
%%
%% End of file `cweb.hyp'.