% \iffalse
% This is feyn.dtx, which manages the use of the feyn Metafont
%
%% This software is copyright, 1991, 1994, 2001, Norman Gray. 
%% 
%% This program is free software; you can redistribute it and/or
%% modify it under the terms of the GNU General Public License
%% as published by the Free Software Foundation; either version 2
%% of the License, or (at your option) any later version.
%% 
%% This program is distributed in the hope that it will be useful,
%% but WITHOUT ANY WARRANTY; without even the implied warranty of
%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
%% GNU General Public License for more details.
%% 
%% You should have received a copy of the GNU General Public License
%% along with this program; if not, write to the Free Software
%% Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
%% 
%% Author: Norman Gray, norman@astro.gla.ac.uk.
%% Department of Physics and Astronomy, University of Glasgow, UK
%%
%% See the file LICENCE for a copy of the GPL.
%% You can also find an online copy at http://www.gnu.org/copyleft/gpl.html .
%
%<+package|driver>%% RCS Info $Id: feyn.dtx,v 1.11 2002/04/23 11:26:15 norman Exp $
\def\ParseRCSDate$#1: #2 #3 ${\def\FEYN@Date{#2}}
\ParseRCSDate$Date: 2002/04/23 11:26:15 $
\def\filename{feyn}
\def\fileversion{0.1}  %%VERSION%%
\def\filedate{\FEYN@Date}
\def\docdate{\FEYN@Date}
%<+package>\NeedsTeXFormat{LaTeX2e}
%<+package>\ProvidesPackage{feyn}[\filedate\space\fileversion\space textpos]
%<+package>\typeout{Package: `feyn' \fileversion\space<\filedate>}
%
%<*driver>
\documentclass{ltxdoc}
\usepackage{feyn}
\title{The feyn font%
  \thanks{This file has version number \fileversion, last revised
  \filedate}}
\author{Norman Gray\\(\texttt{norman@astro.gla.ac.uk})}
\date{Version \fileversion, \filedate}
\newcommand\Lopt[1]{\textsf {#1}}
\newcommand\file[1]{\texttt {#1}}
\newcommand\Lcount[1]{\textsl {\small#1}}
\newcommand\pstyle[1]{\textsl {#1}}
%% \url macro (url.sty does this better)
\def\setpathdots{\discretionary{.}{}{.}}
\def\setpathslash{\discretionary{/}{}{/}}
{\catcode`\.=\active 
 \catcode`\/=\active 
  \gdef\pathcats{%
    \catcode`\%=12      \catcode`\~=12 
    \catcode`\.=\active  \let.\setpathdots
    \catcode`\/=\active \let/\setpathslash
    \catcode`\#=12      \catcode`\_=12}%
    }
\def\setpath#1{\ttfamily <\nobreak #1\nobreak>\endgroup}
\def\url{\begingroup\pathcats\setpath}
%\RecordChanges
%\OnlyDescription
\parskip=\medskipamount
\parindent=0pt
\begin{document}
\maketitle
\DocInput{feyn.dtx}
\end{document}
%</driver>
%
% \fi
%
%
%
% \CheckSum{175}
%% \CharacterTable
%%  {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
%%   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
%%   Digits        \0\1\2\3\4\5\6\7\8\9
%%   Exclamation   \!     Double quote  \"     Hash (number) \#
%%   Dollar        \$     Percent       \%     Ampersand     \&
%%   Acute accent  \'     Left paren    \(     Right paren   \)
%%   Asterisk      \*     Plus          \+     Comma         \,
%%   Minus         \-     Point         \.     Solidus       \/
%%   Colon         \:     Semicolon     \;     Less than     \<
%%   Equals        \=     Greater than  \>     Question mark \?
%%   Commercial at \@     Left bracket  \[     Backslash     \\
%%   Right bracket \]     Circumflex    \^     Underscore    \_
%%   Grave accent  \`     Left brace    \{     Vertical bar  \|
%%   Right brace   \}     Tilde         \~}
%
%
%
%
%
% 
% \newcommand{\pslash}{p\llap{/\kern-0.3pt}}
% \newcommand{\feynx}{\textsl{feyn}}
% \newcommand{\metafont}{Metafont}
% 
% 
% This describes the font \feynx, which can be used to produce relatively
% simple Feynman diagrams within equations in a \LaTeX\ document.
%
% The other Feynman diagram package which exists is Thorsten Ohl's
% \textsl{feynmf}/\textsl{feynmp} package.  That
% works by creating \metafont\ or MetaPost figures using a preprocessor.
% It's more general than this package, but is at its best when
% creating relatively large diagrams, for figures.
% In contrast, the present system consists of a carefully-designed font
% with which you can write simple diagrams, within equations or within text,
% in a size matching the surrounding text size.
%
% \section{Status}
%
% The font, and this associated style file, should be regarded as
% beta software at present.  The propagators and vertices which are
% implemented are those which \emph{I} needed.  I'd be delighted to
% add more if folk feel they would be useful.
% 
% \section{Description}
% 
% \makeatletter
% \def\refptcirc{\lower\FEYN@maxis \hbox to 0pt{\hss$\circ$\hss}}
% \makeatother
% \begin{table}
% \def\tableskip{\noalign{\smallskip}}
% \halign{$\refptcirc\feyn{#}$%
%     \hfil\quad & $#$\hfil\quad & # \hfil\qquad && # \cr
% \omit Character & \omit  & Name & Width & Height & Depth \cr
% \noalign{\smallskip\hrule\smallskip}
% f & f &	    fermion$^*$		& 2 & 0 & 0 \cr \tableskip
% fs & fs &   short fermion$^*$	& 1 & 0 & 0 \cr \tableskip
% fl & fl &   fermion loop$^*$	& 4 & 2 & 2 \cr \tableskip
% fu & fu &   upward fermion (45$^\circ$)& $\sqrt2$ & $\sqrt2$ & 0 \cr \tableskip
% fd & fd &   downward fermion	& $\sqrt2$ & $\sqrt2$ & 0 \cr \tableskip
% fv & fv &   vertical fermion	& 0 & 2 & 0 \cr \tableskip
% f0 & f0 &   spacer$^*$		& 2 & 0 & 0 \cr \tableskip
% fs0 & fs0 & short spacer$^*$	& 1 & 0 & 0 \cr \tableskip
% g & g &	    gluon/photon$^*$	& 2 & 0 & 0 \cr \tableskip
% gl & gl &   gluon loop$^*$	& 0 (4) & 2 & 0 \cr \tableskip
% glu & glu & gluon loop upsidedown$^*$ & 0 & 0 & 2 \cr \tableskip
% \smallbosonloop &\omit \verb-\smallbosonloop- &
% 	    small gauge-boson loop & 0 & 1.4 & 0 \cr \tableskip
% \bigbosonloop &\omit \verb-\bigbosonloop- &
% 	    big gauge-boson loop & 0 & 3 & 0 \cr \tableskip
% gu & gu &   upward gluon (45$^\circ$)	& $\sqrt2$ & $\sqrt2$ & 0 \cr \tableskip
% gd & gd &   downward gluon	& $\sqrt2$ & $\sqrt2$ & 0 \cr \tableskip
% gv & gv &   vertical gluon	& 0 & 2 & 0 \cr \tableskip
% gvs & gvs & short vertical gluon& 0 & (1) & 0 \cr \tableskip
% m & m &	    massive fermion$^*$	& 2 & 0 & 0 \cr \tableskip
% ms & ms &   short massive fermion$^*$	& 1 & 0 & 0 \cr \tableskip
% h & h &	    ghost$^*$		& 2 & 0 & 0 \cr \tableskip
% hs & hs &   short ghost$^*$	& 1 & 0 & 0 \cr \tableskip
% hu & hu &   upward ghost (45$^\circ$)	& $\sqrt2$ & $\sqrt2$ & 0 \cr \tableskip
% hd & hd &   downward ghost	& $\sqrt2$ & $\sqrt2$ & 0 \cr \tableskip
% x & x &	    counterterm vertex$^*$ & 0 & (2) & (2) \cr \tableskip
% p & p &	    proper vertex$^*$	& (3) & (3) & (3) \cr \tableskip
% c & c &	    complete vertex$^*$	& (3) & (3) & (3) \cr \tableskip
% a & a &	    arrow$^*$		& 0 & 0 & 0 \cr
% }
% \caption[The characters in font \feynx.]{\label{chars}
% The characters in font \feynx.  A~$^*$ means that
% the character is also available in textstyle size.  The~$\circ$ shows the
% reference point of each character.  See the notes on page~\pageref{charnotes}}
% \end{table}
% The characters in the font are shown in table~\ref{chars}, and the macros
% defined in \file{feyn.sty} are described in table~\ref{macros}.
% 
% \iffalse Notes to table~\ref{chars}:\label{charnotes}\fi
% \subsubsection*{Notes to table~\ref{chars}\label{charnotes}}
% \begin{itemize}
% \item[(1)] The short vertical gluon is slightly shorter than the
% ordinary
% \iffalse
% \tracingmacros=2 \tracingcommands=2
% \showthe\fontdimen22\textfont\symfeynman
% \tracingmacros=0 \tracingcommands=0
% \fi
% vertical gluon, and is for the diagram~\hbox{$fsfglgvsffs =
% \feyn{fsfglgvsffs}$}, in which the vertical gluon would not meet the loop
% properly if it were full size.
% \item[(2)] The counterterm vertex is the same height as the proper vertex,
% although the black part is smaller.
% \item[(3)] The proper vertex and the complete vertex are specified
% in terms of a `blob-radius' which is about half a module.  They have
% a width of 2~radii, and a height and depth of 1~radius. 
% \item[(4)] All the gluon loops have zero width, and are centred at
% the centre of the loop. 
% \end{itemize}
% The unnassigned positions in the \feynx\ font are filled
% with an obviously wrong dummy character, so that |$\feyn{A}$|, for example,
% produces $\feyn{A}$.
% 
% \begin{table}
% \begin{description}
% \item[\cs{feyn}] Selects the diagram font.  This must be used
%     within math mode.  \cs{Feyn} selects the text-mode diagram font.
% \item[\cs{Diagram\{\}}] For building more complicated diagrams.  It
%     takes one argument, which is like the contents of an \texttt{\{array\}}
%     environment---a series of formulae separated by \&'s and \verb-\\-.  See
%     below for an example.  The result is a box on the math-axis.
% \item[\cs{maxis}] Raises a formula to the math-axis, which is
%     occasionally useful  within in-text equations: eg
%     |$\Feyn{fglf} - \maxis{\Feyn{faf}}$| produces
%     $\Feyn{fglf} - \maxis{\Feyn{faf}}$.
% \item[\cs{vertexlabel\{p\}\{text\}}] Allows you to label a vertex.  If
%     the first parameter~$p$ is~$\wedge$, the~\emph{text} is placed above the
%     point at which the command is given, if it is~\texttt{\_}, it is
%     placed below. For example, |$\feyn{fa\vertexlabel^{p}f}$| produces
%     $\feyn{fa\vertexlabel^{p}f}$.
% \item[\cs{feynstrut\{h\}\{d\}}] For use within an (eqn)array environment, or
%     the like. It modifies the control sequence \verb-\strut- to be a strut of
%     height~$h$ and depth~$d$, which can therefore be used to space the array
%     out.
% \item[\cs{annotate\{x\}\{y\}\{text\}}] Puts the \emph{text},
%     between dollars,
%     in a zero width box at offset~$(x,y)$ modules from the position of the
%     |\annotate| command (which is generally the first command(s) after 
%     entering math-mode).  Because the \emph{text} is in math-mode, anything
%     that is not maths should be in an |\mbox|.
% \end{description}
% \caption{\label{macros} The macros defined in \file{feyn.sty}}
% \end{table}
% 
% The \feynx\ font is modular, in the sense that all the
% dimensions are in terms of a module of 10pt, and all sizes given
% below are in units of modules.  As well as 10pt, the font has 11pt
% and 12pt versions, and the correct one is selected depending on the
% text size declared (or defaulted) in the |\documentclass| command..
% 
% You draw a diagram by going into math-mode (between \$\dots\$), and selecting
% the diagrams font by the font-changing command \verb-\feyn{}-
% (exactly as you might use \verb-\mathrm- in math-mode). With a couple of
% exceptions, all the characters are obtained by typing a single
% letter, or a couple of letters which form a ligature, so that the
% letter~$f$ in the diagrams font (\verb-$\feyn{f}$-) produces a
% fermion of length~2 (modules), and~$fs$ produces a short fermion of
% length~1.  As usual in maths mode, space characters are ignored, so
% you can add whitespace as required to make the expressions more
% legible.   Some of the more heavily used characters are available in
% both display size and text size, with the text-size version invoked
% by |\Feyn{...}|, so that |\feyn{fglf}| gives $\feyn{fglf}$ and
% |\Feyn{fglf}| gives $\Feyn{fglf}$.  The displaystyle characters
% are all on the math-axis, the textstyle ones are on the text line. 
% 
% Here are some examples.
%
% \makeatletter
% \newdimen\halftextwidth
% \halftextwidth=\textwidth 
%  \divide\halftextwidth by 2
%  \advance\halftextwidth by \tabcolsep
% {\obeyspaces\gdef {\hskip0.5em}}
% {\@makeother\|% \gdef\startcodeexample{\begin{tabular}{p{\halftextwidth}|c}}}
% \newenvironment{codeexample}{%
%   \vskip\medskipamount
%   \def\domyspecials{\do\\\do\{\do\}\do\~\do\&\do\#\do\^\do\_\do\~}
%   \def\verbblock{\bgroup \let\do\@makeother\domyspecials
%     \def\par{\hfil\break}\obeylines\obeyspaces\@verbblock}
%   \def\@verbblock##1!{\ttfamily ##1\egroup}
%   \startcodeexample
% }{%
%     \crcr
%   \end{tabular}
%   \vskip\medskipamount
% }
% \makeatother
%
% \begin{codeexample}
% \verbblock\feyn{\vertexlabel^a f a
%    \vertexlabel^p f\vertexlabel^b}
%    = \displaystyle
% 	{i\delta^{ab} \over \pslash- m_0}!
% &
% \begin{minipage}[t]{\halftextwidth}
% $\feyn{\vertexlabel^a f a
%    \vertexlabel^p f\vertexlabel^b}
%    = \displaystyle
% 	{i\delta^{ab} \over \pslash- m_0}$
% \\
% \end{minipage}
% \end{codeexample}
% This is a simple one.
% 
% \begin{codeexample}
% \verbblock\Diagram{\vertexlabel^a \\
% 		fd \\
% 		    & g\vertexlabel_{\mu,c} \\
% 		\vertexlabel_b fu\\
% 	    }
%     = \displaystyle
% 	ig\gamma_\mu (T^c)_{ab}!
% &
% \begin{minipage}[t]{\halftextwidth}
% $\Diagram{\vertexlabel^a \\
% 		fd \\
% 		    & g\vertexlabel_{\mu,c} \\
% 		\vertexlabel_b fu\\
% 	    }
%     = \displaystyle
% 	ig\gamma_\mu (T^c)_{ab}$
% \end{minipage}
% \end{codeexample}
% The |\Diagram| command lays out its arguments as an array.
% 
% Now a few more diagrams:
% \begin{codeexample}
% \verbblock\feyn{fs f gl f glu f fs}!
% &
% $\feyn{fs f gl f glu f fs}$
% \end{codeexample}
% This is a ``short-fermion fermion gluon-loop fermion
% gluon-loop-upsidedown fermion short-fermion''.
%
% We can also have diagrams in the text, like~$\Feyn{fsfglffs}$, and we can
% annotate the diagrams
% \begin{codeexample}
% \verbblock\annotate{2}{-0.5}{\mbox{counterterm}}
% \annotate{1.3}{0.5}{l}
% \feyn{msmglgvs msxf}!
% &
% \begin{minipage}[t]{\halftextwidth}
% $\annotate{2}{-0.5}{\mbox{counterterm}}
% \annotate{1.3}{0.5}{l}
% \feyn{msmglgvs msxf}$
% \end{minipage}
% \end{codeexample}
% This is a ``short-massive massive gluon-loop short-gluon-vertical
% short-massive counterterm fermion''. 
% 
% The expression for the heavy-fermion self-energy in the \textsc{ope} is 
% \begin{codeexample}
% \verbblock\def\bracket#1{%
%   \langle #1 \rangle}
% \begin{eqnarray*}
% -i\Sigma_{\rm ope} &=&
%     \left[\feyn{faf + fsfglffs 
%                 + \cdots} \right] 1 \\
%     && \quad{}+ 
%           \left[ \feyn{ fxfs0glfs0xf 
%                  + \cdots} \right]
%         \bracket{\overline\psi M \psi} \\
%     && \quad{}+ \left[
%         \Diagram{   &x  &x  \\
%                     &gv &gv \\
%                  fs &fs &fs \\} + \cdots
%         \right]
%         \bracket{G_{\mu\nu}^a G_{\mu\nu}^a}\\
% \end{eqnarray*}!
% &
% \begin{minipage}[t]{\halftextwidth}
% \def\bracket#1{\langle #1 \rangle}
% \begin{eqnarray*}
% -i\Sigma_{\rm ope} &=&
%     \left[\feyn{faf + fsfglffs + \cdots} \right] 1 \\
%     && \quad{}+ \left[ \feyn{ fxfs0glfs0xf + \cdots} \right]
%         \bracket{\overline\psi M \psi} \\
%     && \quad{}+ \left[
%         \Diagram{   &x  &x  \\
%                     &gv &gv \\
%                  fs &fs &fs \\} + \cdots
%         \right]\bracket{G_{\mu\nu}^a G_{\mu\nu}^a}\\
% \end{eqnarray*}
% \end{minipage}
% \end{codeexample}
%
% The Feynman Rules are as follows:
% \begin{verbatim}
% \def\arraystretch{3} \arraycolsep=0.2cm
% \begin{array}{rcl}
% % quark propagator
%     \feyn{\vertexlabel^a f a\vertexlabel^p f\vertexlabel^b}
%     &=& \displaystyle
% 	{i\delta^{ab} \over \pslash- m_0} \\
% % quark-gluon vertex
%     \Diagram{\vertexlabel^a \\ fd \\ & g\vertexlabel_{\mu,c} \\ \vertexlabel_b fu\\}
%     &=& \displaystyle
% 	ig\gamma_\mu (t^c)_{ab} \\
% % gluon propagator
%     \feyn{\vertexlabel^{\mu, a}g a\vertexlabel^k g \vertexlabel^{\nu, b}}
%     &=& \displaystyle
%     {-i\over k^2} \left[g_{\mu\nu} + (a_0 - 1) {k_\mu k_\nu \over k^2}\right]
%     \delta^{ab} \\
% % 3-gluon vertex
%     \arrow{0.7}{0.7}{7}\arrow{0.7}{-0.7}{1}\arrow{2.41}{0}{4}
%     \annotate{0.9}{0.8}{p}\annotate{0.9}{-0.9}{q}
%     \Diagram{\vertexlabel^{\alpha, a}\\
% 	     gd \\
% 	     &gd \\
% 	     &&g\vertexlabel^{r}g \vertexlabel^{\gamma,c} \\
% 	     &gu \\
% 	     gu \\
% 	     \vertexlabel_{\beta,b}}
%     &=& \displaystyle
% 	-g f^{abc} (
% 	g_{\beta\gamma}  (q-r)_\alpha + 
% 	g_{\gamma\alpha} (r-p)_\beta +
% 	g_{\alpha\beta}  (p-q)_\gamma
% 	) \\
% % ghost propagator
%     \feyn{\vertexlabel^a h a\vertexlabel_p h\vertexlabel^b}
%     &=& \displaystyle
% 	{i \over p^2} \delta_{ab} \\
% % ghost-gluon vertex
%     \Diagram{\vertexlabel^b \\ hd \\ & g\vertexlabel^{\mu,a} \\
% 	\vertexlabel_c hu\\}
%     &=& \displaystyle
% 	-g f^{abc}p_\mu
% 	\quad\raise 1ex\hbox{\hsize = 0pt\vtop{
% 	\hbox to \hsize{where $p$ is the momentum of\hss}
% 	\hbox to \hsize{the outgoing positive energy ghost\hss}
% 	}}
% \end{array}
% \end{verbatim}
% \dots giving
% \begin{equation}
% \def\arraystretch{3} \arraycolsep=0.2cm
% \begin{array}{rcl}
%     \feyn{\vertexlabel^a f a\vertexlabel^p f\vertexlabel^b}
%     &=& \displaystyle
% 	{i\delta^{ab} \over \pslash- m_0} \\
%     \Diagram{\vertexlabel^a \\ fd \\ & g\vertexlabel_{\mu,c} \\ \vertexlabel_b fu\\}
%     &=& \displaystyle
% 	ig\gamma_\mu (t^c)_{ab} \\
%     \feyn{\vertexlabel^{\mu, a}g a\vertexlabel^k g \vertexlabel^{\nu, b}}
%     &=& \displaystyle
%     {-i\over k^2} \left[g_{\mu\nu} + (a_0 - 1) {k_\mu k_\nu \over k^2}\right]
%     \delta^{ab} \\
%     \arrow{0.7}{0.7}{7}\arrow{0.7}{-0.7}{1}\arrow{2.41}{0}{4}
%     \annotate{0.9}{0.8}{p}\annotate{0.9}{-0.9}{q}
%     \Diagram{\vertexlabel^{\alpha, a}\\
% 	     gd \\
% 	     &gd \\
% 	     &&g\vertexlabel^{r}g \vertexlabel^{\gamma,c} \\
% 	     &gu \\
% 	     gu \\
% 	     \vertexlabel_{\beta,b}}
%     &=& \displaystyle
% 	-g f^{abc} (
% 	g_{\beta\gamma}  (q-r)_\alpha + 
% 	g_{\gamma\alpha} (r-p)_\beta +
% 	g_{\alpha\beta}  (p-q)_\gamma
% 	) \\
%     \feyn{\vertexlabel^a h a\vertexlabel_p h\vertexlabel^b}
%     &=& \displaystyle
% 	{i \over p^2} \delta_{ab} \\
%     \Diagram{\vertexlabel^b \\ hd \\ & g\vertexlabel^{\mu,a} \\
% 	\vertexlabel_c hu\\}
%     &=& \displaystyle
% 	-g f^{abc}p_\mu
% 	\quad\raise 1ex\hbox{\hsize = 0pt\vtop{
% 	\hbox to \hsize{where $p$ is the momentum of\hss}
% 	\hbox to \hsize{the outgoing positive energy ghost\hss}
% 	}}
% \end{array}
% \end{equation}
%
% The diagrams can also appear as parts of equations:
% \begin{eqnarray}
% \feyn{fcf} &=& \feyn{faf + fpf + fpfpf + \cdots} \\
%     &=& \sum_{n=0}^\infty \feyn{fsafs ( pfsafs)}^n \\
%     &=& \feyn{\frac{fsafs}{1-(pfsafs)}}.
% \end{eqnarray}
%
% \section{Installation}
% 
% If you have not done so already, you need to extract the package
% file from the distribution file using |latex feyn.ins|.  The
% resulting \file{feyn.sty} should be installed in the usual location
% for style files -- that is, something like
% \file{texmf.local/tex/latex/feyn.sty}.  The \metafont\ source files
% \file{*.mf} should be installed in a directory with a location such as
% \file{texmf.local/fonts/source/feyn/}.  That should be all you need
% to do as regards the installation of the fonts -- if your \TeX\
% setup is installed correctly, then the usual font-generation
% commands (such as \file{mktexpk} for example) should work as normal.
%
%
% \StopEventually{}
%
% \section{Implementation}
%    \begin{macrocode}
%<*package>
%    \end{macrocode}
%
% Declare the feyn math font family.  The |\skewchar| for this font
% (see the \TeX book, p431) can be set to zero, since it's a
% completely upright maths font (the least of its peculiarities).  We
% don't have the font in much of a range of sizes. 
%    \begin{macrocode}
\DeclareFontFamily{OMS}{feyn}{\skewchar\font'000}
\DeclareFontShape{OMS}{feyn}{m}{n}{%
	<-10.5>feyn10%
	<10.5-11.5>feyn11%
	<11.5->feyn12%
	}{}
%    \end{macrocode}
%
% Now do the same for the text-size fonts, declaring the textfeyn math
% font family.
%    \begin{macrocode}
\DeclareFontFamily{OMS}{textfeyn}{\skewchar\font'000}
\DeclareFontShape{OMS}{textfeyn}{m}{n}{%
	<-10.5>feyntext10%
	<10.5-11.5>feyntext11%
	<11.5->feyntext12%
	}{}
%    \end{macrocode}
%
% XXX It would be nice to arrange things so that superscripts in
% the feyn font were drawn from cmmi7, or something.  The original
% feyn.sty arranged this with |\scriptfont\diagramfam=\ninmi|, but
% it's not clear what the analogue in the FSS is.
%
% Now declare the `feynman' symbol font, and make the command |\feyn|
% set its argument in that font.  Similarly have |\Feyn| invoke the
% feynman symbol font for the text sizes.
%    \begin{macrocode}
\DeclareSymbolFont{feynman}{OMS}{feyn}{m}{n}
\DeclareSymbolFontAlphabet{\feyn}{feynman}
\DeclareSymbolFont{textfeynman}{OMS}{textfeyn}{m}{n}
\DeclareSymbolFontAlphabet{\Feyn}{textfeynman}
%    \end{macrocode}
%
%
% Now get the size of the `module' (the length of the fermion), and the
% height of the math-axis, from the font.  You might think that the
% math-axis is obtainable from |\fontdimen22| of the font, but we do
% not load it as an |{operator}| font when we invoke
% |\DeclareSymbolFont|, so it does not have all 22 parameters that a
% symbol font (as the \TeX book uses the term, rather than \LaTeXe's
% NFSS).  I confess I don't \emph{really} understand the ins and outs
% of this, but this route is robust and not wrong.
%
% The character |"7F| in the feyn font is blank, but has width 
% |module#| and height |a#| (using the dimensions of the font
% file).  Use this to set the |\FEYN@module| and |\FEYN@maxis|.  Note
% that the `module' used in this package file is twice the module used
% in the \metafont\ files themselves.
% \begin{macro}{\FEYN@module}
% \begin{macro}{\FEYN@maxis}
%    \begin{macrocode}
\DeclareMathSymbol{\FeynSpaceChar}{\mathord}{feynman}{"7F}
\setbox0=\hbox{$\FeynSpaceChar$}
\newdimen\FEYN@module \FEYN@module=2\wd0
\newdimen\FEYN@maxis  \FEYN@maxis=\ht0
%    \end{macrocode}
% \end{macro}
% \end{macro}
%
% \begin{macro}{\Diagram}
% Define the |\Diagram| macro, which lays out a semi-complicated
% diagram in 2-d.
%    \begin{macrocode}
\def\Diagram#1{\setbox0=\hbox{\vbox{\offinterlineskip \let\\\cr
    \halign{&$\displaystyle\feyn{##}$\cr #1\crcr}}}%
%    \end{macrocode}
% At this point, |\box0| has zero depth.  It must be an hbox, because
% we're fiddling with its height within a enclosing |\vbox|.  See the
% \TeX book pp 388--389. This takes advantage of appx G, rule 8 to
% move box0 down by the height of the math axis.  The construction
% |\dp0 = -2\fontdimen22 \textfont2| also works, in the sense of
% moving the box onto the math axis, but makes the box too small,
% which means that surrounding text can encroach.
%    \begin{macrocode}
    \@tempdima=\ht0
    \advance\@tempdima by 2\FEYN@maxis \ht0=\@tempdima
    \vcenter{\box0}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\maxis}
% Raise the argument to the math axis.
%    \begin{macrocode}
\def\maxis#1{\raise\FEYN@maxis \hbox{$#1$}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\vertexlabel}
% The command |\vertexlabel^{text}| or |\vertexlabel_{text}| positions
% the |{text}| in maths mode either above or below, respectively, the
% current position.  It's used at between characters to label a vertex.
%    \begin{macrocode}
\def\vertexlabel#1#2{\setbox0=\hbox to 0pt{\hss$\scriptstyle #2$\hss}
  \ifcat #1^
    \vbox to 0pt{\vss\box0\nointerlineskip\kern2\FEYN@maxis}
    %\vbox to 0pt{\vss\box0\nointerlineskip\kern6pt}
  \else\ifcat #1_
    \vbox to 0pt{\kern\FEYN@maxis\nointerlineskip\box0\vss}
    %\vbox to 0pt{\kern2pt\nointerlineskip\box0\vss}
  \else
    \PackageError{feyn}
      {Bad arguments for \string\vertexlabel}
      {Usage: \string\vertexlabel^{text} or \string\vertexlabel_{text}}
  \fi\fi
  }
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\annotate}
% The |\annotate| command takes $x$ and $y$ coordinates in units of
% modules, and text (in math mode) to be placed on a |\diagram|. 
%    \begin{macrocode}
\def\annotate#1#2#3{\vcenter to 0pt{\vss
    \hbox to 0pt{\hskip #1\FEYN@module\hbox to 0pt{\hss$\scriptstyle #3$\hss}\hss
    }\vskip #2\FEYN@module}}
%    \end{macrocode}
% \end{macro}
% \begin{macro}{\tannotate}
% The |\tannotate| command is just the same, but the annotating text
% is in horizontal mode.
%    \begin{macrocode}
\def\tannotate#1#2#3{\vcenter to 0pt{\vss
    \hbox to 0pt{\hskip #1\FEYN@module\hbox to 0pt{\hss #3\hss}\hss
    }\vskip #2\FEYN@module}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\feynstrut}
% The macro |\feynstrut#1#2| defines |\strut| to have a height
% |#1| modules, and depth |#2| modules.
%    \begin{macrocode}
\def\feynstrut#1#2{\setbox\strutbox=\hbox{\vrule
	height #1\FEYN@module depth #2\FEYN@module width 0pt}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\arrow}
% The command |\arrow#1#2#3| puts an arrow of gradient |#3|${}\times 45^\circ$
% at position |(#1,#2)|(modules).  This doesn't work -- the |\char|
% results in a |\rm| character appearing, rather than a |\feyn|
% character.  Putting in a symbol like `+' has the same effect, but
% putting in, say, `a' works as expected.  In other words, it's to do
% with the character's mathcode, and the |\char|
% should be replaced by a |\mathchar"7?\@tempcnta| somehow.  The
% problem is that that depends on the parameter |\fam| having a
% suitable value.  It's not clear to me what this corresponds to in
% \LaTeXe.  See the \TeX book, chapter 17.
%    \begin{macrocode}
\def\arrow#1#2#3{\@tempcnta="28 \advance\@tempcnta by #3\vcenter to 0pt{\vss
    \hbox to 0pt{\hskip #1\FEYN@module\hbox to 0pt{$\feyn{\char\@tempcnta}$}\hss
    }\vskip #2\FEYN@module}}
%    \end{macrocode}
% \end{macro}
%
% Declare symbols.  All of these are ligatures.
%    \begin{macrocode}
\DeclareMathSymbol{\wfermion}{0}{feynman}{"64}
%\DeclareMathSymbol{\Wfermion}{0}{feynman}{"44}
\DeclareMathSymbol{\hfermion}{0}{feynman}{"6B}
%\DeclareMathSymbol{\Hfermion}{0}{feynman}{"4B}
\DeclareMathSymbol{\shfermion}{0}{feynman}{"6C}
%\DeclareMathSymbol{\sHfermion}{0}{feynman}{"4C}
\DeclareMathSymbol{\whfermion}{0}{feynman}{"6D}
%\DeclareMathSymbol{\wHfermion}{0}{feynman}{"4D}
\DeclareMathSymbol{\gvcropped}{0}{feynman}{"07}
%    \end{macrocode}
% But the following are not ligatures.
%    \begin{macrocode}
\DeclareMathSymbol{\bigbosonloop}{0}{feynman}{"21}
\DeclareMathSymbol{\Bigbosonloop}{7}{feynman}{"21}
\DeclareMathSymbol{\smallbosonloop}{0}{feynman}{"20}
%    \end{macrocode}
%
%
% \Finale
\endinput
