| 1 |
% This is a stripped version of rcs.sty, |
| 2 |
% all comment lines and empty lines were discarded to save space. YOU |
| 3 |
% ARE NOT ALLOWED to use this file for your own work. You may ONLY |
| 4 |
% redistribute it as part of the complete distribution you received it. |
| 5 |
% This file was created at Thu Nov 30 15:51:58 UTC 1995. |
| 6 |
|
| 7 |
% The original file may be retrieved |
| 8 |
% from CTAN, directory macros/tex/latex/contrib/supported/rcs/.. |
| 9 |
|
| 10 |
% ====================================================================== |
| 11 |
|
| 12 |
\ifx \rcs@loaded\undefined |
| 13 |
\def\rcs@loaded{$StyleRevision: 2.9 $} |
| 14 |
\else |
| 15 |
\PackageWarningNoLine{rcs}% |
| 16 |
{Some other package already uses namespace `rcs'} |
| 17 |
\fi |
| 18 |
\begingroup |
| 19 |
\def\RCSPackage#1#2 $#3: #4 #5\endRCS $#6: #7 #8\endRCS{% |
| 20 |
\def\date{#4}\def\id{v#7}% |
| 21 |
\ProvidesPackage{#1}[\date\space\id\space #2]% |
| 22 |
} |
| 23 |
\RCSPackage{rcs}{typeset info from RCS fields} |
| 24 |
$StyleDate: 1995/08/02 12:09:07 $: 9999/00/00 \endRCS |
| 25 |
$StyleRevision: 2.9 $: 0.0 \endRCS |
| 26 |
\endgroup |
| 27 |
\ifx \CatEscape\undefined |
| 28 |
\chardef\CatEscape=0 |
| 29 |
\chardef\CatOpen=1 |
| 30 |
\chardef\CatClose=2 |
| 31 |
\chardef\CatIgnore=9 |
| 32 |
\chardef\CatLetter=11 |
| 33 |
\chardef\CatOther=12 |
| 34 |
\chardef\CatActive=13 |
| 35 |
\chardef\CatUsCode=\catcode`\_ |
| 36 |
\fi |
| 37 |
\catcode`\_=\CatLetter % top level macro file |
| 38 |
\def\RcsEmptyValue{} |
| 39 |
\def\rcs_split_field #1: #2 :#3\end_value{% |
| 40 |
\def\RCS_keyword{#1}% |
| 41 |
\def\RCS_value{#2}% |
| 42 |
\ifx \RCS_value\empty |
| 43 |
\let\RCS_value\RcsEmptyValue |
| 44 |
\fi |
| 45 |
} |
| 46 |
\def\RCS $#1${% |
| 47 |
\rcs_split_field #1: {} :\end_value |
| 48 |
\expandafter\let \csname RCS\rcs_raw_if_handle\RCS_keyword\endcsname |
| 49 |
\RCS_value |
| 50 |
\csname RcsHandle\RCS_keyword\endcsname |
| 51 |
} |
| 52 |
\def\rcs_raw_if_handle{% |
| 53 |
\@ifundefined{RcsHandle\RCS_keyword}{}{Raw}% |
| 54 |
} |
| 55 |
\def\RcsHandleDate{% |
| 56 |
\ifx \today\undefined |
| 57 |
\expandafter\let \csname RCS\RCS_keyword\endcsname \RCS_value |
| 58 |
\else |
| 59 |
\ifx \RCS_value\RcsEmptyValue |
| 60 |
\@namedef{RCS\RCS_keyword}{\today}% |
| 61 |
\let\RCSTime\empty |
| 62 |
\else |
| 63 |
\expandafter\rcs_set_date \RCS_value\end_date |
| 64 |
\fi |
| 65 |
\fi |
| 66 |
} |
| 67 |
\def\rcs_set_date #1/#2/#3 #4\end_date{% |
| 68 |
\begingroup |
| 69 |
\day #3 % <-- space! |
| 70 |
\month #2 % <-- space! |
| 71 |
\year #1 % <-- space! |
| 72 |
\expandafter\xdef \csname RCS\RCS_keyword\endcsname {\today}% |
| 73 |
\endgroup |
| 74 |
\def\RCSTime{#4}% |
| 75 |
} |
| 76 |
\newtoks\rcsLogIntro |
| 77 |
\rcsLogIntro={} |
| 78 |
\def\rcsAuthor#1#2{\@namedef{rcs_author:#1}{#2}} |
| 79 |
\def\RCS_get_author#1{% |
| 80 |
\@ifundefined{rcs_author:#1}{#1}{\@nameuse{rcs_author:#1}}% |
| 81 |
} |
| 82 |
\def\RcsLogStyle{% |
| 83 |
\def\RcsLogHeading{\subsubsection*}% |
| 84 |
\footnotesize |
| 85 |
} |
| 86 |
\def\rcs_log_hdr#1,v\end_value{% |
| 87 |
\@rcs_empty_log@false |
| 88 |
\RcsLogHeading{\RcsLogHeadingName #1}% |
| 89 |
\the\rcsLogIntro |
| 90 |
} |
| 91 |
\def\rcs_empty_log_value{% |
| 92 |
\global\@rcs_empty_log@true % that's most probably in a group! |
| 93 |
\RcsUnknownFile % text for unknown file name |
| 94 |
,v% % assert calling env |
| 95 |
} |
| 96 |
\newif\if@rcs_empty_log@ |
| 97 |
\def\RcsLogHeadingName{Revision Log for \tt} % file name in monospace |
| 98 |
\def\RcsUnknownFile{\rm $\langle\,$Unknown file name$\,\rangle$} |
| 99 |
\def\RcsEmptyLog{{\itshape No log entries available.}} |
| 100 |
\def\RcsLogRevision#1#2#3#4{% |
| 101 |
\item [Revision #1]% |
| 102 |
(created at \RcsLogDate #2\endDate\space \RcsLogTime{#3} % <-- space! |
| 103 |
by \RCS_get_author{#4})\\\relax |
| 104 |
} |
| 105 |
\def\RcsLogDate #1/#2/#3\endDate{% |
| 106 |
\begingroup |
| 107 |
\day #3 % <-- space! |
| 108 |
\month #2 % <-- space! |
| 109 |
\year #1 % <-- space! |
| 110 |
\today |
| 111 |
\endgroup |
| 112 |
} |
| 113 |
\def\RcsLogTime#1{\ignorespaces} |
| 114 |
\def\rcs_settime{% |
| 115 |
\def\RcsLogTime##1{[##1]}% |
| 116 |
} |
| 117 |
\def\rcslog{% |
| 118 |
\@ifnextchar[% % ] (Emacs) |
| 119 |
\rcslog_configure |
| 120 |
{\rcslog_configure[]}% |
| 121 |
} |
| 122 |
\def\rcslog_configure[#1]{% |
| 123 |
\let\Revision\rcslog_revision |
| 124 |
\let\settime\rcs_settime |
| 125 |
\RcsLogStyle |
| 126 |
#1% |
| 127 |
\afterassignment\rcslog_skipcr |
| 128 |
\let\next |
| 129 |
} |
| 130 |
\def\rcslog_skipcr{% |
| 131 |
\ifx \next $% |
| 132 |
\def\next{\rcslog_field $}% |
| 133 |
\else\ifx \next\par |
| 134 |
\let\next\rcslog_field |
| 135 |
\else |
| 136 |
\PackageError{rcs}{Missing RCS Log field in environment}{% |
| 137 |
The RCS Log field must be the very first text in the rcslog\MessageBreak |
| 138 |
environment. I will discard the rest of your input line and try to\MessageBreak |
| 139 |
recover then. If you think this won't work, exit now.\MessageBreak |
| 140 |
Otherwise press <Return> and cross your fingers!} |
| 141 |
\let\next\rcslog_discard_line |
| 142 |
\fi\fi |
| 143 |
\next |
| 144 |
} |
| 145 |
\def\rcslog_discard_line{% |
| 146 |
\begingroup |
| 147 |
\obeylines |
| 148 |
\rcslog_gobble_line |
| 149 |
} |
| 150 |
\begingroup |
| 151 |
\obeylines |
| 152 |
\gdef\rcslog_gobble_line #1^^M{% |
| 153 |
\endgroup% |
| 154 |
\afterassignment\rcslog_skipcr% |
| 155 |
\let\next% |
| 156 |
} |
| 157 |
\endgroup |
| 158 |
\def\rcslog_field{% |
| 159 |
\begingroup |
| 160 |
\obeylines |
| 161 |
\rcslog_get_field |
| 162 |
} |
| 163 |
\begingroup |
| 164 |
\obeylines |
| 165 |
\gdef\rcslog_get_field #1^^M{% |
| 166 |
\endgroup% |
| 167 |
\rcslog_set_field{#1}% |
| 168 |
} |
| 169 |
\endgroup |
| 170 |
\def\rcslog_set_field#1{% |
| 171 |
\let\RcsEmptyValue\rcs_empty_log_value |
| 172 |
\RCS #1% |
| 173 |
\expandafter\rcs_log_hdr \RCS_value\end_value |
| 174 |
\list{}\RcsLogListStyle % empty label, layout configurable |
| 175 |
\if@rcs_empty_log@ |
| 176 |
\item []\RcsEmptyLog % supply missing item |
| 177 |
\fi |
| 178 |
} |
| 179 |
\def\RcsLogListStyle{% |
| 180 |
\global\@listdepth\z@ |
| 181 |
\labelwidth\z@ % item label w/o fixed size |
| 182 |
\itemindent -\leftmargin % move label before start of line |
| 183 |
\advance\itemindent \labelsep % label was moved too much |
| 184 |
\def\makelabel##1{\bf ##1}% % how to typeset labels |
| 185 |
\parsep\z@skip % no space between pars in items |
| 186 |
\listparindent 1em % <-- space! indent pars in items |
| 187 |
}% |
| 188 |
\let\endrcslog\endtrivlist |
| 189 |
\def\rcslog_revision{% |
| 190 |
\begingroup |
| 191 |
\obeylines |
| 192 |
\rcslog_get_revinfo |
| 193 |
} |
| 194 |
\begingroup |
| 195 |
\obeylines |
| 196 |
\gdef\rcslog_get_revinfo #1 #2 #3 #4^^M{% |
| 197 |
\endgroup% |
| 198 |
\RcsLogRevision{#1}{#2}{#3}{#4}% |
| 199 |
} |
| 200 |
\endgroup |
| 201 |
\def\RCSdate $#1${% |
| 202 |
\RCS $#1$% |
| 203 |
\expandafter\date \expandafter{\csname RCS\RCS_keyword\endcsname}% |
| 204 |
} |
| 205 |
\def\RCSID{% |
| 206 |
\@ifnextchar\bgroup |
| 207 |
\rcsid_get_field |
| 208 |
\rcs_id |
| 209 |
} |
| 210 |
\def\rcsid_get_field#1{\rcs_id #1} |
| 211 |
\def\rcs_id $#1${% |
| 212 |
\RCS $#1$% |
| 213 |
\begingroup |
| 214 |
\let\protect\noexpand |
| 215 |
\xdef\@oddfoot{% |
| 216 |
\reset@font |
| 217 |
\protect\framebox[\textwidth]{\RCS_keyword: \RCS_value}% |
| 218 |
}% |
| 219 |
\endgroup |
| 220 |
\global\let\@evenfoot\@oddfoot |
| 221 |
} |
| 222 |
\def\RCSdef $#1${% |
| 223 |
\typeout{RCS field: $#1$}% |
| 224 |
\RCS $#1$% |
| 225 |
} |
| 226 |
\catcode`\_=\CatUsCode |
| 227 |
\endinput |