\documentclass[a4paper]{article}
\usepackage{shortvrb}
\MakeShortVerb{\|}
\def\meta#1{$\langle${\normalfont\itshape#1}$\rangle$}

\DeclareFontFamily{U}{tf}{\skewchar\font=42}
\DeclareFontShape{U}{tf}{m}{n}{<5> tf5 <7> tf7 <10> tf10}{}
\DeclareSymbolFont{newsym}{U}{tf}{m}{n}

\begin{document}

\paragraph*{Accents} This demonstrates the extended semantics of
|\mathaccent|. The first row uses an accent whose |charlist| ends with
an |extensible recipe|, the second uses a traditional |charlist|.

\def\acca{\mathaccent"410 }
\def\accb{\mathaccent"418 }  

\[\acca{a}\ \acca{ab}\ \acca{abc}\ \acca{abcd}\ \acca{abcde}\]
\[\accb{a}\ \accb{ab}\ \accb{abc}\ \accb{abcd}\ \accb{abcde}\]

Nested accents and under accents with |\nesting|\-|math|\-|accent|,
|\math|\-|under|\-|accent| and |\nesting|\-|math|\-|under|\-|accent|. The
positioning information for the under accents is taken from the
\meta{skewchar}-\meta{accentee} kerning and the \meta{accent}-\meta{accent}
kerning.  

\def\hat{\mathaccent"0428 }
\def\uhat{\mathunderaccent"0428 }
\def\Hat{\nestingmathaccent"0428 }
\def\uHat{\nestingmathunderaccent"0428 }
\mathcode`A="0429

\[
\hat A\ \uhat A\ \Hat{\Hat A}\ \uHat{\uHat A}\ \Hat{\uHat{\Hat{\uHat A}}}
\quad
\Hat{\hat {\Hat A}}\ \hat{\Hat {\Hat A}}\ \uHat{\hat{\uHat{\hat A}}}\
\]

\paragraph*{Radicals} Generalized radicals with |\genradical|.
\def\radl{\genradical"400401 "4FF4FF }
\def\radlx{\genradical"400401 "40F40F }
\def\radr{\genradical"4FF4FF "408409 }
\def\radrx{\genradical"407407 "408409 }
\def\radlr{\genradical"400401 "408409 }

\[\radl{a^{a^a}bc}\ \radlx{a^{a^a}bc}\ \radr{a^{a^a}bc}\ \radrx{a^{a^a}bc}\]
\[\radlr{\radr{\radl{a}}}\]

\paragraph*{Math style} This sample shows that |\mathstyle| keeps track of the
math style while scanning the formula.

\def\sh{%
  \ifnum\the\mathstyle<0 X\else
    \ifcase\the\mathstyle D\or D'\or T\or T'\or S\or S'\or SS\or SS'
    \else !!\the\mathstyle!!\fi
  \fi}

\[
\sh\fraction{\sh\over\sh}\sh\overline{\sh}\underline{\sh}\sqrt{\sh}\sh
{}^{{\sh}^{\sh}}_{{\sh}_{\sh}}\hat{\sh}\sh\quad\textstyle\sh\hbox{\sh$\sh$}\sh
\]

And here is the list of all math styles, activated via
|\displaystyle|, |\cramped|\-|display|\-|style|, \dots, 
|\script|\-|script|\-|style|, |\cramped|\-|script|\-|script|\-|style|.

\[
\displaystyle\sh\,
\crampeddisplaystyle\sh\,
\textstyle\sh\,
\crampedtextstyle\sh\,
\scriptstyle\sh\,
\crampedscriptstyle\sh\,
\scriptscriptstyle\sh\,
\crampedscriptscriptstyle\sh
\]

The following display shows that |\fraction| has no influence on the
typesetting.

\[\hbox{|\fraction{a+b\over c-d}={a+b\over c-d}|}\]

\[\fraction{a+b\over c-d}={a+b\over c-d}\]


\paragraph*{Extensible operators} These have not been implemented in \TeX{}
the program, since this turned out to be a bit complicated (the limits of a
|mathop| are positioned in the first pass over the |mlist|, but the size of
big delimiters is not determined until the second pass). But I have done some
macro hackery to show how this would look like. The input for the middle
integral was (after a suitable redefinition of |\left|)
\[\hbox{|\left\int\limits^{\infty}_{-\infty}...\right.dx|}\]

\def\int{\mathchar"1420 }
\let\ooleft\left
\def\left{\futurelet\next\oint}
\def\oint{%
  \ifx\next\int
    \let\next\ooint
  \else
    \let\next\ooleft
  \fi
  \next}
\def\ooint\int{\def\isb{}\def\isp{}\let\li\limits\futurelet\next\oooint}
\def\oooint{%
  \ifx_\next
    \let\next\getsb
  \else
    \ifx^\next
      \let\next\getsp
    \else
      \ifx\next\limits
        \let\next\eatlimits
      \else
        \ifx\next\nolimits
          \let\next\eatlimits
        \else
          \let\next\ooooint
        \fi
      \fi
    \fi
  \fi
  \next}
\def\getsb_#1{\def\isb{#1}\futurelet\next\oooint}
\def\getsp^#1{\def\isp{#1}\futurelet\next\oooint}
\def\eatlimits#1{\let\li#1\futurelet\next\oooint}
\def\ooooint#1\right.{%
 \mathop{\nulldelimiterspace=0pt\ooleft\delimiter"4420420\vphantom{#1}\right.}%
 \li_{\isb}^{\isp}#1}

\[
\int_{-\infty}^{\infty}abc^{a^{b^{d^e}}}dx\
\left\int^{\infty}_{-\infty}
\left(\begin{array}{llll}
a&b&c&d\\
e&f&g&h\\
i&j&k&l\\
m&n&o&p\\\end{array}\right)\right.dx\
\left\int\nolimits_{-\infty}^{\infty}abc^{a^{b^{d^e}}}\right.dx
\]

\end{document}





