home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 2 / Amiga Tools 2.iso / tex / macros / contrib / mcite.sty < prev    next >
Encoding:
Text File  |  1995-03-15  |  5.3 KB  |  163 lines

  1. %% 
  2. %% This is file `mcite.sty', generated 
  3. %% on <1995/3/5> with the docstrip utility (2.2i).
  4. %% 
  5. %% The original source files were:
  6. %% 
  7. %% mcite.dtx  (with options: `package')
  8. %% 
  9. %% Copyright (C) 1994 by Thorsten.Ohl@Physik.TH-Darmstadt.de 
  10. %% 
  11. %% This file is NOT the source for mcite, because almost all comments 
  12. %% have been stripped from it. It is NOT the preferred form of mcite 
  13. %% for making modifications to it. 
  14. %% 
  15. %% Therefore you can NOT redistribute and/or modify THIS file. You can 
  16. %% however redistribute the complete source (mcite.dtx and mcite.ins) 
  17. %% and/or modify it under the terms of the GNU General Public License as 
  18. %% published by the Free Software Foundation; either version 2, or (at 
  19. %% your option) any later version. 
  20. %% 
  21. %% Mcite is distributed in the hope that it will be useful, but 
  22. %% WITHOUT ANY WARRANTY; without even the implied warranty of 
  23. %% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
  24. %% GNU General Public License for more details. 
  25. %% 
  26. %% You should have received a copy of the GNU General Public License 
  27. %% along with this program; if not, write to the Free Software 
  28. %% Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 
  29. %% 
  30. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  31. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  32. %% \CheckSum{206}
  33. %% \CharacterTable
  34. %%  {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
  35. %%   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
  36. %%   Digits        \0\1\2\3\4\5\6\7\8\9
  37. %%   Exclamation   \!     Double quote  \"     Hash (number) \#
  38. %%   Dollar        \$     Percent       \%     Ampersand     \&
  39. %%   Acute accent  \'     Left paren    \(     Right paren   \)
  40. %%   Asterisk      \*     Plus          \+     Comma         \,
  41. %%   Minus         \-     Point         \.     Solidus       \/
  42. %%   Colon         \:     Semicolon     \;     Less than     \<
  43. %%   Equals        \=     Greater than  \>     Question mark \?
  44. %%   Commercial at \@     Left bracket  \[     Backslash     \\
  45. %%   Right bracket \]     Circumflex    \^     Underscore    \_
  46. %%   Grave accent  \`     Left brace    \{     Vertical bar  \|
  47. %%   Right brace   \}     Tilde         \~}
  48. %%
  49. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  50. \NeedsTeXFormat{LaTeX2e}
  51. {\def\RCS#1#2\endRCS{%
  52.   \ifx$#1%
  53.     \@RCS $#2 \endRCS
  54.   \else
  55.     \@RCS $*: #1#2$ \endRCS
  56.   \fi}%
  57.  \def\@RCS $#1: #2,v #3 #4 #5 #6$ \endRCS{%
  58.    \gdef\filename{#2}%
  59.    \gdef\fileversion{v#3}%
  60.    \gdef\filedate{#4}%
  61.    \gdef\docdate{#4}}%
  62. \RCS mcite.dtx,v 1.5 1994/08/18 14:22:26 ohl Exp \endRCS}%
  63. \ProvidesPackage{mcite}[\filedate\space multiple citations]
  64. \typeout{Package: `mcite'
  65.    \fileversion\space <\filedate> (tho) PRELIMINARY TEST RELEASE}
  66. \wlog{English documentation \@spaces<\docdate> (tho)}
  67. \def\@enamedef#1{\expandafter\edef\csname #1\endcsname}
  68. \def\mc@single#1{\global\@enamedef{mc*sg*#1}{}}
  69. \def\mc@head#1#2{\global\@enamedef{mc*hd*#1}{#2}}
  70. \def\mc@tail#1#2{\global\@enamedef{mc*tl*#1}{#2}}
  71. \def\mc@ifsingle#1#2#3{\@ifundefined{mc*sg*#1}{#3}{#2}}
  72. \def\mc@ifhead#1#2#3{\@ifundefined{mc*hd*#1}{#3}{#2}}
  73. \def\mc@iftail#1#2#3{\@ifundefined{mc*tl*#1}{#3}{#2}}
  74. \def\mc@thehead#1{\@nameuse{mc*tl*#1}}
  75. \def\mc@thetail#1{\@nameuse{mc*hd*#1}}
  76. \let\orig@cite\cite
  77. \def\cite{%
  78.   \@ifnextchar[%
  79.     {\PackageWarning{mcite}%
  80.        {optional argument to \protect\cite\space not supported}%
  81.      \@tempswatrue
  82.      \expandafter\mc@citex\mc@gobbleopt}%
  83.     {\@tempswatrue
  84.      \mc@cite}}
  85. \def\mc@gobbleopt[#1]{}
  86. \def\mc@cite#1{%
  87.   \edef\mc@temp{#1}%
  88.   \expandafter\mc@cite@\expandafter{\mc@temp}}
  89. \def\mc@cite@#1{%
  90.   \mc@firsttrue
  91.   \@for\mc@@@:=#1\do{%
  92.     \expandafter\mc@ifstar\mc@@@\sentinel%
  93.       {\ifmc@first
  94.          \PackageWarning{mcite}%
  95.            {tail `\mc@key' appears as first item in \protect\mcite}%
  96.          \mc@dohead
  97.        \else
  98.          \mc@dotail
  99.        \fi}%
  100.       {\mc@dohead}%
  101.     \if@filesw
  102.       \immediate\write\@auxout{\string\citation{\mc@key}}%
  103.     \fi}%
  104.   \expandafter\orig@cite\expandafter{\mc@list}}
  105. \def\mc@dohead{%
  106.   \mc@iftail{\mc@key}%
  107.     {\PackageWarning{mcite}%
  108.        {head `\mc@key' already used as tail of `\mc@thehead{\mc@key}'}}%
  109.     {}%
  110.   \mc@head{\mc@key}{}%
  111.   \edef\mc@curhead{\mc@key}%
  112.   \ifmc@first
  113.     \mc@firstfalse
  114.     \edef\mc@list{\mc@key}%
  115.   \else
  116.     \edef\mc@list{\mc@list,\mc@key}%
  117.   \fi}
  118. \def\mc@dotail{%
  119.   \mc@ifhead{\mc@key}%
  120.     {\PackageWarning{mcite}%
  121.        {tail `\mc@key' already used as head}}%
  122.     {}%
  123.   \mc@tail{\mc@key}{\mc@curhead}}
  124. \def\mc@ifstar#1#2\sentinel#3#4{%
  125.   \ifx*#1%
  126.     \def\mc@key{#2}%
  127.     #3%
  128.   \else
  129.     \def\mc@key{#1#2}%
  130.     #4%
  131.   \fi}
  132. \newif\ifmc@first
  133. \let\orig@bibitem\@bibitem
  134. \def\@bibitem#1{%
  135.   \ifmc@bstsupport
  136.     \mc@iftail{#1}%
  137.       {;\space\ignorespaces}%
  138.       {\ifmc@first\else.\fi\orig@bibitem{#1}}
  139.     \mc@firstfalse
  140.   \else
  141.     \mc@iftail{#1}%
  142.       {\ignorespaces}%
  143.       {\orig@bibitem{#1}}%
  144.   \fi}%
  145. \newif\ifmc@bstsupport
  146. \mc@bstsupportfalse
  147. \def\@lbibitem[#1]#2{%
  148.   \PackageError{mcite}%
  149.     {You can't use the optional argument of \protect\bibitem}%
  150.     {Hey, *I* have to fool around with the labels!}%
  151.   \@bibitem{#2}}
  152. \def\mcbibliography{%
  153.   \mc@bstsupporttrue
  154.   \mc@firsttrue
  155.   \thebibliography}
  156. \def\endmcbibliography{%
  157.   .%
  158.   \endthebibliography}
  159. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  160. \endinput
  161. %% 
  162. %% End of file `mcite.sty'.
  163.