Debian Codegraph @

texmf-dist/source/latex/rcs/src/rcs-doc.sty

raw
1 % $Id: rcs-doc.sty,v 1.4 1995/08/02 12:09:06 schrod Exp $
2 %----------------------------------------------------------------------
3
4 %
5 % tags for the documentation of rcs style option
6 %
7
8
9 \ProvidesPackage{rcs-doc}
10
11
12 %
13 % Configuration of RCS fields
14 %
15
16 % keywords in style are prefixed by `Style', in documentation by `Doc'.
17 \let\RcsHandleStyleDate=\RcsHandleDate % transform StyleDate value
18 \let\RcsHandleDocDate=\RcsHandleDate % transform DocDate field
19
20 % the revision of rcs.sty is needed by the documentation
21 \expandafter\RCS \rcs@loaded % creates \RCSStyleRevision
22
23 % name of the author
24 %
25 % CAVEAT: Don't define another author name without changing the text
26 % in the user manual where \rcsAuthor is explained!
27 \rcsAuthor{schrod}{Joachim Schrod}
28
29
30 %
31 % new tags
32 %
33
34 \def\rcsField#1{\textsf{#1}} % name of a RCS field (ie, RCS keyword)
35 \def\Log{\rcsField{Log}} % The `Log' keyword, needed often
36 \def\Date{\rcsField{Date}} % The `Date' keyword, needed often
37
38
39 %
40 % \macroCall[p]{\\split \[Revision\(: \)1.1\( \]:\) \{\} \\end_value}
41 %
42 % \[...\] is param of caller, \(...\) is arg (delimiter) for \split
43 % empty arg delimiter must be input as `\(\|\)'
44 % may not be nested, as shown above
45 % in \macroCall arg: `_' and ` ' are other characters
46 % \\, \{, and \} produce characters `\', `{' and `}'
47 % \| is invisible text
48 % The optional arg is the character to mark the delimiter. By using
49 % [p] one can mark args with `\(...\)'!
50
51 \newtoks\@macroCall
52
53 \def\macroCall{%
54 \@ifnextchar[% % ] (Emacs)
55 \macro@call
56 {\macro@call[d]}%
57 }
58 \def\macro@call[#1]{%
59 \def\delimChar{#1}%
60 \begingroup
61 \catcode`\ =\CatOther
62 \catcode`\_=\CatOther
63 \afterassignment\showExample
64 \global\@macroCall
65 }
66
67 \newcount\delimCount
68 \def\showExample{%
69 \endgroup
70 \leavevmode
71 \vtop{%
72 \reset@font \ttfamily
73 \let\[\relax \let\]\relax
74 \let\(\relax \let\)\relax
75 \chardef\\=`\\ \chardef\{=`\{ \chardef\}=`\}
76 \def\|{\hskip 1sp}% % must be >0pt, but invisible
77 \baselineskip\z@skip
78 \lineskip 2pt
79 \delimCount\z@
80 \hbox{\expandafter\showParam \the\@macroCall \endValue}%
81 \hbox{\the\@macroCall}% % the example itself
82 \hbox{\expandafter\showDelimiter \the\@macroCall \(\)\endValue}%
83 \hrule height \z@
84 }%
85 }
86
87
88 \def\showParam #1\[#2\]#3\endValue{%
89 \hphantom{#1}%
90 \setbox\z@ \hbox{#2}%
91 \vbox{\hsize \wd\z@
92 \centerline{\tt \#1}%
93 \vskip 3pt
94 \hrule
95 \@@line{\hss \vrule height 3pt \hskip\hsize \vrule \hss}%
96 }%
97 \setbox\z@ \hbox{#3}%
98 \vbox{\hsize \wd\z@
99 \centerline{$s$}%
100 \vskip 3pt
101 \@@line{\cleaders \hbox{$\mkern 1mu.\mkern 1mu$}\hfill}\nointerlineskip
102 \@@line{\hskip\hsize \vrule height 3pt \hss}%
103 }%
104 }
105
106 \def\showDelimiter #1\(#2\)#3\endValue{%
107 \hphantom{#1}%
108 \advance\delimCount \@ne
109 \setbox\z@ \hbox{#2}%
110 \ifdim \wd\z@=\z@
111 \else
112 \vtop{\hsize\wd\z@
113 \@@line{\hss \vrule depth 3pt \hskip\hsize \vrule \hss}%
114 \hrule
115 \vskip 3pt
116 \centerline{$\delimChar_{\the\delimCount}$}%
117 }%
118 \showDelimiter #3\endValue
119 \fi
120 }
121
122
123
124 \endinput
125
126
127
128 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
129 Local Variables:
130 mode: plain-TeX
131 TeX-master: t
132 TeX-brace-indent-level: 4
133 indent-tabs-mode: t
134 TeX-auto-untabify: nil
135 End: