diff options
author | Karl Berry <karl@freefriends.org> | 2006-01-11 23:56:59 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2006-01-11 23:56:59 +0000 |
commit | 1133de32abde55641c550b931d86f861639e1fa9 (patch) | |
tree | 82e9edcb13d801ec3a7a6f5254aa52ea37fc95f7 /Master/texmf-dist/source/latex/rcs/src/rcs-doc.sty | |
parent | 7a720aea13cb3531c86c1aef80c795bd15f4a76d (diff) |
trunk/Master/texmf-dist/source/latex/rcs
git-svn-id: svn://tug.org/texlive/trunk@483 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/rcs/src/rcs-doc.sty')
-rw-r--r-- | Master/texmf-dist/source/latex/rcs/src/rcs-doc.sty | 135 |
1 files changed, 135 insertions, 0 deletions
diff --git a/Master/texmf-dist/source/latex/rcs/src/rcs-doc.sty b/Master/texmf-dist/source/latex/rcs/src/rcs-doc.sty new file mode 100644 index 00000000000..38d4908eec4 --- /dev/null +++ b/Master/texmf-dist/source/latex/rcs/src/rcs-doc.sty @@ -0,0 +1,135 @@ +% $Id: rcs-doc.sty,v 1.4 1995/08/02 12:09:06 schrod Exp $ +%---------------------------------------------------------------------- + +% +% tags for the documentation of rcs style option +% + + +\ProvidesPackage{rcs-doc} + + +% +% Configuration of RCS fields +% + +% keywords in style are prefixed by `Style', in documentation by `Doc'. +\let\RcsHandleStyleDate=\RcsHandleDate % transform StyleDate value +\let\RcsHandleDocDate=\RcsHandleDate % transform DocDate field + +% the revision of rcs.sty is needed by the documentation +\expandafter\RCS \rcs@loaded % creates \RCSStyleRevision + +% name of the author +% +% CAVEAT: Don't define another author name without changing the text +% in the user manual where \rcsAuthor is explained! +\rcsAuthor{schrod}{Joachim Schrod} + + +% +% new tags +% + +\def\rcsField#1{\textsf{#1}} % name of a RCS field (ie, RCS keyword) +\def\Log{\rcsField{Log}} % The `Log' keyword, needed often +\def\Date{\rcsField{Date}} % The `Date' keyword, needed often + + +% +% \macroCall[p]{\\split \[Revision\(: \)1.1\( \]:\) \{\} \\end_value} +% +% \[...\] is param of caller, \(...\) is arg (delimiter) for \split +% empty arg delimiter must be input as `\(\|\)' +% may not be nested, as shown above +% in \macroCall arg: `_' and ` ' are other characters +% \\, \{, and \} produce characters `\', `{' and `}' +% \| is invisible text +% The optional arg is the character to mark the delimiter. By using +% [p] one can mark args with `\(...\)'! + +\newtoks\@macroCall + +\def\macroCall{% + \@ifnextchar[% % ] (Emacs) + \macro@call + {\macro@call[d]}% + } +\def\macro@call[#1]{% + \def\delimChar{#1}% + \begingroup + \catcode`\ =\CatOther + \catcode`\_=\CatOther + \afterassignment\showExample + \global\@macroCall + } + +\newcount\delimCount +\def\showExample{% + \endgroup + \leavevmode + \vtop{% + \reset@font \ttfamily + \let\[\relax \let\]\relax + \let\(\relax \let\)\relax + \chardef\\=`\\ \chardef\{=`\{ \chardef\}=`\} + \def\|{\hskip 1sp}% % must be >0pt, but invisible + \baselineskip\z@skip + \lineskip 2pt + \delimCount\z@ + \hbox{\expandafter\showParam \the\@macroCall \endValue}% + \hbox{\the\@macroCall}% % the example itself + \hbox{\expandafter\showDelimiter \the\@macroCall \(\)\endValue}% + \hrule height \z@ + }% + } + + +\def\showParam #1\[#2\]#3\endValue{% + \hphantom{#1}% + \setbox\z@ \hbox{#2}% + \vbox{\hsize \wd\z@ + \centerline{\tt \#1}% + \vskip 3pt + \hrule + \@@line{\hss \vrule height 3pt \hskip\hsize \vrule \hss}% + }% + \setbox\z@ \hbox{#3}% + \vbox{\hsize \wd\z@ + \centerline{$s$}% + \vskip 3pt + \@@line{\cleaders \hbox{$\mkern 1mu.\mkern 1mu$}\hfill}\nointerlineskip + \@@line{\hskip\hsize \vrule height 3pt \hss}% + }% + } + +\def\showDelimiter #1\(#2\)#3\endValue{% + \hphantom{#1}% + \advance\delimCount \@ne + \setbox\z@ \hbox{#2}% + \ifdim \wd\z@=\z@ + \else + \vtop{\hsize\wd\z@ + \@@line{\hss \vrule depth 3pt \hskip\hsize \vrule \hss}% + \hrule + \vskip 3pt + \centerline{$\delimChar_{\the\delimCount}$}% + }% + \showDelimiter #3\endValue + \fi + } + + + +\endinput + + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +Local Variables: +mode: plain-TeX +TeX-master: t +TeX-brace-indent-level: 4 +indent-tabs-mode: t +TeX-auto-untabify: nil +End: |