home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 8 / FreshFishVol8-CD1.bin / useful / text / tex / pastex / macros / latex2e / inputs / feynmf.sty < prev    next >
Text File  |  1994-06-09  |  9KB  |  249 lines

  1. %% 
  2. %% This is file `feynmf.sty', generated 
  3. %% on <1994/6/9> with the docstrip utility (2.2h).
  4. %% 
  5. %% The original source files were:
  6. %% 
  7. %% feynmf.dtx  (with options: `style')
  8. %% 
  9. %% Copyright (C) 1989, 1990, 1992-1994 by Thorsten.Ohl@Physik.TH-Darmstadt.de 
  10. %% 
  11. %% This file is NOT the source for feynmf, because almost all comments 
  12. %% have been stripped from it. It is NOT the preferred form of feynmf 
  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 (feynmf.dtx and feynmf.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. %% Feynmf 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{425}
  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. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  51. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  52. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  53. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  54. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  55. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  56. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  57. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  58. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  59. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  60. \NeedsTeXFormat{LaTeX2e}
  61. {\def\RCS#1#2\endRCS{%
  62.   \ifx$#1%
  63.     \@RCS $#2 \endRCS
  64.   \else
  65.     \@RCS $*: #1#2$ \endRCS
  66.   \fi}%
  67.  \def\@RCS $#1: #2,v #3 #4 #5 #6$ \endRCS{%
  68.    \gdef\filename{#2}%
  69.    \gdef\fileversion{v#3}%
  70.    \gdef\filedate{#4}%
  71.    \gdef\docdate{#4}}%
  72. \RCS feynmf.dtx,v 1.5 1994/05/28 12:10:04 ohl Exp \endRCS}%
  73. \ProvidesPackage{feynmf}[\filedate\space LaTeX2e package]
  74. \typeout{Package: `feynmf'
  75.    \fileversion\space <\filedate> (tho) PRELIMINARY TEST RELEASE}
  76. \wlog{English documentation \@spaces<\docdate> (tho)}
  77. \let\mdqrestore\relax
  78. \@ifundefined{mdqoff}{}{%
  79.   \mdqoff
  80.   \let\mdqrestore\mdqon}
  81. \newwrite\@outfmf
  82. \def\fmfcmd#1{%
  83.   \immediate\write\@outfmf{#1}\ignorespaces}
  84. {\catcode`\%=11\gdef\p@rcent{%}}
  85. \edef\fmf@fileversion{\fileversion}
  86. \def\fmffile#1{%
  87.   \def\thefmffile{#1}%
  88.   \immediate\openout\@outfmf=\thefmffile.mf\relax
  89.   \fmfcmd{\p@rcent\space \thefmffile.mf -- do not edit, %
  90.           generated automatically by \jobname.tex^^J%
  91.           input feynmf^^J%
  92.           \p@rcent\space tracingonline:=tracingtitles:=1;^^J%
  93.           require_RCS_revision "\expandafter\@gobble\fmf@fileversion";}%
  94.   \batchmode
  95.   \font\f@ynmf=\thefmffile
  96.   \errorstopmode
  97.   \ifx\f@ynmf\nullfont
  98.     \def\f@ynmf{feynmf character:}%
  99.     \typeout{%
  100.       feynmf: File \thefmffile.tfm not found:^^J%
  101.       feynmf: Process \thefmffile.mf with METAFONT and then %
  102.               reprocess this file.}%
  103.   \else
  104.     \typeout{%
  105.       feynmf: File \thefmffile.tfm found.^^J%
  106.       feynmf: Nevertheless, if the picture has changed, %
  107.               reprocess \thefmffile.mf.^^J%
  108.       feynmf: If dimension have changed, reprocess \thefmffile.mf %
  109.               and \jobname.tex.}%
  110.   \fi
  111.   \setcounter{fmfchar}{0}}
  112. \let\thefmffile\relax
  113. \newcounter{fmfchar}
  114. \def\endfmffile{%
  115.   \fmfcmd{\p@rcent\space the end.^^J%
  116.           end.^^J%
  117.           endinput;}%
  118.   \let\thefmffile\relax
  119.   \immediate\closeout\@outfmf}
  120. {\catcode`\#=11\gdef\sh@rp{#}}
  121. \let\sharp\sh@rp
  122. \def\fmf@char#1#2{%
  123.   \ifx\thefmffile\relax
  124.     \errhelp={Outside a fmffile environment, I have no clue as to where^^J%
  125.               the METAFONT commands should go.   I will use fmfdeflt.mf^^J%
  126.               for this character, but you'd better fix your code!}
  127.     \errmessage{I detected a fmfchar environment outside of fmffile}
  128.     \fmffile{fmfdeflt}
  129.   \fi
  130.   \stepcounter{fmfchar}%
  131.   \fmfcmd{beginchar(\thefmfchar, #1*\the\unitlength\sh@rp, %
  132.                                  #2*\the\unitlength\sh@rp, 0);^^J%
  133.             "feynmf: \thefmfchar";}%
  134.   \fmfcmd{LaTeX_unitlength:=\the\unitlength;}%
  135.   \fmfinit
  136.   \fmfpen{thin}}
  137. \def\fmfchar(#1,#2){%
  138.   \fmf@char{#1}{#2}%
  139. {\f@ynmf \char\value{fmfchar}}%
  140.   \ignorespaces}
  141. \def\endfmfchar{%
  142.   \fmfposition
  143.   \fmfdraw
  144.   \fmfcmd{endchar;}}
  145. \@namedef{fmfchar*}(#1,#2){%
  146.   \begin{picture}(#1,#2)
  147.     \fmf@char{#1}{#2}%
  148.     {\catcode`\%=14\relax
  149.       \grepfile{%
  150.         \thefmffile.\thefmfchar}{%
  151.         \thefmffile.log}{%
  152.         \thefmffile.t\thefmfchar}}%
  153. \put(0,0){{\f@ynmf \char\value{fmfchar}}}%
  154.       \ignorespaces}
  155. \@namedef{endfmfchar*}{%
  156.     \endfmfchar
  157.     {\catcode`\%=14\relax
  158.       \InputIfFileExists{\thefmffile.t\thefmfchar}{}{%
  159.         \typeout{%
  160.           feynmf: Label file \thefmffile.t\thefmfchar\space not found:^^J%
  161.           feynmf: Process \thefmffile.mf with METAFONT and then %
  162.                   reprocess this file.}}}%
  163.   \end{picture}}
  164. \def\fmfframe(#1,#2)(#3,#4)#5{%
  165.   \leavevmode
  166.   \hbox{\vbox{\vskip#2\unitlength\par
  167.               \hbox{\hskip#1\unitlength#5\hskip#3\unitlength}\par
  168.               \vskip#4\unitlength}}}
  169. \def\fmfpen#1{\fmfcmd{pickup pencircle scaled #1;}}
  170. \def\grepfile#1#2#3{%
  171.   \begingroup
  172.     \edef\pattern{\csname*grep*#1*\endcsname}%
  173.     \immediate\openin\grep@infile #2\relax
  174.     \ifeof\grep@infile
  175.     \else
  176.       \grep@outopenfalse
  177.       \endlinechar=-1
  178.       \catcode`\\=12\relax
  179.       \loop
  180.         \read\grep@infile to \grep@lbuf
  181.         \ifeof\grep@infile
  182.           \grep@contfalse
  183.         \else
  184.           \grep@conttrue
  185.           \ifx\grep@lbuf\empty
  186.           \else
  187.             \expandafter\grep@aline\grep@lbuf\sentinel
  188.             \ifx\pattern\grep@tag
  189.               \ifgrep@outopen
  190.               \else
  191.                  \immediate\openout\grep@outfile #3\relax
  192.                  \immediate\write\grep@outfile{\p@rcent\space #3 %
  193.                     -- generated automatically from #2}%
  194.                  \immediate\write\grep@outfile{\p@rcent\space
  195.                     Think twice before editing THIS file!}%
  196.                  \grep@outopentrue
  197.               \fi
  198.               \immediate\write\grep@outfile{\grep@val}%
  199.             \fi
  200.           \fi
  201.         \fi
  202.       \ifgrep@cont
  203.       \repeat
  204.       \ifgrep@outopen
  205.         \immediate\closeout\grep@outfile
  206.       \fi
  207.     \fi
  208.     \immediate\closein\grep@infile
  209.   \endgroup}
  210. \newread\grep@infile
  211. \newwrite\grep@outfile
  212. \newif\ifgrep@cont
  213. \newif\ifgrep@outopen
  214. \def\grep@aline#1#2\sentinel{%
  215.   \ifx:#1%
  216.     \grep@splitlbuf#2\sentinel
  217.   \else
  218.     \edef\grep@tag{\csname*grep*\endcsname}%
  219.     \def\grep@val{}%
  220.   \fi}
  221. \def\grep@splitlbuf#1:#2\sentinel{%
  222.   \edef\grep@tag{\csname*grep*#1*\endcsname}%
  223.   \def\