%%
%% This is file `MagmaTeX.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% MagmaTeX.dtx  (with options: `magma,code')
%% 
%% Copyright (C) 2002 by Don Taylor
%% 
%% This file provides LaTeX and plain TeX versions of the MagmaTeX macros
%% that support literate Magma scripts. They are based on the plain TeX
%% macros (lambdaTeX) written for Haskell by Patryk Zadarnowski.
%% The original copyright notice for lambdaTeX is reproduced below.
%%
%% Copyright � 2000 Patryk Zadarnowski �pat@jantar.org�
%%
%% Redistribution  and  use  in  source  and  binary  forms,  with  or  without
%% modification, are permitted provided  that the following conditions are met:
%% (1) Redistributions of  source code must retain the  above copyright notice,
%% this list  of conditions and the following  disclaimer.  (2) Redistributions
%% in  binary form  must reproduce  the above  copyright notice,  this  list of
%% conditions and  the following disclaimer  in the documentation  and/or other
%% materials provided  with the distribution.  (3)  The name of  any author may
%% not  be used  to  endorse or  promote  products derived  from this  software
%% without their specific prior written permission.
%%
%% THIS SOFTWARE IS  PROVIDED ``AS IS'' AND ANY  EXPRESS OR IMPLIED WARRANTIES,
%% INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
%% FITNESS FOR  A PARTICULAR  PURPOSE, ARE DISCLAIMED.   IN NO EVENT  SHALL THE
%% AUTHORS BE LIABLE FOR  ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
%% OR  CONSEQUENTIAL DAMAGES  (INCLUDING, BUT  NOT LIMITED  TO,  PROCUREMENT OF
%% SUBSTITUTE  GOODS OR SERVICES;  LOSS OF  USE, DATA  OR PROFITS;  OR BUSINESS
%% INTERRUPTION)  HOWEVER CAUSED  AND ON  ANY THEORY  OF LIABILITY,  WHETHER IN
%% CONTRACT,  STRICT LIABILITY,  OR  TORT (INCLUDING  NEGLIGENCE OR  OTHERWISE)
%% ARISING IN ANY WAY  OUT OF THE USE OF THIS SOFTWARE,  EVEN IF ADVISED OF THE
%% POSSIBILITY OF SUCH DAMAGE.
%% ********************************************************************
%%
%% \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         \~}
\NeedsTeXFormat{LaTeX2e}[1996/12/01]
\ProvidesPackage{MagmaTeX}
           [2002/09/05 v1.23
   LaTeX package for literate Magma]
\def\everymm{}
\def\beforemm{\vskip 6pt plus3pt minus1pt}
\def\aftermm{\vskip 4pt plus3pt minus1pt}
\let\mm@ndx=\relax
\newif\ifmm@numbered \mm@numberedfalse
\newcount\c@MagmaLineNo \c@MagmaLineNo\z@
\def\mm@CodeLineNo{\global\advance\c@MagmaLineNo\@ne
  \rlap{\quad\llap{\reset@font\scriptsize\arabic{MagmaLineNo}}}}
\def\LineNumbers{\let\mm@ndx\mm@CodeLineNo}
\def\NoLineNumbers{\let\mm@ndx=\relax}
\DeclareOption{linenumbers}{\LineNumbers}
\ProcessOptions
\newdimen\mm@sz
\mm@sz=\f@size pt
\newdimen\mm@ssz
\mm@ssz=0.8\mm@sz
\def\mm@size{\mm@sz}%
\DeclareFontFamily{OT1}{mmphv}{\hyphenchar\font=-1}
\DeclareFontShape{OT1}{mmphv}{m}{n}{ <-> s * [0.91] phvr}{}
\DeclareFontShape{OT1}{mmphv}{b}{n}{ <-> s * [0.91] phvb}{}
\DeclareFontShape{OT1}{mmphv}{m}{sl}{<-> s * [0.91] phvro}{}
\DeclareFontShape{OT1}{mmphv}{m}{sc}{<-> s * [0.91] phvrc}{}
\DeclareFontShape{OT1}{mmphv}{m}{c}{ <-> s * [0.91] phvrrn}{}
\DeclareFontShape{OT1}{mmphv}{b}{sl}{<-> s * [0.91] phvbo}{}
\DeclareFontFamily{OT1}{mmpcr}{\hyphenchar\font=-1}
\DeclareFontShape{OT1}{mmpcr}{m}{n}{<-> pcrr}{}
\DeclareFixedFont{\mm@symface}{OT1}{mmphv}{m}{n}{\mm@sz}
\DeclareMathSizes{\mm@ssz}{}{}{}
\def\mm@keyface{\fontsize{\mm@size}\z@ \usefont{OT1}{mmphv}{b}{n}}%
\def\mm@funface{\fontsize{\mm@size}\z@ \usefont{OT1}{mmphv}{m}{n}}%
\def\mm@varface{\fontsize{\mm@size}\z@ \usefont{OT1}{mmphv}{m}{sl}}%
\def\mm@intrface{\fontsize{\mm@size}\z@ \usefont{OT1}{mmphv}{m}{sc}}%
\def\mm@boolface{\fontsize{\mm@size}\z@ \usefont{OT1}{mmphv}{m}{c}}%
\def\mm@relface{\fontsize{\mm@size}\z@ \usefont{OT1}{mmphv}{b}{sl}}%
\def\mm@consface{\fontsize{\mm@size}\z@ \usefont{OT1}{mmphv}{b}{sl}}%
\def\mm@numface{\fontsize{\mm@size}\z@ \usefont{OT1}{mmphv}{m}{n}}%
\def\mm@strface{\fontsize{\mm@size}\z@ \usefont{OT1}{mmpcr}{m}{n}}%
\newdimen\mmleftskip    \mmleftskip=30pt
\newdimen\mmrightskip   \mmrightskip=10pt
\newdimen\mmcommentskip \mmcommentskip=1em
\newdimen\mmwordspace
\newdimen\mmspacewidth
\newdimen\mmtabwidth
\setbox0=\hbox{N}
\mmwordspace=.5\wd0
\mmspacewidth=\wd0
\mmtabwidth=8\wd0
\def\Magma{{\mm@intrface Magma }}
\def\typeset#1#2{\expandafter\def\csname<#1>\endcsname{#2}}
\typeset{assert}{{\mm@keyface assert}}
\typeset{assigned}{{\mm@keyface assigned}}
\typeset{break}{{\mm@keyface break}}
\typeset{by}{{\mm@keyface by}}
\typeset{case}{{\mm@keyface case}}
\typeset{clear}{{\mm@keyface clear}}
\typeset{continue}{{\mm@keyface continue}}
\typeset{declare}{{\mm@keyface declare}}
\typeset{default}{{\mm@keyface default}}
\typeset{delete}{{\mm@keyface delete}}
\typeset{div}{{\mm@keyface div}}
\typeset{do}{{\mm@keyface do}}
\typeset{elif}{{\mm@keyface elif}}
\typeset{else}{{\mm@keyface else}}
\typeset{end}{{\mm@keyface end}}
\typeset{error}{{\mm@keyface error}}
\typeset{exists}{{\mm@keyface exists}}
\typeset{exit}{{\mm@keyface exit}}
\typeset{for}{{\mm@keyface for}}
\typeset{forall}{{\mm@keyface forall}}
\typeset{forward}{{\mm@keyface forward}}
\typeset{fprintf}{{\mm@keyface fprintf}}
\typeset{freeze}{{\mm@keyface freeze}}
\typeset{function}{{\mm@keyface function}}
\typeset{if}{{\mm@keyface if}}
\typeset{iload}{{\mm@keyface iload}}
\typeset{import}{{\mm@keyface import}}
\typeset{intrinsic}{{\mm@keyface intrinsic}}
\typeset{is}{{\mm@keyface is}}
\typeset{local}{{\mm@keyface local}}
\typeset{load}{{\mm@keyface load}}
\typeset{mod}{{\mm@keyface mod}}
\typeset{print}{{\mm@keyface print}}
\typeset{printf}{{\mm@keyface printf}}
\typeset{procedure}{{\mm@keyface procedure}}
\typeset{quit}{{\mm@keyface quit}}
\typeset{read}{{\mm@keyface read}}
\typeset{readi}{{\mm@keyface readi}}
\typeset{repeat}{{\mm@keyface repeat}}
\typeset{require}{{\mm@keyface require}}
\typeset{requirege}{{\mm@keyface requirege}}
\typeset{requirerange}{{\mm@keyface requirerange}}
\typeset{restore}{{\mm@keyface restore}}
\typeset{return}{{\mm@keyface return}}
\typeset{save}{{\mm@keyface save}}
\typeset{select}{{\mm@keyface select}}
\typeset{then}{{\mm@keyface then}}
\typeset{time}{{\mm@keyface time}}
\typeset{to}{{\mm@keyface to}}
\typeset{until}{{\mm@keyface until}}
\typeset{vprint}{{\mm@keyface vprint}}
\typeset{vprintf}{{\mm@keyface vprintf}}
\typeset{vtime}{{\mm@keyface vtime}}
\typeset{when}{{\mm@keyface when}}
\typeset{where}{{\mm@keyface where}}
\typeset{while}{{\mm@keyface while}}
\typeset{random}{{\mm@consface random}}
\typeset{adj}{{\mm@relface adj\/}}
\typeset{and}{{\mm@relface and\/}}
\typeset{cat}{{\mm@relface cat\/}}
\typeset{cmpeq}{{\mm@relface cmpeq\/}}
\typeset{cmpne}{{\mm@relface cmpne\/}}
\typeset{diff}{{\mm@relface diff\/}}
\typeset{eq}{{\mm@relface eq\/}}
\typeset{ge}{{\mm@relface ge\/}}
\typeset{gt}{{\mm@relface gt\/}}
\typeset{in}{{\mm@relface in\/}}
\typeset{join}{{\mm@relface join\/}}
\typeset{le}{{\mm@relface le\/}}
\typeset{lt}{{\mm@relface lt\/}}
\typeset{meet}{{\mm@relface meet\/}}
\typeset{ne}{{\mm@relface ne\/}}
\typeset{not}{{\mm@relface not\/}}
\typeset{notadj}{{\mm@relface notadj\/}}
\typeset{notin}{{\mm@relface notin\/}}
\typeset{notsubset}{{\mm@relface notsubset\/}}
\typeset{or}{{\mm@relface or\/}}
\typeset{sdiff}{{\mm@relface sdiff\/}}
\typeset{subset}{{\mm@relface subset\/}}
\typeset{xor}{{\mm@relface xor\/}}
\typeset{car}{{\mm@consface car}}
\typeset{comp}{{\mm@consface comp}}
\typeset{cop}{{\mm@consface cop}}
\typeset{elt}{{\mm@consface elt}}
\typeset{ext}{{\mm@consface ext}}
\typeset{frac}{{\mm@consface frac}}
\typeset{func}{{\mm@consface func}}
\typeset{hom}{{\mm@consface hom}}
\typeset{ideal}{{\mm@consface ideal}}
\typeset{iso}{{\mm@consface iso}}
\typeset{lideal}{{\mm@consface lideal}}
\typeset{loc}{{\mm@consface loc}}
\typeset{map}{{\mm@consface map}}
\typeset{ncl}{{\mm@consface ncl}}
\typeset{pmap}{{\mm@consface pmap}}
\typeset{proc}{{\mm@consface proc}}
\typeset{quo}{{\mm@consface quo}}
\typeset{rec}{{\mm@consface rec}}
\typeset{recformat}{{\mm@consface recformat}}
\typeset{rep}{{\mm@consface rep}}
\typeset{rideal}{{\mm@consface rideal}}
\typeset{sub}{{\mm@consface sub}}
\typeset{true}{{\mm@boolface true}}
\typeset{false}{{\mm@boolface false}}
\typeset{alpha}{$\alpha_{\mm@sub}$}
\typeset{beta}{$\beta_{\mm@sub}$}
\typeset{gamma}{$\gamma_{\mm@sub}$}
\typeset{delta}{$\delta_{\mm@sub}$}
\typeset{epsilon}{$\epsilon_{\mm@sub}$}
\typeset{zeta}{$\zeta_{\mm@sub}$}
\typeset{eta}{$\eta_{\mm@sub}$}
\typeset{theta}{$\theta_{\mm@sub}$}
\typeset{iota}{$\iota_{\mm@sub}$}
\typeset{kappa}{$\kappa_{\mm@sub}$}
\typeset{lambda}{$\lambda_{\mm@sub}$}
\typeset{mu}{$\mu_{\mm@sub}$}
\typeset{nu}{$\nu_{\mm@sub}$}
\typeset{xi}{$\xi_{\mm@sub}$}
\typeset{pi}{$\pi_{\mm@sub}$}
\typeset{rho}{$\rho_{\mm@sub}$}
\typeset{sigma}{$\sigma_{\mm@sub}$}
\typeset{tau}{$\tau_{\mm@sub}$}
\typeset{upsilon}{$\upsilon_{\mm@sub}$}
\typeset{phi}{$\phi_{\mm@sub}$}
\typeset{chi}{$\chi_{\mm@sub}$}
\typeset{psi}{$\psi_{\mm@sub}$}
\typeset{omega}{$\omega_{\mm@sub}$}
\providecommand{\mit}{\@fontswitch\relax\mathnormal}
\typeset{Alpha}{$\mit A_{\mm@sub}$}
\typeset{Beta}{$\mit B_{\mm@sub}$}
\typeset{Gamma}{$\Gamma_{\mm@sub}$}
\typeset{Delta}{$\Delta_{\mm@sub}$}
\typeset{Epsilon}{$\mit E_{\mm@sub}$}
\typeset{Zeta}{$\mit Z_{\mm@sub}$}
\typeset{Eta}{$\mit H_{\mm@sub}$}
\typeset{Theta}{$\Theta_{\mm@sub}$}
\typeset{Iota}{$\mit I_{\mm@sub}$}
\typeset{Kappa}{$\mit K_{\mm@sub}$}
\typeset{Lambda}{$\Lambda_{\mm@sub}$}
\typeset{Mu}{$\mit M_{\mm@sub}$}
\typeset{Nu}{$\mit N_{\mm@sub}$}
\typeset{Xi}{$\Xi_{\mm@sub}$}
\typeset{Pi}{$\mit\Pi_{\mm@sub}$}
\typeset{Rho}{$\mit P_{\mm@sub}$}
\typeset{Sigma}{$\Sigma_{\mm@sub}$}
\typeset{Tau}{$\mit T_{\mm@sub}$}
\typeset{Upsilon}{$\Upsilon_{\mm@sub}$}
\typeset{Phi}{$\Phi_{\mm@sub}$}
\typeset{Chi}{$\mit X_{\mm@sub}$}
\typeset{Psi}{$\Psi_{\mm@sub}$}
\typeset{Omega}{$\Omega_{\mm@sub}$}
\typeset{aleph}{$\aleph_{\mm@sub}$}
\typeset{infinity}{$\infty_{\mm@sub}$}
\typeset{nabla}{$\nabla_{\mm@sub}$}
\typeset{::}{${}\mathrel{::}{}$}
\typeset{..}{${}\ldotp\ldotp{}$}
\typeset{<-}{${}\leftarrow{}$}
\typeset{->}{${}\rightarrow{}$}
\typeset{:->}{${}\mapsto{}$}
\typeset{=>}{${}\Rightarrow{}$}
\typeset{;}{{\kern.1em\mm@funface ;}}
\typeset{,}{{\mm@funface,\kern.15em\relax}}
\def\magmanames(#1){\def\mm@tok{}\mm@funbegin#1\relax}
\def\mm@funbegin#1{%
 \ifx#1\relax
  \let\next=\relax
 \else\ifx#1,
  \let\next=\mm@funbegin
 \else\ifnum`#1=9
  \let\next=\mm@funbegin
 \else\ifnum`#1=32
  \let\next=\mm@funbegin
 \else\if#1!
  \def\mm@tok{}%
  \let\next=\mm@varcollect
 \else\if#1|
  \def\mm@tok{}%
  \let\next=\mm@intrcollect
 \else
  \def\mm@tok{#1}%
  \let\next=\mm@funcollect
 \fi\fi\fi\fi\fi\fi
 \next}
\def\mm@funcollect#1{%
 \ifx#1\relax
  \typeset{\mm@tok}{{\mm@funface\mm@tok$_{\mm@sub}$}}%
  \let\next=\relax
 \else\ifx#1,
  \typeset{\mm@tok}{{\mm@funface\mm@tok$_{\mm@sub}$}}%
  \let\next=\mm@funbegin
 \else\ifnum`#1=9
  \typeset{\mm@tok}{{\mm@funface\mm@tok$_{\mm@sub}$}}%
  \let\next=\mm@funbegin
 \else\ifnum`#1=32
  \typeset{\mm@tok}{{\mm@funface\mm@tok$_{\mm@sub}$}}%
  \let\next=\mm@funbegin
 \else
  \xdef\mm@tok{\mm@tok#1}%
  \let\next=\mm@funcollect
 \fi\fi\fi\fi
 \next}
\def\mm@varcollect#1{%
 \ifx#1\relax
  \typeset{\mm@tok}{{\mm@varface\mm@tok$_{\mm@sub}$}}%
  \let\next=\relax
 \else\ifx#1,
  \typeset{\mm@tok}{{\mm@varface\mm@tok$_{\mm@sub}$}}%
  \let\next=\mm@funbegin
 \else\ifnum`#1=9
  \typeset{\mm@tok}{{\mm@varface\mm@tok$_{\mm@sub}$}}%
  \let\next=\mm@funbegin
 \else\ifnum`#1=32
  \typeset{\mm@tok}{{\mm@varface\mm@tok$_{\mm@sub}$}}%
  \let\next=\mm@funbegin
 \else
  \xdef\mm@tok{\mm@tok#1}%
  \let\next=\mm@varcollect
 \fi\fi\fi\fi
 \next}
\def\mm@intrcollect#1{%
 \ifx#1\relax
  \typeset{\mm@tok}{{\mm@intrface\mm@tok$_{\mm@sub}$}}%
  \let\next=\relax
 \else\ifx#1,
  \typeset{\mm@tok}{{\mm@intrface\mm@tok$_{\mm@sub}$}}%
  \let\next=\mm@funbegin
 \else\ifnum`#1=9
  \typeset{\mm@tok}{{\mm@intrface\mm@tok$_{\mm@sub}$}}%
  \let\next=\mm@funbegin
 \else\ifnum`#1=32
  \typeset{\mm@tok}{{\mm@intrface\mm@tok$_{\mm@sub}$}}%
  \let\next=\mm@funbegin
 \else
  \xdef\mm@tok{\mm@tok#1}%
  \let\next=\mm@intrcollect
 \fi\fi\fi\fi
 \next}
\newif\ifmm@high
\newif\ifmm@keephigh
\newif\ifmm@inline
\newif\ifmm@intr
\def\@intrinsic{intrinsic}
\def\@end{end}
\newcount\mm@brackets
\newdimen\mm@space
\newdimen\mm@indent
\newbox\voidb@x
\newbox\mm@i
\newbox\mm@ii
\def\mm@preparemagma{% Do not allow any blank lines in this definition
 \catcode9=12\catcode13=12\catcode32=12
 \catcode33=12\catcode34=12\catcode35=12\catcode36=12
 \catcode37=12\catcode38=12\catcode39=12\catcode40=12
 \catcode41=12\catcode42=12\catcode43=12\catcode44=12
 \catcode45=12\catcode46=12\catcode47=12\catcode58=12
 \catcode59=12\catcode60=12\catcode61=12\catcode62=12
 \catcode63=12\catcode64=12\catcode91=12\catcode92=12
 \catcode93=12\catcode94=12\catcode95=12\catcode96=12
 \catcode123=12\catcode124=12\catcode125=12\catcode126=12
\textfont15=\mm@symface
 \mathcode"21="3F21 % !
 % quote "
 \mathcode"23="0F23 % #
 \mathcode"24="0F24 % $
 \mathcode"25="0F25 % %
 \mathcode"26="0F26 % &
 \mathcode"27="0027 % '
 \mathcode"28="0028 % (
 \mathcode"29="0029 % )
 \mathcode"2A="0203 % *
 \mathcode"2B="002B % +
 \mathcode"2C="0F2C % ,
 \mathcode"2D="0200 % -
 \mathcode"2E="013A % .
 \mathcode"2F="002F % /
 \mathcode"3A="003A % :
 \mathcode"3B="0F3B % ;
 \mathcode"3C="013C % < ( \langle is "0268 )
 \mathcode"3D="003D % =
 \mathcode"3E="013E % > ( \rangle is "0269 )
 \mathcode"3F="0F3F % ?
 \mathcode"40="0F40 % @
 \mathcode"5B="005B % [
 \mathcode"5C="026E % \
 \mathcode"5D="005D % ]
 \mathcode"5E="0F5E % ^
 \mathcode"5F="0F5F % _
 \mathcode"60="0F12 % `
 \mathcode"7B="0266 % {
 \mathcode"7C="026A % |
 \mathcode"7D="0267 % }
 \mathcode"7E="0218 % ~ (large)
 \mm@intrfalse
 \mm@highfalse
 \mm@brackets=0
 \def\mm@tok{}%
 \mm@afteremit}
\def\mm@beginInline{%
  \begingroup
  \mm@inlinetrue
  \leavevmode
  \everymm
  \mm@preparemagma\mm@lex@state}
\let\mm@endInline=\endgroup
\def\mm@beginMagma{%
  \beforemm
  \begingroup
  \mm@inlinefalse
  \everymm
  \offinterlineskip
  \def\mm@parskip{}%
  \mm@preparemagma
  \global\mm@indent=\mmleftskip
  \mm@code@state}
\def\mm@emitvar{%
 \if\csname<\mm@tok>\endcsname\relax
   \setbox255=\hbox{{\mm@varface\mm@tok\/$_{\mm@sub}$}}%
 \else
   \setbox255=\hbox{\csname<\mm@tok>\endcsname}%
 \fi
 \ifx\mm@tok\@intrinsic\ifx\mm@last\@end\else\mm@intrtrue\fi\fi
 \mm@emit}
\def\mm@emitintr{%
 \if\csname<\mm@tok>\endcsname\relax
  \setbox255=\hbox{{\mm@intrface\mm@tok}}%
 \else
  \setbox255=\hbox{\csname<\mm@tok>\endcsname}%
 \fi
 \mm@emit}
\def\mm@emitsym{%
 \if\csname<\mm@tok>\endcsname\relax
  \setbox255=\hbox{${}\mm@tok{}$}%
 \else
  \setbox255=\hbox{\csname<\mm@tok>\endcsname}%
 \fi
 \mm@emit}
\def\mm@emitnum{%
 \setbox255=\hbox{{\mm@numface\mm@tok}}%
 \mm@emit}
\def\mm@emitchr{%
 \if\csname<\mm@tok>\endcsname\relax
  \setbox255=\hbox{{\mm@funface`\mm@tok'}}%
 \else
  \setbox255=\hbox{{\mm@funface`\csname<\mm@tok>\endcsname'}}%
 \fi
 \mm@emit}
\def\mm@emitstr#1#2{%
  \setbox255=\hbox{#1{\mm@strface\mm@tok}#2}%
  \mm@emit}
\def\mm@emitslashes{%
 \setbox255=\hbox{\hskip\mmcommentskip/\kern-1.5pt/\mm@tok}\mm@emit}
\def\mm@preparecomment{%
 \mm@emitslashes
 \endgroup
 \begingroup
 \catcode13=12}
\def\mm@emitcomment#1{%
 \setbox255=\hbox{#1}%
 \def\mm@tok{}%
 \mm@emit
 \endgroup
 \begingroup
 \mm@inlinefalse
 \everymm
 \offinterlineskip
 \def\mm@parskip{}%
 \mm@preparemagma
 \mm@newline@state}
\def\mm@emitsup{%
  \global\setbox\mm@ii=\hbox{$\mm@tok$}%
  \mm@afteremit}
\def\mm@emit{%
  \ifmm@high
    \global\setbox\mm@ii=\hbox{\unhbox\mm@ii\kern\mm@space\unhbox255}%
    \ifnum\mm@brackets>0\relax\else\mm@highfalse\fi
    \ifmm@keephigh\mm@hightrue\fi
  \fi
  \ifmm@high\relax
  \else\ifmm@inline
     \ifhbox\mm@ii$\mskip1.5mu{}^{\box\mm@ii}$\fi
     \kern\mm@space\box255%
   \else
     \global\setbox\mm@i=\hbox{\unhbox\mm@i\ifhbox\mm@ii
          $\mskip1.5mu{}^{\box\mm@ii}$\fi\kern\mm@space\unhbox255}%
   \fi
   \global\setbox\mm@ii=\box\voidb@x
  \fi
  \mm@afteremit}
\def\mm@afteremit{%
  \ifmm@high\else\def\mm@size{\mm@sz}\fi
  \mm@keephighfalse
  \edef\mm@last{\mm@tok}\def\mm@tok{}\def\mm@sub{}\mm@space=0pt}
\def\mm@outputline{%
 \ifhbox\mm@i
  \dimen255=\hsize
  \advance\dimen255 by -\mmrightskip
  \advance\dimen255 by -\mm@indent
  \ifdim\wd\mm@i>\dimen255
   \dimen255=-\dimen255 \advance\dimen255 by \wd\mm@i
   \count255=\inputlineno \advance\count255 by -1
   \immediate\write16{}%
   \immediate\write16{%
    Overfull \hbox (\the\dimen255
    \space too wide) in Magma code at line \the\count255}%
   \global\setbox\mm@i=\hbox{\unhbox\mm@i\vrule width\overfullrule}%
  \fi
  \mm@parskip
  \hbox{\mm@ndx\strut\kern\mm@indent\unhbox\mm@i}%
  \global\mm@indent=\mmleftskip
 \fi}
\chardef\mm@SP=0
\chardef\mm@LC=1
\chardef\mm@UC=2
\chardef\mm@DI=3
\chardef\mm@SY=4
\chardef\mm@PU=5
\chardef\mm@AP=6
\chardef\mm@QT=7
\chardef\mm@NL=8
\chardef\mm@LB=9
\chardef\mm@CX=10
\newcount\mm@delim
\newcount\mm@cc
\def\mm@getcc#1{%
  \mm@cc=`#1
  \ifnum\mm@cc<65 %%% NUL - @
    \ifnum\mm@cc<32 %%% NUL - US
     \ifnum\mm@cc=9
       \mm@cc=\mm@SP
     \else\ifnum\mm@cc=13
       \mm@cc=\mm@NL
     \else
       \mm@cc=-1
     \fi\fi
    \else %%% SP - @
     \ifnum\mm@cc<48 %%% SP - /
       \ifnum\mm@cc=32 %%% SP
         \mm@cc=\mm@SP
       \else\ifnum\mm@cc=34 %%% "
         \mm@cc=\mm@QT
       \else\ifnum\mm@cc=39 %%% '
         \mm@cc=\mm@AP
       \else\ifnum\mm@cc=40 %%% (
         \advance\mm@brackets by 1
         \mm@cc=\mm@PU
       \else\ifnum\mm@cc=41 %%% )
         \advance\mm@brackets by -1
         \mm@cc=\mm@PU
       \else\ifnum\mm@cc=44 %%% ,
         \mm@cc=\mm@PU
       \else                %%% . ! # $ % & * + - /
         \mm@cc=\mm@SY
       \fi\fi\fi\fi\fi\fi
     \else %%% 0 - @
       \ifnum\mm@cc<58 %%% 0 - 9
     \mm@cc=\mm@DI
       \else\ifnum\mm@cc=59 %%% ;
         \mm@cc=\mm@PU
       \else                %%% : < = > ?
         \mm@cc=\mm@SY
       \fi\fi
     \fi
    \fi
  \else %%% A - DEL
    \ifnum\mm@cc<97 %%% A - `
      \ifnum\mm@cc<91 %%% A - Z
        \mm@cc=\mm@UC
      \else\ifnum\mm@cc=91 %%% [
        \advance\mm@brackets by 1
        \mm@cc=\mm@PU
      \else\ifnum\mm@cc=92 %%% \
        \mm@cc=\mm@SY
      \else\ifnum\mm@cc=93 %%% ]
        \advance\mm@brackets by -1
        \mm@cc=\mm@PU
      \else\ifnum\mm@cc=94 %%% ^
        \mm@cc=\mm@CX
      \else\ifnum\mm@cc=95 %%% _
        \mm@cc=\mm@LC
      \else                %%% `
        \mm@cc=\mm@PU
      \fi\fi\fi\fi\fi\fi
    \else %%% a - DEL
      \ifnum\mm@cc<123 %%% a - z
        \mm@cc=\mm@LC
      \else\ifnum\mm@cc=123 %%% {
        \advance\mm@brackets by 1
        \mm@cc=\mm@LB
      \else\ifnum\mm@cc=124 %%% |
        \mm@cc=\mm@SY
      \else\ifnum\mm@cc=125 %%% }
        \advance\mm@brackets by -1
        \mm@cc=\mm@PU
      \else\ifnum\mm@cc=126 %%% ~
        \mm@cc=\mm@SY
      \else
        \mm@cc=-1
      \fi\fi\fi\fi\fi
    \fi
  \fi}
\def\mm@setbrackets#1{%
  \ifnum`#1=40            %%% (
    \advance\mm@brackets by 1
  \else\ifnum`#1=41       %%% )
    \advance\mm@brackets by -1
  \else\ifnum`#1=91       %%% [
    \advance\mm@brackets by 1
  \else\ifnum`#1=93       %%% ]
    \advance\mm@brackets by -1
  \else\ifnum`#1=123      %%% {
    \advance\mm@brackets by 1
  \else\ifnum`#1=125      %%% }
    \advance\mm@brackets by -1
  \fi\fi\fi\fi\fi\fi}
\def\mm@LBaction#1{%
  \ifmm@high \mm@setbrackets#1\fi
  \ifmm@intr \let\next=\mm@doc@state
  \else
    \def\mm@tok{#1}%
    \mm@emitsym
    \let\next=\mm@lex@state
  \fi}
\def\mm@QTaction{%
  \ifmm@inline
    \mm@endInline
    \let\next=\relax
  \else
    \def\mm@tok{}%
    \let\next=\mm@str@state
  \fi}
\def\mm@NLaction{%
  \ifmm@inline
    \mm@space=\mmwordspace
    \let\next=\mm@lex@state
  \else
    \let\next=\mm@newline@state
  \fi}
\def\mm@PUaction#1{%
  \ifmm@high\mm@setbrackets{#1}\fi
  \def\mm@tok{#1}%
  \mm@emitsym
  \let\next=\mm@lex@state}
\def\mm@SYaction#1{%
  \ifx#1.%
    \mm@keephightrue
    \mm@emitvar
    \mm@keephightrue
    \def\mm@tok{#1}%
    \let\next=\mm@sym@state
  \else
    \mm@emitvar
    \def\mm@tok{#1}%
    \ifx#1/\let\next=\mm@slash@state\else\let\next=\mm@sym@state\fi
  \fi}
\def\mm@code@state#1{%
 \mm@getcc#1%
 \def\mm@tok{#1}%
 \ifcase\mm@cc                     % SP - space
    \ifnum`#1=9\global\advance\mm@indent by \mmtabwidth
    \else\global\advance\mm@indent by \mmspacewidth\fi
    \let\next=\mm@code@state
   \or                             % LC - lowercase letters
    \ifx#1p%
     \let\next=\mm@p@state
    \else
     \let\next=\mm@var@state
    \fi
   \or \let\next=\mm@init@state    % UC - uppercase letters
   \or \let\next=\mm@dec@state     % DI - digits
   \or                             % SY - symbols
    \ifx#1/%
     \let\next=\mm@slash@state
    \else
     \let\next=\mm@sym@state
    \fi
   \or                             % PU - punctuation
    \mm@emitsym
    \let\next=\mm@lex@state
   \or                             % AP - apostrophe
    \def\mm@tok{}%
    \let\next=\mm@chr@state
   \or \let\next=\mm@str@state     % QT - double quotation mark
   \or \let\next=\mm@newline@state % NL - newline
   \or                             % LB - left brace
    \ifmm@intr
     \let\next=\mm@doc@state
    \else
     \mm@emitsym
     \let\next=\mm@lex@state
    \fi
   \or \let\next=\mm@circumflex@state % CX - circumflex
   \else
     \PackageError{MagmaTeX}
       {Illegal character in Magma mode: #1}
       {Possibly a bug}%
 \fi
 \next}
\def\mm@newline@state#1{%
 \mm@outputline
 \ifx#1>%
  \mm@space=0pt
  \let\next=\mm@code@state
 \else
  \par
  \endgroup
  \aftermm
  \par\noindent\ignorespaces
  \let\next=\relax
 \fi
 \next}
\def\mm@lex@state#1{%
 \mm@getcc#1%
 \def\mm@tok{#1}%
 \ifcase\mm@cc                      % SP - space
    \mm@space=\mmwordspace
    \let\next=\mm@lex@state
   \or                              % LC - lowercase letters
    \ifx#1p\let\next=\mm@p@state
    \else  \let\next=\mm@var@state
    \fi
   \or \let\next=\mm@init@state     % UC - uppercase letters
   \or \let\next=\mm@dec@state      % DI - digits
   \or                              % SY - symbols
    \ifx#1/\let\next=\mm@slash@state
    \else  \let\next=\mm@sym@state
    \fi
   \or \mm@PUaction{#1}%            % PU - punctuation
   \or                              % AP - apostrophe
    \def\mm@tok{}%
    \let\next=\mm@chr@state
   \or \mm@QTaction                 % QT - double quotation mark
   \or \mm@NLaction                 % NL - newline
   \or \mm@LBaction{#1}%            % LB - left brace
   \or \let\next=\mm@circumflex@state % CX - circumflex
   \else
     \PackageError{MagmaTeX}
       {Illegal character in Magma mode: #1}
       {Possibly a bug}
 \fi
 \next}
\def\mm@var@state#1{%
 \mm@getcc#1%
 \ifcase\mm@cc
    % SP - space
    \mm@emitvar
    \mm@space=\mmwordspace
    \let\next=\mm@lex@state
   \or  % LC - lowercase letters
    \edef\mm@tok{\mm@tok\mm@sub#1}%
    \def\mm@sub{}%
    \let\next=\mm@var@state
   \or  % UC - uppercase letters
    \edef\mm@tok{\mm@tok\mm@sub#1}%
    \def\mm@sub{}%
    \let\next=\mm@var@state
   \or  % DI - digits
    \edef\mm@sub{\mm@sub#1}%
    \let\next=\mm@var@state
   \or \mm@SYaction{#1}% SY - symbols
   \or  % PU - punctuation
     \mm@emitvar
     \mm@PUaction{#1}%
   \or  % AP - apostrophe
    \mm@emitvar
    \def\mm@tok{}%
    \let\next=\mm@chr@state
   \or  % QT - double quotation mark
    \mm@emitvar
    \mm@QTaction
   \or  % NL - newline
    \mm@emitvar
    \mm@NLaction
   \or  % LB - left brace
     \mm@emitvar
     \mm@LBaction{#1}%
   \or  % CX - circumflex
    \mm@emitvar
    \let\next=\mm@circumflex@state
   \else
     \PackageError{MagmaTeX}
       {Illegal character in Magma mode: #1}
       {Possibly a bug}%
 \fi
 \next}
\def\mm@p@state#1{%
 \mm@getcc#1%
 \ifcase\mm@cc
    % SP - space
    \mm@emitvar
    \mm@space=\mmwordspace
    \let\next=\mm@lex@state
   \or  % LC - lowercase letters
    \edef\mm@tok{\mm@tok#1}%
    \let\next=\mm@var@state
   \or  % UC - uppercase letters
    \mm@emitvar
    \def\mm@tok{#1}%
    \let\next=\mm@intr@state
   \or  % DI - digits
    \edef\mm@sub{\mm@sub#1}%
    \let\next=\mm@var@state
   \or  \mm@SYaction{#1}% SY - symbols
   \or  % PU - punctuation
     \mm@emitvar
     \mm@PUaction{#1}%
   \or  % AP - apostrophe
    \mm@emitvar
    \def\mm@tok{}%
    \let\next=\mm@chr@state
   \or  % QT - double quotation mark
    \mm@emitvar
    \mm@QTaction
   \or  % NL - newline
    \mm@emitvar
    \mm@NLaction
   \or  % LB - left brace
     \mm@emitvar
     \mm@LBaction{#1}%
   \or  % CX - circumflex
    \mm@emitvar
    \def\mm@tok{#1}%
    \let\next=\mm@circumflex@state
   \else
     \PackageError{MagmaTeX}
       {Illegal character in Magma mode: #1}
       {Possibly a bug}%
 \fi
 \next}
\def\mm@intr@state#1{%
 \mm@getcc#1%
 \ifcase\mm@cc
    % SP - space
    \mm@emitintr
    \mm@space=\mmwordspace
    \let\next=\mm@lex@state
   \or  % LC - lowercase letters
    \edef\mm@tok{\mm@tok#1}%
    \let\next=\mm@intr@state
   \or  % UC - uppercase letters
    \edef\mm@tok{\mm@tok#1}%
    \let\next=\mm@intr@state
   \or  % DI - digits
    \edef\mm@tok{\mm@tok#1}%
    \let\next=\mm@intr@state
   \or  % SY - symbols
     \ifx#1.%
       \mm@keephightrue
       \mm@emitintr
       \mm@keephightrue
       \def\mm@tok{#1}%
       \let\next=\mm@sym@state
     \else
       \mm@emitintr
       \def\mm@tok{#1}%
       \ifx#1/\let\next=\mm@slash@state\else\let\next=\mm@sym@state\fi
     \fi
   \or  % PU - punctuation
     \mm@emitintr
     \mm@PUaction{#1}%
   \or  % AP - apostrophe
    \mm@emitintr
    \def\mm@tok{}%
    \let\next=\mm@chr@state
   \or  % QT - double quotation mark
    \mm@emitintr
    \mm@QTaction
   \or  % NL - newline
    \mm@emitintr
    \mm@NLaction
   \or  % LB - left brace
     \mm@emitintr
     \mm@LBaction{#1}%
   \or  % CX - circumflex
    \mm@emitintr
    \def\mm@tok{#1}%
    \let\next=\mm@circumflex@state
   \else
     \PackageError{MagmaTeX}
       {Illegal character in Magma mode: #1}
       {Possibly a bug}%
 \fi
 \next}
\def\mm@init@state#1{%
 \mm@getcc#1%
 \ifcase\mm@cc
     % SP - space
     \mm@emitvar
     \mm@space=\mmwordspace
     \let\next=\mm@lex@state
   \or  % LC - lowercase letters
     \edef\mm@tok{\mm@tok#1}%
     \let\next=\mm@intr@state
   \or  % UC - uppercase letters
     \edef\mm@tok{\mm@tok#1}%
     \let\next=\mm@intr@state
   \or  % DI - digits
     \edef\mm@sub{\mm@sub#1}%
     \let\next=\mm@var@state
   \or \mm@SYaction{#1}% SY - symbols
   \or  % PU - punctuation
     \mm@emitvar
     \mm@PUaction{#1}%
   \or  % AP - apostrophe
    \mm@emitvar
    \def\mm@tok{}%
    \let\next=\mm@chr@state
   \or  % QT - double quotation mark
    \mm@emitvar
    \mm@QTaction
   \or  % NL - newline
    \mm@emitvar
    \mm@NLaction
   \or  % LB - left brace
     \mm@emitvar
     \mm@LBaction{#1}%
   \or  % CX - circumflex
    \mm@emitvar
    \def\mm@tok{#1}%
    \let\next=\mm@circumflex@state
   \else
     \PackageError{MagmaTeX}
       {Illegal character in Magma mode: #1}
       {Possibly a bug}%
 \fi
 \next}
\def\mm@sym@state#1{%
 \mm@getcc#1%
 \ifcase\mm@cc
    % SP - space
    \mm@emitsym
    \mm@space=\mmwordspace
    \let\next=\mm@lex@state
   \or  % LC - lowercase letters
    \mm@emitsym
    \def\mm@tok{#1}%
    \ifx#1p%
     \let\next=\mm@p@state
    \else
     \let\next=\mm@var@state
    \fi
   \or  % UC - uppercase letters
    \mm@emitsym
    \def\mm@tok{#1}%
    \let\next=\mm@init@state
   \or  % DI - digits
    \mm@emitsym
    \def\mm@tok{#1}%
    \let\next=\mm@dec@state
   \or  % SY - symbols
    \edef\mm@tok{\mm@tok#1}%
    \let\next=\mm@sym@state
   \or  % PU - punctuation
    \mm@emitsym
    \mm@PUaction{#1}%
   \or  % AP - apostrophe
    \mm@emitsym
    \def\mm@tok{}%
    \let\next=\mm@chr@state
   \or  % QT - double quotation mark
    \mm@emitsym
    \mm@QTaction
   \or  % NL - newline
    \mm@emitsym
    \mm@NLaction
   \or  % LB - left brace
     \mm@emitsym
     \mm@LBaction{#1}%
   \or  % CX - circumflex
    \mm@emitsym
    \def\mm@tok{#1}%
    \let\next=\mm@circumflex@state
   \else
     \PackageError{MagmaTeX}
       {Illegal character in Magma mode: #1}
       {Possibly a bug}%
 \fi
 \next}
\def\mm@dec@state#1{%
 \mm@getcc#1%
 \ifcase\mm@cc
    % SP - space
    \mm@emitnum
    \mm@space=\mmwordspace
    \let\next=\mm@lex@state
   \or  % LC - lowercase letters
    \ifx#1e%
     \edef\mm@tok{\mm@tok#1}%
     \let\next=\mm@dec@state
    \else\ifx#1p%
     \edef\mm@tok{\mm@tok#1}%
     \let\next=\mm@dec@state
    \else
     \mm@emitnum
     \def\mm@tok{#1}%
     \let\next=\mm@var@state
    \fi\fi
   \or  % UC - uppercase letters
    \ifx#1E%
     \edef\mm@tok{\mm@tok e}%
     \let\next=\mm@dec@state
    \else\ifx#1P%
     \edef\mm@tok{\mm@tok p}%
     \let\next=\mm@dec@state
    \else
     \mm@emitnum
     \def\mm@tok{#1}%
     \let\next=\mm@init@state
    \fi\fi
   \or  % DI - digits
    \edef\mm@tok{\mm@tok#1}%
    \let\next=\mm@dec@state
   \or  % SY - symbols
    \ifx#1.\let\next=\mm@decdot@state
    \else
      \mm@emitnum
      \def\mm@tok{#1}%
      \ifx#1/\let\next=\mm@slash@state\else\let\next=\mm@sym@state\fi
    \fi
   \or  % PU - punctuation
     \mm@emitnum
     \mm@PUaction{#1}%
   \or  % AP - apostrophe
    \mm@emitnum
    \def\mm@tok{}%
    \let\next=\mm@chr@state
   \or  % QT - double quotation mark
    \mm@emitnum
    \mm@QTaction
   \or  % NL - newline
    \mm@emitnum
    \mm@NLaction
   \or  % LB - left brace
     \mm@emitnum
     \mm@LBaction{#1}%
   \or  % CX - circumflex
    \mm@emitnum
    \def\mm@tok{#1}%
    \let\next=\mm@circumflex@state
   \else
     \PackageError{MagmaTeX}
       {Illegal character in Magma mode: #1}
       {Possibly a bug}%
 \fi
 \next}
\def\mm@decdot@state#1{%
 \mm@getcc#1%
 \ifcase\mm@cc
    % SP - space
    \edef\mm@tok{\mm@tok .}%
    \mm@emitnum
    \mm@space=\mmwordspace
    \let\next=\mm@lex@state
   \or  % LC - lowercase letters
    \ifx#1e%
     \edef\mm@tok{\mm@tok .#1}%
     \let\next=\mm@dec@state
    \else\ifx#1p%
     \edef\mm@tok{\mm@tok .#1}%
     \let\next=\mm@dec@state
    \else
     \edef\mm@tok{\mm@tok .}%
     \mm@emitnum
     \def\mm@tok{#1}%
     \let\next=\mm@var@state
    \fi\fi
   \or  % UC - uppercase letters
    \ifx#1E%
     \edef\mm@tok{\mm@tok .e}%
     \let\next=\mm@dec@state
    \else\ifx#1P%
     \edef\mm@tok{\mm@tok .p}%
     \let\next=\mm@dec@state
    \else
     \edef\mm@tok{\mm@tok .}%
     \mm@emitnum
     \def\mm@tok{#1}%
     \let\next=\mm@init@state
    \fi\fi
   \or  % DI - digits
    \edef\mm@tok{\mm@tok .#1}%
    \let\next=\mm@dec@state
   \or  % SY - symbols
     \ifx#1/%
       \edef\mm@tok{\mm@tok .}%
       \mm@emitnum
       \def\mm@tok{#1}%
       \let\next=\mm@slash@state
     \else
       \mm@emitnum
       \def\mm@tok{.#1}%
       \let\next=\mm@sym@state
     \fi
   \or  % PU - punctuation
     \edef\mm@tok{\mm@tok .}%
     \mm@emitnum
     \mm@PUaction{#1}%
   \or  % AP - apostrophe
    \edef\mm@tok{\mm@tok .}%
    \mm@emitnum
    \def\mm@tok{}%
    \let\next=\mm@chr@state
   \or  % QT - double quotation mark
    \edef\mm@tok{\mm@tok .}%
    \mm@emitnum
    \mm@QTaction
   \or  % NL - newline
    \edef\mm@tok{\mm@tok .}%
    \mm@emitnum
    \mm@NLaction
   \or  % LB - left brace
     \edef\mm@tok{\mm@tok .}%
     \mm@emitnum
     \mm@LBaction{#1}%
   \or  % CX - circumflex
    \edef\mm@tok{\mm@tok .}%
    \mm@emitnum
    \def\mm@tok{#1}%
    \let\next=\mm@circumflex@state
   \else
     \PackageError{MagmaTeX}
       {Illegal character in Magma mode: #1}
       {Possibly a bug}%
 \fi
 \next}
\def\mm@circumflex@state#1{%
 \mm@hightrue
 \def\mm@size{\mm@ssz}%
 \mm@brackets=0
 \mm@getcc#1%
 \ifcase\mm@cc
    % SP - space
     \let\next=\mm@circumflex@state
   \or  % LC - lowercase letters
     \def\mm@tok{#1}%
     \ifx#1p%
       \let\next=\mm@p@state
     \else
       \let\next=\mm@var@state
     \fi
   \or  % UC - uppercase letters
     \def\mm@tok{#1}%
     \let\next=\mm@init@state
   \or  % DI - digits
     \def\mm@tok{#1}%
     \let\next=\mm@dec@state
   \or  % SY - symbols
     \def\mm@tok{#1}%
     \ifx#1-\mm@emitsup
        \let\next=\mm@lex@state
     \else\ifx#1/%
       \let\next=\mm@slash@state
     \else
       \let\next=\mm@sym@state
     \fi\fi
   \or  % PU - punctuation
     \def\mm@tok{#1}%
     \mm@setbrackets#1%
     \mm@emitsym
     \let\next=\mm@lex@state
   \or  % AP - apostrophe
     \let\next=\mm@chr@state
   \or  % QT - double quotation mark
     \let\next=\mm@str@state
   \or  % NL - newline
     \let\next=\mm@newline@state
   \or  % LB - left brace
     \ifmm@intr
       \let\next=\mm@doc@state
     \else
       \def\mm@tok{#1}%
       \mm@emitsym
       \let\next=\mm@lex@state
     \fi
   \or  % CX - circumflex
     \def\mm@tok{#1}%
     \let\next=\mm@circumflex@state
   \else
     \PackageError{MagmaTeX}
       {Illegal character in Magma mode: #1}
       {Possibly a bug}%
 \fi
 \next}
\def\mm@chr@state#1{%
  \ifnum`#1=13
    \PackageError{MagmaTeX}
      {Line ended before apostrophe was seen}
      {You probably need to insert an apostrophe}%
    \mm@emitchr
    \let\next=\mm@newline@state
  \else\ifnum`#1=92
    \edef\mm@tok{\mm@tok#1}%
    \let\next=\mm@chresc@state
  \else\ifnum`#1=`'
    \mm@emitchr
    \let\next=\mm@lex@state
  \else
    \edef\mm@tok{\mm@tok#1}%
    \let\next=\mm@chr@state
  \fi\fi\fi
  \next}
\def\mm@chresc@state#1{\edef\mm@tok{\mm@tok#1}\mm@chr@state}
\def\mm@slash@state#1{%
 \mm@getcc#1%
 \ifcase\mm@cc
    % SP - space
    \mm@emitsym
    \mm@space=\mmwordspace
    \let\next=\mm@lex@state
   \or  % LC - lowercase letters
    \mm@emitsym
    \def\mm@tok{#1}%
    \ifx#1p%
     \let\next=\mm@p@state
    \else
     \let\next=\mm@var@state
    \fi
   \or  % UC - uppercase letters
    \mm@emitsym
    \def\mm@tok{#1}%
    \let\next=\mm@init@state
   \or  % DI - digits
    \mm@emitsym
    \def\mm@tok{#1}%
    \let\next=\mm@dec@state
   \or  % SY - symbols
    \edef\mm@tok{\mm@tok#1}%
    \ifx#1*%
     \let\next=\mm@slashstar@state
    \else\ifx#1/%
     \let\next=\mm@slashslash@state
    \else
     \let\next=\mm@sym@state
    \fi\fi
   \or  % PU - punctuation
     \mm@emitsym
     \mm@PUaction{#1}%
   \or  % AP - apostrophe
     \mm@emitsym
     \def\mm@tok{}%
     \let\next=\mm@chr@state
   \or  % QT - double quotation mark
     \mm@emitsym
     \mm@QTaction
   \or  % NL - newline
    \mm@emitsym
    \mm@NLaction
   \or  % LB - left brace
     \mm@emitsym
     \mm@LBaction{#1}%
   \or  % CX - circumflex
    \mm@emitsym
    \def\mm@tok{#1}%
    \let\next=\mm@circumflex@state
   \else
     \PackageError{MagmaTeX}
       {Illegal character in Magma mode: #1}
       {Possibly a bug}%
 \fi
 \next}
\def\mm@slashslash@state#1{%
  \ifmm@inline
    \PackageError{MagmaTeX}
      {Comment in inline Magma mode will be ignored}
      {Better remove it}%
    \def\mm@tok{#1}%
    \let\next=\mm@lex@state
  \else
    \mm@getcc#1%
    \ifnum\mm@cc=0       % SP - space
      \edef\mm@tok{\space}%
      \mm@preparecomment
      \let\next=\mm@comment@state
    \else\ifnum\mm@cc=8  % NL - newline
     \def\mm@tok{}%
     \mm@emitslashes
     \let\next=\mm@newline@state
    \else
      \def\mm@tok{#1}%
      \mm@preparecomment
      \let\next=\mm@comment@state
    \fi\fi\fi
  \next}
{\catcode13=12\gdef\mm@comment@state#1^^M{\mm@emitcomment{#1}}}
\def\mm@doc@state{%
  \mm@intrfalse
  \def\mm@strprefix{{\mm@strface\char123\kern .1em}}%
  \def\mm@strsuffix{{\mm@strface\kern .1em\char125}}%
  \mm@delim=125
  \def\mm@tok{}%
  \mm@getchr@state}
\def\mm@str@state{%
  \def\mm@strprefix{{\mm@funface``}}%
  \def\mm@strsuffix{{\mm@funface''}}%
  \mm@delim=34
  \def\mm@tok{}%
  \mm@getchr@state}
\def\mm@getchr@state#1{%
 \mm@getcc#1%
 \ifnum`#1=\mm@delim
  \mm@emitstr{\mm@strprefix}{\mm@strsuffix}%
  \let\next=\mm@lex@state
 \else\ifnum\mm@cc=\mm@NL
  \mm@emitstr{\mm@strprefix}{}%
  \def\mm@strprefix{}%
  \let\next=\mm@strnewline@state
 \else\ifnum`#1=92
  \edef\mm@tok{\mm@tok#1}%
  \let\next=\mm@stresc@state
 \else
  \edef\mm@tok{\mm@tok#1}%
  \let\next=\mm@getchr@state
 \fi\fi\fi
 \next}
\def\mm@stresc@state#1{\edef\mm@tok{\mm@tok#1}\mm@getchr@state}
\def\mm@strnewline@state#1{%
 \mm@outputline
 \ifx#1>%
  \mm@space=0pt
  \let\next=\mm@strcode@state
 \else
  \par
  \endgroup
  \aftermm
  \par\noindent\ignorespaces
  \let\next=\relax
 \fi
 \next}
\def\mm@strcode@state#1{%
 \mm@getcc#1%
 \ifnum\mm@cc=\mm@SP
   % SP - space
   \ifnum`#1=9\global\advance\mm@indent by \mmtabwidth
   \else\global\advance\mm@indent by \mmspacewidth\fi
   \let\next=\mm@strcode@state
 \else\ifnum\mm@cc=\mm@NL
   \let\next=\mm@strnewline@state
 \else\ifnum`#1=\mm@delim
   \mm@emitstr{\mm@strprefix}{\mm@strsuffix}%
   \let\next=\mm@lex@state
 \else\ifnum`#1=92
   \def\mm@tok{#1}%
   \let\next=\mm@stresc@state
 \else
   \def\mm@tok{#1}%
   \let\next=\mm@getchr@state
 \fi\fi\fi\fi
 \next}
\def\mm@slashstar@state{%
 \def\mm@tok{}%
 \def\mm@strprefix{{\mm@strface/*}}%
 \def\mm@strsuffix{{\mm@strface*/}}%
 \mm@comchr@state}
\def\mm@comchr@state#1{%
 \mm@getcc#1%
 \ifx#1*%
  \let\next=\mm@comstar@state
 \else\ifnum\mm@cc=\mm@NL
  \mm@emitstr{\mm@strprefix}{}%
  \def\mm@strprefix{}%
  \let\next=\mm@comnewline@state
 \else
  \edef\mm@tok{\mm@tok#1}%
  \let\next=\mm@comchr@state
 \fi\fi %\fi
 \next}
\def\mm@comstar@state#1{%
 \mm@getcc#1%
 \ifx#1/%
  \mm@emitstr{\mm@strprefix}{\mm@strsuffix}%
  \let\next=\mm@lex@state
 \else\ifnum\mm@cc=\mm@NL
  \mm@emitstr{\mm@strprefix}{}%
  \def\mm@strprefix{}%
  \let\next=\mm@comnewline@state
 \else
  \edef\mm@tok{\mm@tok*#1}%
  \let\next=\mm@comchr@state
 \fi\fi
 \next}
\def\mm@comnewline@state#1{%
 \mm@outputline
 \ifx#1>%
  \mm@space=0pt
  \let\next=\mm@comcode@state
 \else
  \par
  \endgroup
  \aftermm
  \par\noindent\ignorespaces
  \let\next=\relax
 \fi
 \next}
\def\mm@comcode@state#1{%
 \mm@getcc#1%
 \ifnum\mm@cc=\mm@SP
  \ifnum`#1=9\global\advance\mm@indent by \mmtabwidth
  \else\global\advance\mm@indent by \mmspacewidth\fi
  \let\next=\mm@comcode@state
 \else\ifx#1*%
  \let\next=\mm@comstar@state
 \else\ifnum\mm@cc=\mm@NL
  \let\next=\mm@comnewline@state
 \else
  \def\mm@tok{#1}%
  \let\next=\mm@comchr@state
 \fi\fi\fi
 \next}
\begingroup
\lccode`\~=`\'
\lowercase{\endgroup
\newenvironment{code}{%
  \begingroup
  \catcode`\>=12 \catcode`\"=12 \catcode`\<=12
  \trivlist
  \item\relax
    \if@minipage
    \else
      \vskip\parskip
    \fi
    \leftskip\@totalleftmargin
    \advance\leftskip by \parindent
    \rightskip\z@skip
    \parindent\z@
    \parfillskip\@flushglue
    \parskip\z@skip
    \@@par
    \@tempswafalse
    \def\par{%
      \if@tempswa
        \leavevmode\null\@@par\penalty\interlinepenalty
      \else
        \@tempswatrue
        \ifhmode\@@par\penalty\interlinepenalty\fi
      \fi}
    \obeylines
    \verbatim@font
    \let\orig@prime~%
    \@noligs
    \everymath\expandafter{\the\everymath
      \catcode`\'=12 \let~\orig@prime}
    \everydisplay\expandafter{\the\everydisplay
      \catcode`\'=12 \let~\orig@prime}
    \let\orig@dospecials\dospecials
    \mm@delfromspecials{\\}
    \mm@delfromspecials{\{}
    \mm@delfromspecials{\}}
    \let\do\@makeother
    \dospecials
    \let\dospecials\orig@dospecials
    \frenchspacing\@vobeyspaces
    \everypar \expandafter{\the\everypar \unpenalty}}
{\endgroup\endtrivlist}}
\def\mm@delfromspecials#1{%
  \def\@newspecials{}
  \def\@remove##1{%
    \ifx##1#1\else
    \g@addto@macro\@newspecials{\do ##1}\fi}
  \let\do\@remove\dospecials
  \let\dospecials\@newspecials
  }
\everymath{\catcode`<=12\catcode`>=12\catcode`"=12\relax}
\everydisplay{\catcode`<=12\catcode`>=12\catcode`"=12\relax}
\let\lt=<
\let\gt=>
{\catcode`>=\active
 \gdef\mm@beginItalic{\begingroup\it\catcode`>=\active\let>=\endgroup}}
{\catcode`"=\active
 \catcode`>=\active
 \catcode`<=\active
 \gdef\@ctivate{%
   \catcode`"=\active \let"=\mm@beginInline
   \catcode`>=\active \let>=\mm@beginMagma
   \catcode`<=\active \let<=\mm@beginItalic
}}
\AtBeginDocument{%
 \check@mathfonts
 \math@fontsfalse
 \@ctivate
}
\endinput
%%
%% End of file `MagmaTeX.sty'.
