%%% ====================================================================
%%%  @LaTeX-file{
%%%     author          = "Scott Pakin",
%%%     version         = "10.1",
%%%     date            = "03 January 2008",
%%%     time            = "11:05:50 MST",
%%%     filename        = "symbols.tex",
%%%     checksum        = "11065 11464 36072 469668",
%%%     email           = "scott+clsl@pakin.org (Internet)",
%%%     codetable       = "ISO/ASCII",
%%%     keywords        = "symbols, LaTeX2e, typesetting, accents,
%%%                        mathematics, scientific, dingbats, fonts",
%%%     supported       = "yes",
%%%     abstract        = "This document lists thousands of symbols and
%%%                        the corresponding LaTeX commands that
%%%                        produce them.  Some of these symbols are
%%%                        guaranteed to be available in every LaTeX2e
%%%                        system; others require fonts and packages
%%%                        that may not accompany a given distribution
%%%                        and that therefore need to be installed.
%%%                        All of the fonts and packages used to
%%%                        prepare this document -- as well as this
%%%                        document itself -- are freely available
%%%                        from the Comprehensive TeX Archive Network
%%%                        (http://www.ctan.org).",
%%%     docstring       = "This LaTeX document showcases thousands of
%%%                        symbols that are available to authors.  The
%%%                        original version of this document was
%%%                        written by David Carlisle on 1994/10/02.
%%%                        It was subsequently changed and expanded by
%%%                        Scott Pakin.
%%%
%%%                        To build this document, run ``latex
%%%                        symbols'', then ``makeindex -s gind.ist
%%%                        symbols'', then two more ``latex symbols''
%%%                        commands.  This ensures the stability of
%%%                        all generated content (tables, references,
%%%                        etc.)
%%%
%%%                        The checksum field above contains a CRC-16
%%%                        checksum as the first value, followed by
%%%                        the equivalent of the standard UNIX wc
%%%                        (word count) utility output of lines,
%%%                        words, and characters.  This is produced by
%%%                        Robert Solovay's checksum utility.  This file
%%%                        header was produced with the help of Nelson
%%%                        Beebe's filehdr utility.  Both checksum and
%%%                        filehdr are available from CTAN
%%%                        (http://www.ctan.org)."
%%%  }
%%% ====================================================================

\NeedsTeXFormat{LaTeX2e}

\documentclass{article}
\usepackage{array}
\usepackage{longtable}
\usepackage{textcomp}
\usepackage{latexsym}
\usepackage{varioref}
\usepackage{xspace}
\usepackage{makeidx}
\usepackage{verbatim}
\usepackage{graphicx}
\usepackage{tabularx}

\newcommand{\doctitle}{Comprehensive \LaTeX\ Symbol List}  % Reusable
\title{The \doctitle}

\author{\person{Scott}{Pakin} \texttt{<scott+clsl@pakin.org>}%
  \thanks{The original version of this document was written by
    \person{David}{Carlisle}, with several additional tables provided by
    \person{Alexander}{Holt}.  See Section~\vref{about-doc} for more
    information about who did what.}}
\date{3 January 2008}

\makeindex

%%%
%%% TO-DO LIST
%%%   * Proofread, especially looking for symbols defined by more
%%%     than one symbol set or symbols that should be in a table
%%%     but aren't.
%%%   * Figure out how to make this file play nice with hyperref.
%%%   * Add more symbol tables.  (Did we miss any common, standard, or
%%%     useful ones?)
%%%   * Further index symbols by _description_ (e.g., "perpendicular"
%%%     for "\perp").  This would be really useful, but extremely
%%%     time-consuming to do.  Note that Adobe's Web site has a list
%%%     of the names of all the Zapf Dingbats characters.  Unfortunately,
%%%     these names can be rather long, like "notched upper right-shadowed
%%%     white rightwards arrow" for \ding{241}.
%%%   * Find some way to associate each package with a flag indicating
%%%     whether the corresponding fonts are in bitmapped or vector
%%%     format.
%%%   * Verify that there aren't any missing symbols in the current
%%%     packages (especially after font upgrades).
%%%


% Index "X Y" and "Y, X".  The "begin" and "end" variants are for page ranges.
\newcommand{\idxboth}[2]{\mbox{}\index{#1 #2}\index{#2>#1}}
\newcommand{\idxbothbegin}[2]{\mbox{}\index{#1 #2|(}\index{#2>#1|(}}
\newcommand{\idxbothend}[2]{\mbox{}\index{#1 #2|)}\index{#2>#1|)}}

% Index logical styles.
\newcommand{\pkgname}[1]{%
  \textsf{#1}%
  \index{#1=\textsf{#1} (package)}%
  \index{packages>#1=\textsf{#1}}}
\newcommand{\optname}[2]{%
  \textsf{#2}%
  \index{#2=\textsf{#2} (\textsf{#1} package option)}%
  \index{package options>#2=\textsf{#2} (\textsf{#1})}}
\newcommand{\filename}[1]{%
  \texttt{#1}%
  \index{#1=\texttt{#1} (file)}}
\newcommand{\PSfont}[1]{%
  #1%
  \index{#1 (font)}%
  \index{fonts>#1}%
}
\DeclareRobustCommand{\person}[2]{#1\index{#2, #1} #2}

% Index common words and phrases.
\newcommand{\latex}{\LaTeX\index{LaTeX=\string\LaTeX}\xspace}
\newcommand{\latexE}{\LaTeXe\index{LaTeX2e=\string\LaTeXe}\xspace}
\newcommand{\metafont}{\MF\index{Metafont=\string\MF}\xspace}
\newcommand{\tex}{\TeX\index{TeX=\string\TeX}\xspace}
\newcommand{\xypic}{%
  \mbox{\kern-.1em X\kern-.3em\lower.4ex\hbox{Y\kern-.15em}-pic}%
  \index{Xy-pic=\mbox{\kern-.1em X\kern-.3em\lower.4ex\hbox{Y\kern-.15em}-pic}}}
\newcommand{\TeXbook}{%
  The \TeX{}book\index{TeXbook, The=\TeX{}book, The}~\cite{Knuth:ct-a}\xspace}
\newcommand{\ctt}{%
  \texttt{comp.text.tex}%
  \index{comp.text.tex=\texttt{comp.text.tex} (newsgroup)}\xspace}
\newcommand{\fntenc}[1][]{%
  \def\firstarg{#1}%
  font encoding%
  \ifx\firstarg\empty%
    \index{font encodings}%
  \else
    \index{font encodings>\firstarg}%
  \fi
}
\newcommand{\selftex}{\expandafter\filename\expandafter{\jobname.tex}\xspace}
\newcommand{\fontdefdtx}{\filename{fontdef.dtx}\xspace}
\newcommand{\thanhhanthe}{Th\`anh, H\`an Th\diatop[\'|\^e]}   % "|" confuses MakeIndex.
\newcommand{\postscript}{PostScript\index{PostScript}\xspace}

% Index TeXbook symbols and the CTAN repository.
\newcommand{\idxTBsyms}{%
  \index{symbols>TeXbook=\TeX{}book}%
  \index{TeXbook, The=\TeX{}book, The>symbols from}%
}
\newcommand{\idxCTAN}{%
  \index{Comprehensive TeX Archive Network=Comprehensive \string\TeX{} Archive Network}}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% There are a number of symbols (e.g., \Square) that are defined by      %
% multiple packages.  In order to typeset all the variants in this       %
% document, we have to give glyph a unique name.  To do that, we define  %
% \savesymbol{XXX}, which renames a symbol from \XXX to \origXXX, and    %
% \restoresymbols{yyy}{XXX}, which renames \origXXX back to \XXX and     %
% defines a new command, \yyyXXX, which corresponds to the most recently %
% loaded version of \XXX.                                                %
%                                                                        %

% Save a symbol that we know is going to get redefined.
\def\savesymbol#1{%
  \expandafter\let\expandafter\origsym\expandafter=\csname#1\endcsname
  \expandafter\let\csname orig#1\endcsname=\origsym
  \expandafter\let\csname#1\endcsname=\relax
}

% Restore a previously saved symbol, and rename the current one.
\def\restoresymbol#1#2{%
  \expandafter\let\expandafter\newsym\expandafter=\csname#2\endcsname
  \expandafter\global\expandafter\let\csname#1#2\endcsname=\newsym
  \expandafter\let\expandafter\origsym\expandafter=\csname orig#2\endcsname
  \expandafter\global\expandafter\let\csname#2\endcsname=\origsym
}

%                                                                        %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


% Each of the packages used by this document is loaded conditionally.
% However, it might be nice to know if we have a complete set.  So we
% define \ifcomplete which starts true, but gets set to false if any
% package is missing.
\newif\ifcomplete
\completetrue

% For debugging purposes we define a switch that enables us to toggle
% on and off the loading of packages.
\newif\ifloadpackages
\loadpackagestrue

% \IfStyFileExists* is just like \IfFileExists, except that it appends
% ".sty" to its first argument.  \IfStyFileExists is the same as
% \IfStyFileExists*, but it additionally adds its first argument to a list
% (\missingpkgs) and marks the document as incomplete (with
% \completefalse) if the .sty file doesn't exist.
\makeatletter
\newcommand{\missingpkgs}{}
\newcommand{\foundpkgs}{}
\newcommand{\if@sty@file@exists@star}[3]{%
  \ifloadpackages
    \IfFileExists{#1.sty}{#2}{#3}%
  \else
    #3%
  \fi
}
\newcommand{\if@sty@file@exists}[3]{%
  \ifloadpackages
    \IfFileExists{#1.sty}%
                 {#2\@cons\foundpkgs{{#1}}}%
                 {#3\completefalse\@cons\missingpkgs{{#1}}}%
  \else
    #3\completefalse\@cons\missingpkgs{{#1}}%
  \fi
}
\newcommand{\IfStyFileExists}{%
  \@ifstar{\if@sty@file@exists@star}{\if@sty@file@exists}%
}
\makeatother

% We get a few packages for free.
\makeatletter
\@cons\foundpkgs{{textcomp}}
\@cons\foundpkgs{{latexsym}}
\makeatother
\newcommand{\TC}{\pkgname{textcomp}}

% Typeset a string in various encodings.
\newcommand{\encone}[1]{{\fontencoding{T1}\selectfont#1}}
\newcommand{\encfour}[1]{{\fontencoding{T4}\selectfont#1}}
\newcommand{\encfive}[1]{{\fontencoding{T5}\selectfont#1}}

% Various punctuation marks confuse makeindex when used directly.
\let\magicrbrack=]
\let\magicequal=\=
\newcommand{\magicequalname}{\texttt{\string\=}}
\newcommand{\magicvertname}{\texttt{|}}
\newcommand{\magicVertname}{\texttt{\string\|}}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\newif\ifAMS
\newcommand\AMS{\AmS\index{AMS=\AmS}}
\makeatletter
\IfStyFileExists{amssymb}
  {\AMStrue
   \savesymbol{angle} \savesymbol{rightleftharpoons}
   \savesymbol{lefthapoondown} \savesymbol{rightharpoonup}
   \savesymbol{iint} \savesymbol{iiint}
   \savesymbol{iiiint} \savesymbol{idotsint}
   \let\orig@ifstar=\@ifstar
   \usepackage{amsmath}
   \usepackage{amssymb}
   \let\@ifstar=\orig@ifstar
   \restoresymbol{AMS}{angle} \restoresymbol{AMS}{rightleftharpoons}
   \restoresymbol{AMS}{lefthapoondown} \restoresymbol{AMS}{rightharpoonup}
   \restoresymbol{AMS}{iint} \restoresymbol{AMS}{iiint}
   \restoresymbol{AMS}{iiiint} \restoresymbol{AMS}{idotsint}
  }
  {
    % The following was modified from amsmath.sty.
    \newcommand{\AmSfont}{%
      \usefont{OMS}{cmsy}{m}{n}}
    \providecommand{\AmS}{{\protect\AmSfont
      A\kern-.1667em\lower.5ex\hbox{M}\kern-.125emS}}
  }
\makeatother

\newif\ifST
\newcommand\ST{\pkgname{stmaryrd}}
\IfStyFileExists{stmaryrd}
  {\STtrue
   \savesymbol{lightning}
   \savesymbol{bigtriangleup} \savesymbol{bigtriangledown}
   \usepackage{stmaryrd}
   \restoresymbol{ST}{lightning}
   \restoresymbol{ST}{bigtriangleup} \restoresymbol{ST}{bigtriangledown}
  }
  {}

\newif\ifEU
\IfStyFileExists{euscript}
  {\EUtrue\usepackage[mathcal]{euscript}
   \renewcommand{\mathcal}[1]{\mbox{\usefont{U}{eus}{m}{n}##1}}
  }
  {\let\CMcal\mathcal}

\newif\ifWASY
\newcommand\WASY{\pkgname{wasysym}}
\IfStyFileExists{wasysym}
  {\WASYtrue
   \savesymbol{lightning}
   \savesymbol{Box}
   \savesymbol{Diamond}
   \usepackage{wasysym}
   \restoresymbol{WASY}{lightning}
   \restoresymbol{WASY}{Box}
   \restoresymbol{WASY}{Diamond}
  }
  {}

\newif\ifPI
\newcommand\PI{\pkgname{pifont}}
\IfStyFileExists{pifont}
  {\PItrue\usepackage{pifont}}
  {}

% marvosym underwent a major rewrite for the 2000/05/01 version, adding
% a large number of new symbols.  If it looks like we have only the
% older version, pretend we don't have it at all.
\newif\ifMARV
\newcommand\MARV{\pkgname{marvosym}}
\makeatletter
\IfStyFileExists*{marvosym}
  {\usepackage{marvosym}[2000/05/01]  % Major rewrite at this version.
   \global\MARVtrue
   \@ifundefined{Denarius}            % \Denarius is a newer symbol.
     {\global\MARVfalse}
     {}
   \@ifundefined{MVRightarrow}        % \Mvrightarrow is an even newer symbol.
     {\global\MARVfalse}
     {}
  }
  {}
\makeatother

\newif\ifMAN
\newcommand\MAN{\pkgname{manfnt}}
\IfStyFileExists{manfnt}
  {\MANtrue\usepackage{manfnt}}
  {}

\newif\ifDING
\newcommand\DING{\pkgname{bbding}}
\IfStyFileExists{bbding}
  {\DINGtrue
   \savesymbol{Cross} \savesymbol{Square}
   \usepackage{bbding}
   \restoresymbol{ding}{Cross} \restoresymbol{ding}{Square}
  }
  {}

\newif\ifUTILD
\newcommand\UTILD{\pkgname{undertilde}}
\IfStyFileExists{undertilde}
  {\UTILDtrue\usepackage{undertilde}}
  {}

\newif\ifIFS
\newcommand\IFS{\pkgname{ifsym}}
\IfStyFileExists{ifsym}
  {\IFStrue
   \savesymbol{Letter} \savesymbol{Square} \savesymbol{Cross} \savesymbol{Sun}
   \savesymbol{TriangleUp} \savesymbol{TriangleDown} \savesymbol{Circle}
   \savesymbol{Lightning}
   \usepackage[alpine,clock,electronic,geometry,misc,weather]{ifsym}[2000/04/18]
   \restoresymbol{ifs}{Letter} \restoresymbol{ifs}{Square}
   \restoresymbol{ifs}{Cross} \restoresymbol{ifs}{Sun}
   \restoresymbol{ifs}{TriangleUp} \restoresymbol{ifs}{TriangleDown}
   \restoresymbol{ifs}{Circle} \restoresymbol{ifs}{Lightning}
  }
  {}

\newif\ifTIPA
\newcommand\TIPA{\pkgname{tipa}}
\IfStyFileExists{tipa}
  {\TIPAtrue\usepackage[safe]{tipa}}
  {}

\newif\ifTIPX
\newcommand\TIPX{\pkgname{tipx}}
\IfStyFileExists{tipx}
  {\TIPXtrue\usepackage{tipx}}
  {}

\newif\ifXIPA
\newcommand\XIPA{\pkgname{extraipa}}
\IfStyFileExists{extraipa}
  {\XIPAtrue\usepackage{extraipa}}
  {}

% We use the *-form of \IfStyFileExists, because the package is named
% "wsuipa", while the .sty file is named "ipa.sty".
\makeatletter
\newif\ifWIPA
\newcommand\WIPA{\pkgname{wsuipa}}
\IfStyFileExists*{ipa}
  {\@cons\foundpkgs{{wsuipa}}
   \WIPAtrue
   \savesymbol{baro} \savesymbol{eth} \savesymbol{openo} \savesymbol{thorn}
   \usepackage{ipa}
   \expandafter\xdef\csname ver@wsuipa.sty\endcsname{%
     \csname ver@ipa.sty\endcsname}
   \restoresymbol{WSU}{baro}  \restoresymbol{WSU}{eth}
   \restoresymbol{WSU}{openo} \restoresymbol{WSU}{thorn}
  }
  {\completefalse\@cons\missingpkgs{{wsuipa}}}
\makeatother

\newif\ifPHON
\newcommand\PHON{\pkgname{phonetic}}
\IfStyFileExists{phonetic}
  {\PHONtrue
   \savesymbol{esh} \savesymbol{eth} \savesymbol{hookb}
   \savesymbol{hookd} \savesymbol{hookh} \savesymbol{openo}
   \savesymbol{schwa} \savesymbol{taild} \savesymbol{thorn}
   \savesymbol{varg} \savesymbol{yogh}
   \usepackage{phonetic}
   \restoresymbol{PHON}{esh} \restoresymbol{PHON}{eth}
   \restoresymbol{PHON}{hookb} \restoresymbol{PHON}{hookd}
   \restoresymbol{PHON}{hookh} \restoresymbol{PHON}{openo}
   \restoresymbol{PHON}{schwa} \restoresymbol{PHON}{taild}
   \restoresymbol{PHON}{thorn} \restoresymbol{PHON}{varg}
   \restoresymbol{PHON}{yogh}

   % A few phonetic macros are fragile but need to be made robust.
   \DeclareRobustCommand{\PHONibar}{\ibar}
   \DeclareRobustCommand{\PHONrbar}{\rbar}
   \DeclareRobustCommand{\PHONvod}{\vod}
  }
  {}

\newif\ifULSY
\newcommand\ULSY{\pkgname{ulsy}}
\IfStyFileExists{ulsy}
  {\ULSYtrue\usepackage{ulsy}}
  {}

\newif\ifASP
\newcommand\ASP{\pkgname{ar}}
\IfStyFileExists{ar}
  {\ASPtrue\usepackage{ar}}
  {}

\newif\ifMETRE
\newcommand\METRE{\pkgname{metre}}
\IfStyFileExists{metre}
  {\METREtrue
   \savesymbol{breve}
   \newcommand{\breve}{PLACEHOLDER FOR RENEWCOMMAND}
   \usepackage{metre}
   \restoresymbol{METRE}{breve}
   %
   \DeclareRobustCommand{\METREantidiplestar}{\antidiple*}
   \DeclareRobustCommand{\METREantidiple}{\antidiple}
   \DeclareRobustCommand{\METREdiplestar}{\diple*}
   \DeclareRobustCommand{\METREdiple}{\diple}
   \DeclareRobustCommand{\METREobelusstar}{\obelus*}
   \DeclareRobustCommand{\METREobelus}{\obelus}
   \DeclareRobustCommand{\METRErespondens}{\respondens}
   \DeclareRobustCommand{\METREterminusstar}{\terminus*}
   \DeclareRobustCommand{\METREterminus}{\terminus}
   %
   \DeclareRobustCommand{\METREAntidiplestar}{\Antidiple*}
   \DeclareRobustCommand{\METREAntidiple}{\Antidiple}
   \DeclareRobustCommand{\METREDiplestar}{\Diple*}
   \DeclareRobustCommand{\METREDiple}{\Diple}
   \DeclareRobustCommand{\METREObelusstar}{\Obelus*}
   \DeclareRobustCommand{\METREObelus}{\Obelus}
   \DeclareRobustCommand{\METRERespondens}{\Respondens}
   \DeclareRobustCommand{\METRETerminusstar}{\Terminus*}
   \DeclareRobustCommand{\METRETerminus}{\Terminus}
  }
  {}

% pxfonts relies on txfonts (I think), so either package can be loaded.
% Note that txfonts/pxfonts redefine every LaTeX and AMS character,
% which is not what we want.  As a result, we have to rely on some
% serious trickery to prevent our old characters from getting redefined.
\newif\ifTX
\newcommand\TX{\pkgname{txfonts}}
\newcommand\PX{\pkgname{pxfonts}}
\newcommand\TXPX{\pkgname{txfonts}/\pkgname{pxfonts}}
\makeatletter
\IfStyFileExists{txfonts}
  {\TXtrue
   % Manually declare the new txfonts fonts.
   \DeclareSymbolFont{lettersA}{U}{txmia}{m}{it}
   \SetSymbolFont{lettersA}{bold}{U}{txmia}{bx}{it}
   \DeclareFontSubstitution{U}{txmia}{m}{it}
   \DeclareSymbolFont{symbolsC}{U}{txsyc}{m}{n}
   \SetSymbolFont{symbolsC}{bold}{U}{txsyc}{bx}{n}
   \DeclareFontSubstitution{U}{txsyc}{m}{n}
   \DeclareSymbolFont{largesymbolsA}{U}{txexa}{m}{n}
   \SetSymbolFont{largesymbolsA}{bold}{U}{txexa}{bx}{n}
   \DeclareFontSubstitution{U}{txexa}{m}{n}
   % Prevent txfonts from redeclaring any old fonts.
   \let\origDeclareMathAlphabet=\DeclareMathAlphabet
   \renewcommand{\DeclareMathAlphabet}[5]{}
   \let\origDeclareSymbolFont=\DeclareSymbolFont
   \renewcommand{\DeclareSymbolFont}[5]{}
   \let\origSetSymbolFont=\SetSymbolFont
   \renewcommand{\SetSymbolFont}[6]{}
   \let\origDeclareFontSubstitution=\DeclareFontSubstitution
   \renewcommand{\DeclareFontSubstitution}[4]{}
   % Load txfonts.
   \savesymbol{angle} \savesymbol{rightleftharpoons}
   \usepackage{txfonts}
   \restoresymbol{TX}{angle} \restoresymbol{TX}{rightleftharpoons}
   % Restore the old font commands.
   \global\let\DeclareSymbolFont=\origDeclareSymbolFont
   \global\let\SetSymbolFont=\origSetSymbolFont
   \global\let\DeclareFontSubstitution=\origDeclareFontSubstitution
   \global\let\DeclareMathAlphabet=\origDeclareMathAlphabet
   % Restore the default fonts.
   \renewcommand\rmdefault{cmr}
   \renewcommand\sfdefault{cmss}
   \renewcommand\ttdefault{cmtt}
   \ifAMS
     \DeclareMathAlphabet\mathfrak{U}{euf}{m}{n}
   \fi
   % Are \textcent, \textsterling, \mathcent, \mathsterling, \L, \l,
   % and \r the only symbols that get screwed up?
   \let\origtextcent=\textcent
   \gdef\textcent{{\fontencoding{TS1}\selectfont\origtextcent}}
   \let\origtextsterling=\textsterling
   \gdef\textsterling{{\fontencoding{TS1}\selectfont\origtextsterling}}
   \DeclareTextCommand{\L}{OT1}
     {\leavevmode\setbox\z@\hbox{L}\hb@xt@\wd\z@{\hss\@xxxii L}}
   \DeclareTextCommand{\l}{OT1}
     {{\@xxxii l}}
   \DeclareTextAccent{\r}{OT1}{23}
   \renewcommand{\mathcent}{\mbox{\usefont{OT1}{txr}{m}{n}\char"A2}}
   \renewcommand{\mathsterling}{\mbox{\usefont{OT1}{txr}{m}{n}\char"A3}}
  }
  {}
\makeatother

% Here's a real problem child: mathabx, which also redefines virtually
% every symbol provided by LaTeX2e and AMS.  We have to resort to our
% most devious trickery to get mathabx to load properly.
\newif\ifABX
\newcommand\ABX{\pkgname{mathabx}}
\let\origDeclareMathSymbol=\DeclareMathSymbol
\let\origDeclareMathDelimiter=\DeclareMathDelimiter
\let\origDeclareMathRadical=\DeclareMathRadical
\let\origDeclareMathAccent=\DeclareMathAccent
\makeatletter
  % Redefine \DeclareMathSymbol to stick "ABX" in front of each symbol name.
  \renewcommand{\DeclareMathSymbol}[4]{%
    \let\mathabx@undefine=\@gobble  % Undefining symbols causes all sorts of problems for us.
    \edef\newname{\expandafter\@gobble\string#1}
    \ifx\newname\@empty
    \else
      \edef\newname{ABX\newname}
      \expandafter\origDeclareMathSymbol\expandafter{%
        \csname\newname\endcsname}{#2}{#3}{#4}%
    \fi
  }
  % Do the same for \DeclareMathDelimiter.
  \def\DeclareMathDelimiter#1{%
    \edef\newname{\expandafter\@gobble\string#1}
    \def\eatfour##1##2##3##4{}%
    \def\eatfive##1##2##3##4##5{}%
    \ifx\newname\@empty
      \if\relax\noexpand#1%
        \def\next{\eatfive}
      \else
        \def\next{\eatfour}
      \fi
    \else
      \edef\newname{ABX\newname}
      \def\next{%
        \expandafter\origDeclareMathDelimiter\expandafter{%
          \csname\newname\endcsname}}
    \fi
    \next
  }
  % Do the same for \DeclareMathAccent.
  \renewcommand{\DeclareMathAccent}[4]{%
    \edef\newname{\expandafter\@gobble\string#1}
    \ifx\newname\@empty
    \else
      \edef\newname{ABX\newname}
      \expandafter\origDeclareMathAccent\expandafter{%
        \csname\newname\endcsname}{#2}{#3}{#4}%
    \fi
  }
  % Redefine \DeclareMathRadical to do nothing.
  \renewcommand{\DeclareMathRadical}[5]{}
\makeatother
\let\proofmode=1
\IfStyFileExists{mathabx}
  {\ABXtrue
   \savesymbol{not} \savesymbol{widering}\savesymbol{Moon}
   \savesymbol{notowner} \savesymbol{iint} \savesymbol{iiint}
   \savesymbol{oint} \savesymbol{oiint} \savesymbol{bigboxperp}
   \savesymbol{bigoperp} \savesymbol{boxedcirc} \savesymbol{boxeddash}
   \savesymbol{boxeedast} \savesymbol{boxperp} \savesymbol{boy}
   \savesymbol{Cap} \savesymbol{centerdot} \savesymbol{circledast}
   \savesymbol{circledcirc} \savesymbol{circleddash} \savesymbol{Cup}
   \savesymbol{curvearrowtopleft} \savesymbol{curvearrowtopleftright}
   \savesymbol{curvearrowtopright} \savesymbol{doteqdot}
   \savesymbol{geqslant} \savesymbol{gets} \savesymbol{girl}
   \savesymbol{Join} \savesymbol{land} \savesymbol{leqslant}
   \savesymbol{looparrowupleft} \savesymbol{looparrowupright}
   \savesymbol{lor} \savesymbol{lsemantic}
   \savesymbol{mayaleftdelimiter} \savesymbol{mayarightdelimiter}
   \savesymbol{ndivides} \savesymbol{nequiv} \savesymbol{ngeqslant}
   \savesymbol{ni} \savesymbol{nleqslant} \savesymbol{notni}
   \savesymbol{notowns} \savesymbol{notsign} \savesymbol{operp}
   \savesymbol{rsemantic} \savesymbol{sqCap} \savesymbol{sqCup}
   \savesymbol{to} \savesymbol{ulsh} \savesymbol{ursh}
   \savesymbol{overbrace} \savesymbol{underbrace}
   \savesymbol{overgroup} \savesymbol{undergroup}
   \savesymbol{dddot} \savesymbol{ddddot}

   \usepackage{mathabx}

   \restoresymbol{ABX}{not} \restoresymbol{ABX}{widering}
   \restoresymbol{ABX}{Moon} \restoresymbol{ABX}{notowner}
   \restoresymbol{ABX}{iint} \restoresymbol{ABX}{iiint}
   \restoresymbol{ABX}{oint} \restoresymbol{ABX}{oiint}
   \restoresymbol{ABX}{bigboxperp} \restoresymbol{ABX}{bigoperp}
   \restoresymbol{ABX}{boxedcirc} \restoresymbol{ABX}{boxeddash}
   \restoresymbol{ABX}{boxeedast} \restoresymbol{ABX}{boxperp}
   \restoresymbol{ABX}{boy} \restoresymbol{ABX}{Cap}
   \restoresymbol{ABX}{centerdot} \restoresymbol{ABX}{circledast}
   \restoresymbol{ABX}{circledcirc} \restoresymbol{ABX}{circleddash}
   \restoresymbol{ABX}{Cup} \restoresymbol{ABX}{curvearrowtopleft}
   \restoresymbol{ABX}{curvearrowtopleftright}
   \restoresymbol{ABX}{curvearrowtopright}
   \restoresymbol{ABX}{doteqdot} \restoresymbol{ABX}{geqslant}
   \restoresymbol{ABX}{gets} \restoresymbol{ABX}{girl}
   \restoresymbol{ABX}{Join} \restoresymbol{ABX}{land}
   \restoresymbol{ABX}{leqslant} \restoresymbol{ABX}{looparrowupleft}
   \restoresymbol{ABX}{looparrowupright} \restoresymbol{ABX}{lor}
   \restoresymbol{ABX}{lsemantic}
   \restoresymbol{ABX}{mayaleftdelimiter}
   \restoresymbol{ABX}{mayarightdelimiter}
   \restoresymbol{ABX}{ndivides} \restoresymbol{ABX}{nequiv}
   \restoresymbol{ABX}{ngeqslant} \restoresymbol{ABX}{ni}
   \restoresymbol{ABX}{nleqslant} \restoresymbol{ABX}{notni}
   \restoresymbol{ABX}{notowns} \restoresymbol{ABX}{notsign}
   \restoresymbol{ABX}{operp} \restoresymbol{ABX}{rsemantic}
   \restoresymbol{ABX}{sqCap} \restoresymbol{ABX}{sqCup}
   \restoresymbol{ABX}{to} \restoresymbol{ABX}{ulsh}
   \restoresymbol{ABX}{ursh} \restoresymbol{ABX}{overbrace}
   \restoresymbol{ABX}{underbrace} \restoresymbol{ABX}{overgroup}
   \restoresymbol{ABX}{undergroup}
   \restoresymbol{ABX}{dddot} \restoresymbol{ABX}{ddddot}
  }
  {}
\let\DeclareMathAccent=\origDeclareMathAccent
\let\DeclareMathRadical=\origDeclareMathRadical
\let\DeclareMathDelimiter=\origDeclareMathDelimiter
\let\DeclareMathSymbol=\origDeclareMathSymbol
\ifABX
  % Define only those accents that are not defined elsewhere.
  \DeclareMathAccent{\widecheck}     {0}{mathx}{"71}
  \DeclareMathAccent{\widebar}       {0}{mathx}{"73}
  \DeclareMathAccent{\widearrow}     {0}{mathx}{"74}
  % Redefine all let-bound symbols.
  \let\ABXcenterdot=\ABXsqbullet
  \let\ABXcircledast=\ABXoasterisk
  \let\ABXcircledcirc=\ABXocirc
  % Redefine commands that are used by other commands.
  \DeclareMathSymbol{\ABXnotsign}    {3}{matha}{"7F}
  \DeclareMathSymbol{\ABXvarnotsign} {3}{mathb}{"7F}
  \DeclareMathSymbol{\ABXnotowner}   {3}{matha}{"53}
  \makeatletter
    \def\ABXoverbrace{\overbrace@{\bracefill\ABXbraceld\ABXbracemd\ABXbracerd\ABXbracexd}}
    \def\ABXunderbrace{\underbrace@{\bracefill\ABXbracelu\ABXbracemu\ABXbraceru\ABXbracexu}}
    \def\ABXovergroup{\overbrace@{\bracefill\ABXbraceld{}\ABXbracerd\ABXbracexd}}
    \def\ABXundergroup{\underbrace@{\bracefill\ABXbracelu{}\ABXbraceru\ABXbracexu}}
  \makeatother
  % Define a command to select the mathb font.
  \newcommand{\mathbfont}{\usefont{U}{mathb}{m}{n}}
\fi    % ABX test

\newif\ifFC
\newcommand\FC{\pkgname{fc}}
\IfStyFileExists{fclfont}
  {\FCtrue
   \let\origlbrace=\{
   \let\origrbrace=\}
   \let\origbar=\|
   \let\origdollar=\$
   \let\origspace=\_
   \let\origS=\S
   \let\origpounds=\pounds
   \input{t4enc.def}
   \DeclareTextAccent{\FCbar}{T4}{'277}% single universal accent
   \global\let\{=\origlbrace
   \global\let\}=\origrbrace
   \global\let\|=\origbar
   \global\let\$=\origdollar
   \global\let\_=\origspace
   \global\let\S=\origS
   \global\let\pounds=\origpounds
   \let\origtextsterling=\textsterling
   \gdef\textsterling{{\fontencoding{TS1}\selectfont\origtextsterling}}
  }
  {}

% skak should be loaded before ascii because their \FF macros conflict.
% (skak's \FF is not a symbol so it can simply be set to \relax.)
\newif\ifSKAK
\newcommand\SKAK{\pkgname{skak}}
\IfStyFileExists{skak}
  {\SKAKtrue
   \savesymbol{etc}
   \savesymbol{see}
   \usepackage{skak}
   \restoresymbol{SKAK}{etc}
   \restoresymbol{SKAK}{see}
   \let\FF=\relax
  }
  {}

\newif\ifASCII
\newcommand\ASCII{\pkgname{ascii}}
\IfStyFileExists{ascii}
  {\ASCIItrue
   \savesymbol{HT}
   \usepackage{ascii}
   \restoresymbol{ascii}{HT}
  }
  {}

\newif\ifARK                           % ark10 and dingbat fonts
\newcommand\ARK{\pkgname{dingbat}}
\IfStyFileExists{dingbat}
  {\ARKtrue
   \savesymbol{checkmark}
   \usepackage{dingbat}
   \restoresymbol{ARK}{checkmark}
   \DeclareRobustCommand{\ARKlargepencil}{\largepencil\rule{0pt}{7ex}}
  }
  {}

\newif\ifSKULL
\newcommand\SKULL{\pkgname{skull}}
\IfStyFileExists{skull}
  {\SKULLtrue
   \let\origDeclareSymbolFont=\DeclareSymbolFont
   \let\origDeclareMathSymbol=\DeclareMathSymbol
   \def\DeclareSymbolFont##1##2##3##4##5{}
   \def\DeclareMathSymbol##1##2##3##4{}
   \usepackage{skull}
   \let\DeclareSymbolFont=\origDeclareSymbolFont
   \let\DeclareMathSymbol=\origDeclareMathSymbol
   \newcommand{\skull}{{\usefont{U}{skulls}{m}{n}\char'101}}
  }
  {}

\newif\ifEUSYM
\newcommand\EUSYM{\pkgname{eurosym}}
\IfStyFileExists{eurosym}
  {\EUSYMtrue\usepackage{eurosym}}
  {}

\newif\ifESV
\newcommand\ESV{\pkgname{esvect}}
\IfStyFileExists{esvect}
  {\ESVtrue
   \usepackage{esvect}
   \DeclareMathSymbol{\fldra}{\mathrel}{esvector}{'021}
   \DeclareMathSymbol{\fldrb}{\mathrel}{esvector}{'022}
   \DeclareMathSymbol{\fldrc}{\mathrel}{esvector}{'023}
   \DeclareMathSymbol{\fldrd}{\mathrel}{esvector}{'024}
   \DeclareMathSymbol{\fldre}{\mathrel}{esvector}{'025}
   \DeclareMathSymbol{\fldrf}{\mathrel}{esvector}{'026}
   \DeclareMathSymbol{\fldrg}{\mathrel}{esvector}{'027}
   \DeclareMathSymbol{\fldrh}{\mathrel}{esvector}{'030}
  }
  {}

% yfonts re-encodes \aa and \AA as LY, so we have to re-re-encode them
% as OT1.
\IfStyFileExists{yfonts}
  {\usepackage{yfonts}
   \DeclareTextCommand{\aa}{OT1}{{\accent23a}}
   \DeclareTextCommand{\AA}{OT1}{{\accent23A}}}
  {}

\newif\ifYH
\newcommand\YH{\pkgname{yhmath}}
\IfStyFileExists{yhmath}
  {\YHtrue
   \let\origRequirePackage=\RequirePackage    % We don't want amsmath loaded.
   \def\RequirePackage##1{}
   \usepackage{yhmath}
   \let\RequirePackage=\origRequirePackage
  }
  {}

% At the time of this writing we're completely out of math alphabets.
% (Knuth shortsightedly assumed that 16 would be plenty for anyone.)
% Hence, instead of loading the esint package we manually define all of
% its characters as text characters.  Yuck.
\newif\ifES
\newcommand\ES{\pkgname{esint}}
\IfStyFileExists{esint}
  {\EStrue
   % Center an esint character against an ordinary integral.
   \newsavebox{\esbox}
   \newlength{\intcenterdelta}
   \newcommand{\esintchar}[1]{%
     \ifodd##1
       \sbox{\esbox}{$\int$}%
     \else
       \sbox{\esbox}{$\displaystyle\int$}%
     \fi
     \setlength  {\intcenterdelta}{0.5\ht\esbox}%
     \addtolength{\intcenterdelta}{-0.5\dp\esbox}%
     \sbox{\esbox}{\usefont{U}{esint}{m}{n}\char##1\relax}%
     \addtolength{\intcenterdelta}{-0.5\ht\esbox}%
     \addtolength{\intcenterdelta}{0.5\dp\esbox}%
     \raisebox{\intcenterdelta}{\usebox{\esbox}}%
   }
   % Manually define all of the characters we care about.
   \newcommand{\ESintT}{\esintchar{'001}}
   \newcommand{\ESintD}{\esintchar{'002}}
   \newcommand{\ESiintT}{\esintchar{'003}}
   \newcommand{\ESiintD}{\esintchar{'004}}
   \newcommand{\ESiiintT}{\esintchar{'005}}
   \newcommand{\ESiiintD}{\esintchar{'006}}
   \newcommand{\ESiiiintT}{\esintchar{'007}}
   \newcommand{\ESiiiintD}{\esintchar{'010}}
   \newcommand{\ESdotsintT}{\esintchar{'011}}
   \newcommand{\ESdotsintD}{\esintchar{'012}}
   \newcommand{\ESointT}{\esintchar{'013}}
   \newcommand{\ESointD}{\esintchar{'014}}
   \newcommand{\ESoiintT}{\esintchar{'015}}
   \newcommand{\ESoiintD}{\esintchar{'016}}
   \newcommand{\ESsqintT}{\esintchar{'017}}
   \newcommand{\ESsqintD}{\esintchar{'020}}
   \newcommand{\ESsqiintT}{\esintchar{'021}}
   \newcommand{\ESsqiintD}{\esintchar{'022}}
   \newcommand{\ESointctrclockwiseT}{\esintchar{'027}}
   \newcommand{\ESointctrclockwiseD}{\esintchar{'030}}
   \newcommand{\ESointclockwiseT}{\esintchar{'031}}
   \newcommand{\ESointclockwiseD}{\esintchar{'032}}
   \newcommand{\ESvarointclockwiseT}{\esintchar{'033}}
   \newcommand{\ESvarointclockwiseD}{\esintchar{'034}}
   \newcommand{\ESvarointctrclockwiseT}{\esintchar{'035}}
   \newcommand{\ESvarointctrclockwiseD}{\esintchar{'036}}
   \newcommand{\ESfintT}{\esintchar{'037}}
   \newcommand{\ESfintD}{\esintchar{'040}}
   \newcommand{\ESvaroiintT}{\esintchar{'041}}
   \newcommand{\ESvaroiintD}{\esintchar{'042}}
   \newcommand{\ESlandupintT}{\esintchar{'043}}
   \newcommand{\ESlandupintD}{\esintchar{'044}}
   \newcommand{\ESlanddownintT}{\esintchar{'045}}
   \newcommand{\ESlanddownintD}{\esintchar{'046}}
  }
  {}

\newif\ifMDOTS
\newcommand\MDOTS{\pkgname{mathdots}}
\IfStyFileExists{mathdots}
  {\MDOTStrue
   \savesymbol{ddots}
   \savesymbol{vdots}
   \savesymbol{iddots}
   \savesymbol{dddot}
   \savesymbol{ddddot}
   \usepackage{mathdots}
   \restoresymbol{MDOTS}{ddots}
   \restoresymbol{MDOTS}{vdots}
   \restoresymbol{MDOTS}{iddots}
   \restoresymbol{MDOTS}{dddot}
   \restoresymbol{MDOTS}{ddddot}
  }
  {}

\newif\ifTRSYM
\newcommand\TRSYM{\pkgname{trsym}}
\IfStyFileExists{trsym}
  {% We're painfully low on math alphabets so we define trsym's symbols in
   % text mode.
   \TRSYMtrue
   \newcommand{\transfsymbol}[1]{{\usefont{U}{trsy}{m}{n}##1}}
   \let\origDeclareSymbolFont=\DeclareSymbolFont
   \let\origDeclareMathSymbol=\DeclareMathSymbol
   \renewcommand{\DeclareSymbolFont}[5]{}
   \renewcommand{\DeclareMathSymbol}[4]{\gdef##1{\transfsymbol{\char##4}}}
   \usepackage{trsym}
   \let\DeclareSymbolFont=\origDeclareSymbolFont
   \let\DeclareMathSymbol=\origDeclareMathSymbol
  }
  {}

% We use the *-form of \IfStyFileExists, because the package is named
% "universa", while the .sty file is named "uni.sty".
\makeatletter
\newif\ifUNI
\newcommand\UNI{\pkgname{universa}}
\IfStyFileExists*{uni}
  {\@cons\foundpkgs{{universa}}
   \UNItrue
   \usepackage{uni}
   \expandafter\xdef\csname ver@universa.sty\endcsname{%
     \csname ver@uni.sty\endcsname}
   % Redefine all of uni's non-textual symbols to use the Universal font.
   \renewcommand{\bausquare}{{\usefont{OT1}{uni}{m}{n}\char"00}}
   \renewcommand{\baucircle}{{\usefont{OT1}{uni}{m}{n}\char"01}}
   \renewcommand{\bautriangle}{{\usefont{OT1}{uni}{m}{n}\char"02}}
   \renewcommand{\bauhead}{{\usefont{OT1}{uni}{m}{n}\char"03}}
   \renewcommand{\bauforms}{{\usefont{OT1}{uni}{m}{n}\char"04}}
  }
  {\completefalse\@cons\missingpkgs{{universa}}}
\makeatother

\newif\ifUPGR
\newcommand\UPGR{\pkgname{upgreek}}
\IfStyFileExists{upgreek}
  {% We're painfully low on math alphabets so we define upgreek's symbols
   % in text mode.
   \UPGRtrue
   \let\origDeclareSymbolFont=\DeclareSymbolFont
   \let\origDeclareMathSymbol=\DeclareMathSymbol
   \let\origSetSymbolFont=\SetSymbolFont
   \renewcommand{\DeclareSymbolFont}[5]{}
   \renewcommand{\DeclareMathSymbol}[4]{%
     \newcommand{##1}{{\usefont{U}{psy}{m}{n}\char##4}}%
   }
   \renewcommand{\SetSymbolFont}[6]{}
   \usepackage[Symbol]{upgreek}
   \DeclareFontFamily{U}{eur}{\skewchar\font'177}
   \DeclareFontShape{U}{eur}{m}{n}{%
     <-6> eurm5 <6-8> eurm7 <8-> eurm10}{}
   \let\DeclareSymbolFont=\origDeclareSymbolFont
   \let\DeclareMathSymbol=\origDeclareMathSymbol
   \let\SetSymbolFont=\origSetSymbolFont
  }
  {}

% overrightarrow depends upon various macros that are defined by AMS.
\newif\ifORA
\newcommand\ORA{\pkgname{overrightarrow}}
\makeatletter
\ifAMS
  \IfStyFileExists{overrightarrow}
    {\ORAtrue
     \savesymbol{Rightarrowfill@}
     \usepackage{overrightarrow}
     \restoresymbol{ORA}{Rightarrowfill@}
     \renewcommand{\Overrightarrow}{\mathpalette{\overarrow@\ORARightarrowfill@}}
    }
    {}
\fi    % AMS test
\makeatother

\newif\ifCHEMA
\newcommand\CHEMA{\pkgname{chemarr}}
\IfStyFileExists{chemarr}
  {\CHEMAtrue
   \let\origRequirePackage=\RequirePackage
   \renewcommand{\RequirePackage}[1]{}
   \usepackage{chemarr}
   \let\RequirePackage=\origRequirePackage
  }
  {}

\newif\ifCHEMB
\newcommand\CHEMB{\pkgname{chemarrow}}
\IfStyFileExists{chemarrow}
  {\CHEMBtrue\usepackage{chemarrow}}
  {}

% nath is another of those "problem packages" that redefine just about
% everything.  To make nath work in this document we need to explicitly
% define only those symbols that we actually need.
\newif\ifNATH
\newcommand\NATH{\pkgname{nath}}
\makeatletter
\IfStyFileExists{nath}
  {\NATHtrue
   \def\vin{\mathrel{\hbox{\hglue .1ex
     \vrule \@height .06ex \@width 1ex
     \vrule \@height 1.33ex \@width .06ex
     \hglue .4ex}}}

   \def\niv{\mathrel{\hbox{\hglue .2ex
     \vrule \@height 1.33ex \@width .06ex
     \vrule \@height .06ex \@width 1ex
     \hglue .5ex}}}

   % The following was derived from nath's \extend@delim macro.
   \newcommand*{\nathrep}[2]{%
     \setbox0\hbox{$\displaystyle##2$}%
     \count@=0
     \loop\ifnum\count@<##1
      ##2%
      \hskip -.75\wd0 \hskip .25ex%
      \advance\count@ by 1%
     \repeat
   }
   \newcommand*{\nathdouble}[1]{\nathrep{2}{##1}}
   \newcommand*{\nathtriple}[1]{\nathrep{3}{##1}}
  }
  {}
\makeatother

\newif\ifTRF
\newcommand\TRF{\pkgname{trfsigns}}
\IfStyFileExists{trfsigns}
  {\TRFtrue\usepackage{trfsigns}}
  {}

\newif\ifMTOOLS
\newcommand\MTOOLS{\pkgname{mathtools}}
\IfStyFileExists{mathtools}
  {\MTOOLStrue
   \savesymbol{xleftrightarrow} \savesymbol{xLeftarrow}
   \savesymbol{xRightarrow} \savesymbol{xLeftrightarrow}
   \savesymbol{xrightharpoondown} \savesymbol{xrightharpoonup}
   \savesymbol{xleftharpoondown} \savesymbol{xleftharpoonup}
   \savesymbol{xleftrightharpoons} \savesymbol{xrightleftharpoons}
   \savesymbol{xhookleftarrow} \savesymbol{xhookrightarrow}
   \savesymbol{xmapsto} \savesymbol{underbracket}
   \savesymbol{overbracket} \savesymbol{lparen} \savesymbol{rparen}
   \savesymbol{dblcolon} \savesymbol{coloneqq} \savesymbol{Coloneqq}
   \savesymbol{coloneq} \savesymbol{Coloneq} \savesymbol{eqqcolon}
   \savesymbol{Eqqcolon} \savesymbol{eqcolon} \savesymbol{Eqcolon}
   \savesymbol{colonapprox} \savesymbol{Colonapprox}
   \savesymbol{colonsim} \savesymbol{Colonsim} \savesymbol{overbrace}
   \savesymbol{underbrace}

   % The mathtools package delays the definitions of some of its symbols
   % to the \begin{document}.  We redefine \AtBeginDocument to force
   % mathtools to define everything immediately.
   \let\origAtBeginDocument=\AtBeginDocument
   \def\AtBeginDocument##1{##1}
   \usepackage[donotfixamsmathbugs]{mathtools}
   \let\AtBeginDocument=\origAtBeginDocument

   \restoresymbol{MTOOLS}{xleftrightarrow}
   \restoresymbol{MTOOLS}{xLeftarrow}
   \restoresymbol{MTOOLS}{xRightarrow}
   \restoresymbol{MTOOLS}{xLeftrightarrow}
   \restoresymbol{MTOOLS}{xrightharpoondown}
   \restoresymbol{MTOOLS}{xrightharpoonup}
   \restoresymbol{MTOOLS}{xleftharpoondown}
   \restoresymbol{MTOOLS}{xleftharpoonup}
   \restoresymbol{MTOOLS}{xleftrightharpoons}
   \restoresymbol{MTOOLS}{xrightleftharpoons}
   \restoresymbol{MTOOLS}{xhookleftarrow}
   \restoresymbol{MTOOLS}{xhookrightarrow}
   \restoresymbol{MTOOLS}{xmapsto}
   \restoresymbol{MTOOLS}{underbracket}
   \restoresymbol{MTOOLS}{overbracket} \restoresymbol{MTOOLS}{lparen}
   \restoresymbol{MTOOLS}{rparen} \restoresymbol{MTOOLS}{dblcolon}
   \restoresymbol{MTOOLS}{coloneqq} \restoresymbol{MTOOLS}{Coloneqq}
   \restoresymbol{MTOOLS}{coloneq} \restoresymbol{MTOOLS}{Coloneq}
   \restoresymbol{MTOOLS}{eqqcolon} \restoresymbol{MTOOLS}{Eqqcolon}
   \restoresymbol{MTOOLS}{eqcolon} \restoresymbol{MTOOLS}{Eqcolon}
   \restoresymbol{MTOOLS}{colonapprox}
   \restoresymbol{MTOOLS}{Colonapprox}
   \restoresymbol{MTOOLS}{colonsim} \restoresymbol{MTOOLS}{Colonsim}
   \restoresymbol{MTOOLS}{overbrace} \restoresymbol{MTOOLS}{underbrace}

   % Some of the above are defined in terms of \dblcolon.  At the time
   % of this writing it doesn't seem like any other package uses the
   % name \dblcolon so it should be safe to retain its mathtools
   % definition.
   \let\dblcolon=\MTOOLSdblcolon
  }
  {}

% We don't actually load the following as their symbols are all
% implemented in terms of existing symbols and we need to save math
% alphabets.
\newcommand\MC{\pkgname{mathcomp}}
\newcommand\GSYMB{\pkgname{gensymb}}

\newif\ifPHAI
\newcommand\PHAI{\pkgname{phaistos}}
\IfStyFileExists{phaistos}
  {\PHAItrue\usepackage{phaistos}}
  {}

\newif\ifARCS
\newcommand\ARCS{\pkgname{arcs}}
\IfStyFileExists{arcs}
  {\ARCStrue
   \usepackage{arcs}
   \def\RSpercentTolerance{5}  % Prevent \overarc and \underarc from hanging.
  }
  {}

% If we have t5enc.def, use it and its prerequisite definitions directly
% instead of loading vietnam.sty or dblaccent.sty, as these affect other
% things in the document.
\newif\ifVIET
\newcommand\VIET{\pkgname{vntex}}
\makeatletter
\IfStyFileExists{vietnam}
  {\VIETtrue\input{t5enc.def}}
  {}
\makeatother

\newif\ifPHONFC
\newcommand\PHONFC{\pkgname{t4phonet}}
\makeatletter
\IfStyFileExists{t4phonet}
  {\PHONFCtrue
   \let\origDeclareTextSymbol=\DeclareTextSymbol
   \let\origDeclareTextAccent=\DeclareTextAccent
   \renewcommand{\DeclareTextSymbol}[3]{%
     \edef\PHONFCsym{\expandafter\@gobble\string##1}%
     \expandafter\origDeclareTextSymbol\expandafter{%
       \csname PHONFC\PHONFCsym\endcsname}{##2}{##3}%
   }
   \renewcommand{\DeclareTextAccent}[3]{%
     \edef\PHONFCsym{\expandafter\@gobble\string##1}%
     \expandafter\origDeclareTextAccent\expandafter{%
       \csname PHONFC\PHONFCsym\endcsname}{##2}{##3}%
   }
   \usepackage{t4phonet}
   \let\DeclareTextSymbol=\origDeclareTextSymbol
   \let\DeclareTextAccent=\origDeclareTextAccent
  }
  {}
\makeatother

\newif\ifHOPO
\newcommand\HOPO{\pkgname{holtpolt}}
\IfStyFileExists{holtpolt}
  {\HOPOtrue\usepackage{holtpolt}}
  {}

\newif\ifSMTR
\newcommand\SMTR{\pkgname{semtrans}}
\IfStyFileExists{semtrans}
  {\SMTRtrue
   % semtrans's use of DeclareMathSymbol screws up \lhook and \rhook.
   \let\origDeclareMathSymbol=\DeclareMathSymbol
   \renewcommand{\DeclareMathSymbol}[4]{}
   \savesymbol{U}
   \savesymbol{D}
   \savesymbol{T}
   \usepackage{semtrans}
   \restoresymbol{smtr}{U}
   \restoresymbol{smtr}{D}
   \restoresymbol{smtr}{T}
   \let\DeclareMathSymbol=\origDeclareMathSymbol
  }
  {}

\newif\ifDICT
\newcommand\DICT{\pkgname{dictsym}}
\IfStyFileExists{dictsym}
  {\DICTtrue\usepackage{dictsym}}
  {}

\newif\ifEXTAR
\newcommand\EXTAR{\pkgname{extarrows}}
\IfStyFileExists{extarrows}
  {\EXTARtrue
   \savesymbol{xLeftrightarrow}
   \savesymbol{xleftrightarrow}
   \usepackage{extarrows}
   \restoresymbol{EXTAR}{xLeftrightarrow}
   \restoresymbol{EXTAR}{xleftrightarrow}
  }
  {}

\newif\ifPROTO
\newcommand\PROTO{\pkgname{protosem}}
\IfStyFileExists{protosem}
  {\PROTOtrue\usepackage{protosem}}
  {}

\newif\ifHARM
\newcommand\HARM{\pkgname{harmony}}
\IfStyFileExists{harmony}
  {\HARMtrue
   \let\orignewcommand=\newcommand
   \let\newcommand=\DeclareRobustCommand
   \savesymbol{HH}
   \usepackage{harmony}
   \restoresymbol{harm}{HH}
   \let\newcommand=\orignewcommand
  }
  {}

\newif\ifHIER
\newcommand\HIER{\pkgname{hieroglf}}
\IfStyFileExists{hieroglf}
  {\HIERtrue\usepackage{hieroglf}}
  {}

\newif\ifCCLIC
\newcommand\CCLIC{\pkgname{cclicenses}}
\IfStyFileExists{cclicenses}
  {\CCLICtrue
   \usepackage{cclicenses}
   % cclicenses doesn't get along with textcomp's remapping of
   % \textcircled to the TS1 font encoding.  Mapping it back doesn't
   % _seem_ to cause any problems.
   \DeclareTextAccentDefault{\textcircled}{OMS}
  }
  {}

% The mathdesign package primarily redefines all of the existing
% mathematical symbols and is therefore a pain to load.  Hence, we just
% check if it exists and then manually define all of the symbols we care
% about (i.e., those offered only by mathdesign).
\newif\ifMDES
\newcommand\MDES{\pkgname{mathdesign}}
\IfStyFileExists{mathdesign}
  {\MDEStrue
   % Symbols from mdputrma
   \DeclareFontEncoding{MDA}{}{}
   \DeclareFontFamily{MDA}{mdput}{}
   \DeclareFontShape{MDA}{mdput}{m}{n}{<-> mdputrma}{}
   \newcommand*{\textMDESa}[1]{{\usefont{MDA}{mdput}{m}{n}##1}}
   \DeclareRobustCommand{\MDESudtimes}{\textMDESa{\char"5D}}
   \DeclareRobustCommand{\MDESutimes}{\textMDESa{\char"5E}}
   \DeclareRobustCommand{\MDESdtimes}{\textMDESa{\char"5F}}
   % Symbols from mdputrmb
   \DeclareFontEncoding{MDB}{}{}
   \DeclareFontFamily{MDB}{mdput}{}
   \DeclareFontShape{MDB}{mdput}{m}{n}{<-> mdputrmb}{}
   \newcommand*{\textMDESb}[1]{{\usefont{MDB}{mdput}{m}{n}##1}}
   \DeclareRobustCommand{\MDESsmallin}{\textMDESb{\char"0}}
   \DeclareRobustCommand{\MDESsmallowns}{\textMDESb{\char"1}}
   \DeclareRobustCommand{\MDESnotsmallin}{\textMDESb{\char"2}}
   \DeclareRobustCommand{\MDESnotsmallowns}{\textMDESb{\char"3}}
   \DeclareRobustCommand{\MDESrightangle}{\textMDESb{\char"4}}
   \newcommand*{\MDESintsm}[1]{\raisebox{2ex}{\textMDESb{\char##1}}}
   \newcommand*{\MDESint}[1]{\raisebox{3ex}{\textMDESb{\char##1}}}
   \DeclareRobustCommand{\MDESintclockwisesm}{\MDESintsm{"80}}
   \DeclareRobustCommand{\MDESintclockwise}{\MDESint{"81}}
   \DeclareRobustCommand{\MDESointctrclockwisesm}{\MDESintsm{"82}}
   \DeclareRobustCommand{\MDESointctrclockwise}{\MDESint{"83}}
   \DeclareRobustCommand{\MDESointclockwisesm}{\MDESintsm{"84}}
   \DeclareRobustCommand{\MDESointclockwise}{\MDESint{"85}}
   \DeclareRobustCommand{\MDESoiintsm}{\MDESintsm{"86}}
   \DeclareRobustCommand{\MDESoiint}{\MDESint{"87}}
   \DeclareRobustCommand{\MDESoiiintsm}{\MDESintsm{"88}}
   \DeclareRobustCommand{\MDESoiiint}{\MDESint{"89}}
   % Symbols from mdputr7y
   \DeclareFontFamily{OMS}{mdput}{}
   \DeclareFontShape{OMS}{mdput}{m}{n}{<-> mdputr7y}{}
   \newcommand*{\textMDESy}[1]{{\usefont{OMS}{mdput}{m}{n}##1}}
   \DeclareRobustCommand{\MDESin}{\textMDESy{\char"32}}
   \DeclareRobustCommand{\MDESowns}{\textMDESy{\char"33}}
   \DeclareRobustCommand{\MDESnotin}{\textMDESy{\char"36}\textMDESy{\char"32}}
   % Symbols from mdputr7v
   \DeclareFontFamily{OMX}{mdput}{}
   \DeclareFontShape{OMX}{mdput}{m}{n}{<-> mdputr7v}{}
   \DeclareFontFamily{OMX}{mdbch}{}
   \DeclareFontShape{OMX}{mdbch}{m}{n}{<-> mdbchr7v}{}
   \DeclareFontFamily{OMX}{mdugm}{}
   \DeclareFontShape{OMX}{mdugm}{m}{n}{<-> mdugmr7v}{}
   \newcommand*{\textMDESv}[1]{{\usefont{OMX}{mdput}{m}{n}##1}}
   \newbox\MDESwavebox
   \DeclareRobustCommand{\MDESleftwavelet}{\textMDESv{\char"D0}}
   \DeclareRobustCommand{\MDESleftwave}{%
     \setbox\MDESwavebox=\hbox{\textMDESv{\char"D0}}
     \raisebox{-1.5\dp\MDESwavebox}{\vbox to 4\dp\MDESwavebox{\cleaders\copy\MDESwavebox\vfill}}}
   \DeclareRobustCommand{\MDESleftevawlet}{\textMDESv{\char"D1}}
   \DeclareRobustCommand{\MDESleftevaw}{%
     \setbox\MDESwavebox=\hbox{\textMDESv{\char"D1}}
     \raisebox{-1.5\dp\MDESwavebox}{\vbox to 4\dp\MDESwavebox{\cleaders\copy\MDESwavebox\vfill}}}
   % Symbols from mdputr8c
   \DeclareRobustCommand{\MDEStexteuro}{{\usefont{TS1}{mdput}{m}{n}\char"BF}}
  }
  {}

\newif\ifAREV
\newcommand\AREV{\pkgname{arev}}
\ifMDES    % AREV requires MDES to function properly.
\makeatletter
\IfStyFileExists{arev}
  {\AREVtrue
   % Store the package date but otherwise do nothing.
   \let\origRequirePackage=\RequirePackage
   \let\RequirePackage=\@gobble
   \usepackage{arev}
   \let\RequirePackage=\origRequirePackage
   % Define the characters we actually plan to display without actually
   % changing the font to Arev Sans.
   \DeclareFontFamily{U}{zavm}{}
   \DeclareFontShape{U}{zavm}{m}{n}{<-> favmr7y}{}
   \newcommand*{\textAREV}[1]{{\usefont{U}{zavm}{m}{n}##1}}
   \DeclareRobustCommand{\varspade}{\textAREV{\char"55}}
   \DeclareRobustCommand{\varheart}{\textAREV{\char"56}}
   \DeclareRobustCommand{\vardiamond}{\textAREV{\char"57}}
   \DeclareRobustCommand{\varclub}{\textAREV{\char"58}}
   \DeclareRobustCommand{\steaming}{\textAREV{\char"59}}
   \DeclareRobustCommand{\AREVquarternote}{\textAREV{\char"5A}}
   \DeclareRobustCommand{\AREVeighthnote}{\textAREV{\char"5B}}
   \DeclareRobustCommand{\AREVsixteenthnote}{\textAREV{\char"5C}}
  }
  {}
\makeatother
\fi

% Aaarrrggghhh!  MnSymbol conflicts with pretty much every mathematical
% symbol and, furthermore, defines most math alphabets than we can
% handle.  The situation has gotten so bad that we replace MnSymbol.sty
% with a generated, "faked" version that uses exclusively text fonts
% and renames all symbols to avoid conflicts.
\newif\ifMNS
\newcommand\MNS{\pkgname{MnSymbol}}
\IfStyFileExists{MnSymbol}
  {\MNStrue
   \let\origProvidesPackage=\ProvidesPackage
   \def\ProvidesPackage##1[##2]{\origProvidesPackage{##1}[##2]\endinput}
   \usepackage{MnSymbol}[2007/01/21]
   \let\ProvidesPackage=\origProvidesPackage
   \usepackage{fakeMnSymbol}
  }
  {}

% Manually define every symbol in cmll so we don't have to use any more
% math alphabets.
\newif\ifCMLL
\newcommand\CMLL{\pkgname{cmll}}
\IfStyFileExists{cmll}
  {\CMLLtrue
   \newcommand*{\textCMLL}[1]{{\usefont{U}{cmllr}{m}{n}##1}}
   \DeclareRobustCommand{\CMLLparr}{\textCMLL{\char0}}
   \DeclareRobustCommand{\CMLLshpos}{\textCMLL{\char1}}
   \DeclareRobustCommand{\CMLLshneg}{\textCMLL{\char2}}
   \DeclareRobustCommand{\CMLLshift}{\textCMLL{\char3}}
   \DeclareRobustCommand{\CMLLcoh}{\textCMLL{\char4}}
   \DeclareRobustCommand{\CMLLscoh}{\textCMLL{\char5}}
   \DeclareRobustCommand{\CMLLincoh}{\textCMLL{\char6}}
   \DeclareRobustCommand{\CMLLsincoh}{\textCMLL{\char7}}
   \DeclareRobustCommand{\CMLLbigwith}{\raisebox{2ex}{\textCMLL{\char8}}}
   \DeclareRobustCommand{\CMLLbigparr}{\raisebox{2ex}{\textCMLL{\char10}}}
  }
  {}

\newif\ifXPFEIL
\newcommand\XPFEIL{\pkgname{extpfeil}}
\IfStyFileExists{extpfeil}
  {\XPFEILtrue
   % extpfeil tries to do a \RequirePackage of stmaryrd with
   % conflicting options from what we used to load stmaryd.  We
   % therefore temporarily make \RequirePackage a no-op to prevent LaTeX
   % from complaining.
   \let\origRequirePackage=\RequirePackage
   \renewcommand*{\RequirePackage}[2][]{}
   \savesymbol{xlongequal}
   \savesymbol{xmapsto}
   \usepackage{extpfeil}
   \restoresymbol{XPFEIL}{xlongequal}
   \restoresymbol{XPFEIL}{xmapsto}
   \let\RequirePackage=\origRequirePackage
  }
  {}

\newif\ifKEYS
\newcommand\KEYS{\pkgname{keystroke}}
\IfStyFileExists{keystroke}
  {\KEYStrue
   \usepackage{keystroke}
   % \Tab and \BSpace's use of \reflectbox confuses our indexing code.
   \DeclareRobustCommand{\keysTab}{\Tab}
   \DeclareRobustCommand{\keysBSpace}{\BSpace}
  }
  {}

% We have no math alphabets left so we trick fge.sty into defining all of
% its characters in text mode.
\newif\ifFGE
\newcommand\FGE{\pkgname{fge}}
\makeatletter
\IfStyFileExists{fge}
  {\FGEtrue
   \let\origDeclareSymbolFont=\DeclareSymbolFont
   \let\origDeclareMathSymbol=\DeclareMathSymbol
   \renewcommand{\DeclareSymbolFont}[5]{}
   \renewcommand{\DeclareMathSymbol}[4]{%
     \newcommand{##1}{{\usefont{U}{##3}{m}{n}\char##4}}%
   }
   \usepackage{fge}
   \newcommand*{\spirituslenisAB}[2]{%
     \leavevmode
     \setbox0=\hbox{##2}%
     \@tempdima=\ht0
     \@tempdimb=\wd0
     \box0\llap{%
       \raisebox{\@tempdima}{%
         \makebox[\@tempdimb]{\usefont{U}{fgerm}{m}{n}\char##1}%
       }%
     }%
   }
   \DeclareRobustCommand{\spirituslenisA}[1]{\spirituslenisAB{"15}{##1}}
   \DeclareRobustCommand{\spirituslenisB}[1]{\spirituslenisAB{"16}{##1}}
   \let\spirituslenis=\spirituslenisA
   \let\DeclareSymbolFont=\origDeclareSymbolFont
   \let\DeclareMathSymbol=\origDeclareMathSymbol
  }
  {}
\makeatother

\newif\ifTURN
\newcommand\TURN{\pkgname{turnstile}}
\IfStyFileExists{turnstile}
  {\TURNtrue\usepackage{turnstile}}
  {}

\newif\ifSIMP
\newcommand\SIMP{\pkgname{simpsons}}
\IfStyFileExists{simpsons}
  {\SIMPtrue
   \usepackage{simpsons}
   \let\origSimpson=\Simpson
   \DeclareRobustCommand{\Simpson}{\origSimpson}
  }
  {}

\newif\ifEDICE
\newcommand\EDICE{\pkgname{epsdice}}
\IfStyFileExists{epsdice}
  {\EDICEtrue
   \usepackage{epsdice}
   \let\origepsdice=\epsdice
   \DeclareRobustCommand{\epsdice}[1]{\origepsdice{##1}}
   \DeclareRobustCommand{\allepsdice}{%
     \epsdice{1}%
     \epsdice{2}%
     \epsdice{3}%
     \epsdice{4}%
     \epsdice{5}%
     \epsdice{6}%
   }
  }
  {}

% feyn provides yet another math font for which we have no room.
% Fortunately, it's relatively easy to define all of its symbols in
% terms of a text font.
\newif\ifFEYN
\newcommand\FEYN{\pkgname{feyn}}
\IfStyFileExists{feyn}
  {\FEYNtrue
   \let\origProvidesPackage=\ProvidesPackage
   \def\ProvidesPackage##1[##2]{\origProvidesPackage{##1}[##2]\endinput}
   \savesymbol{filename}
   \usepackage{feyn}
   \restoresymbol{FEYN}{filename}
   \let\ProvidesPackage=\origProvidesPackage
   \DeclareFontFamily{OMS}{textfeyn}{\skewchar\font'000}
   \DeclareFontShape{OMS}{textfeyn}{m}{n}{%
     <-10.5>feyntext10%
     <10.5-11.5>feyntext11%
     <11.5->feyntext12%
   }{}
   \DeclareRobustCommand{\feyn}[1]{{\usefont{OMS}{textfeyn}{m}{n}##1}}
   \DeclareRobustCommand{\smallbosonloop}{\feyn{\char"20}}
   \DeclareRobustCommand{\bigbosonloop}{\feyn{\char"21}}
  }
  {}

% The universal package defines characters only locally within
% \textbayer or in a group containing \bayer.  Therefore, we need only
% to make \chardef temporarily export its symbols globally.
\newif\ifBAYER
\newcommand\BAYER{\pkgname{universal}}
\IfStyFileExists{universal}
  {\BAYERtrue
   \let\origlcurly=\{
   \let\origrcurly=\}
   \let\origbar=\|
   \let\origS=\S
   \savesymbol{baucircle} \savesymbol{bausquare} \savesymbol{bautriangle}
   \savesymbol{bauforms} \savesymbol{bauhead}
   \usepackage{universal}
   \begingroup
     \def\chardef##1="##2##3{%
       \gdef##1{{\usefont{OT1}{universal}{m}{n}\char"##2##3}}%
     }%
     \bayer
   \endgroup
   \let\{=\origlcurly
   \let\}=\origrcurly
   \let\|=\origbar
   \let\S=\origS
   \restoresymbol{BAYER}{baucircle} \restoresymbol{BAYER}{bausquare}
   \restoresymbol{BAYER}{bautriangle}
   \restoresymbol{BAYER}{bauforms} \restoresymbol{BAYER}{bauhead}
  }
  {}

\newif\ifSTAVE
\newcommand\STAVE{\pkgname{staves}}
\IfStyFileExists{staves}
  {\STAVEtrue\usepackage{staves}}
  {}

\newif\ifIGO
\newcommand\IGO{\pkgname{igo}}
\IfStyFileExists{igo}
  {\savesymbol{black}
   \savesymbol{white}
   \savesymbol{repeat}
   \IGOtrue\usepackage{igo}
   \restoresymbol{IGO}{black}
   \restoresymbol{IGO}{white}
   \restoresymbol{IGO}{repeat}
   % Define a version of \whitestone and \blackstone that avoid
   % bracketed arguments.
   \DeclareRobustCommand{\igowhitestone}[1]{\whitestone[##1]}
   \DeclareRobustCommand{\igoblackstone}[1]{\blackstone[##1]}
  }
  {}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% If we have mflogo.sty, use it.  Otherwise, define \MF the "boring" way.
\IfStyFileExists*{mflogo}
  {\usepackage{mflogo}}
  {\newcommand{\MF}{Metafont}}

% If we have booktabs.sty, use it.  Otherwise, define all its line types
% in terms of \hline and \cline.
\IfStyFileExists*{booktabs}
  {\usepackage{booktabs}}
  {\newcommand{\toprule}{\hline}
   \newcommand{\midrule}{\hline}
   \newcommand{\bottomrule}{\hline}
   \def\cmidrule(##1)##2{\cline{##2}}
  }

% If we have url.sty, use it.  Otherwise, define \url as \texttt.
\IfStyFileExists*{url}
  {\usepackage{url}
   \def\UrlBreaks{}
   \def\UrlBigBreaks{\do/}}
  {\newcommand{\url}[1]{\texttt{##1}}}

% If we have geometry.sty, use it.  Otherwise, a lot of tables are going
% to stick out into the margin.
\makeatletter
\IfStyFileExists*{geometry}
  {\usepackage{geometry}
   \@ifpackagelater{geometry}{2000/01/01}{\geometry{compat2}}
  }
  {}
\makeatother

% If we have multicol.sty, use it.
\newif\ifhavemulticol
\IfStyFileExists*{multicol}
  {\havemulticoltrue\usepackage{multicol}}
  {}

% If we have rotating.sty, use it.
\newif\ifhaverotating
\IfStyFileExists*{rotating}
  {\haverotatingtrue\usepackage{rotating}}
  {}

% If we have cancel.sty, use it.
\newif\ifhavecancel
\IfStyFileExists*{cancel}
  {\havecanceltrue\usepackage{cancel}}
  {}

% If we have slashed.sty, use it.
\newif\ifhaveslashed
\IfStyFileExists*{slashed}
  {\haveslashedtrue\usepackage{slashed}}
  {}

% If we have centernot.sty, use it.
\newif\ifhavecenternot
\IfStyFileExists*{centernot}
  {\havecenternottrue\usepackage{centernot}}
  {}

% If we have the accents package, use it (for an example in the section
% on constructing new symbols).
\newif\ifACCENTS
\IfStyFileExists{accents}
  {\ACCENTStrue
   \savesymbol{undertilde}
   \savesymbol{dddot}
   \savesymbol{ddddot}
   \usepackage{accents}
   \restoresymbol{ACCENTS}{undertilde}
   \restoresymbol{ACCENTS}{dddot}
   \restoresymbol{ACCENTS}{ddddot}
  }
  {}

% If we have the nicefrac package, use it (to show how to typeset fractions).
\newif\ifFRAC
\IfStyFileExists{nicefrac}
  {\FRACtrue
   \usepackage[nice]{nicefrac}
  }
  {}

% If we have the bm package, use it (to show how to typeset bold math).
\newif\ifBM
\IfStyFileExists{bm}
  {\BMtrue
   \usepackage{bm}
  }
  {}

% If we have ot2enc.def, use it (to show how to produce a Cyrillic "sha").
\newif\ifOTII
\IfFileExists{ot2enc.def}
  {\OTIItrue\input{ot2enc.def}}
  {}

% If we have needspace.sty, use it.  Otherwise, define \needspace as a no-op.
\IfStyFileExists*{needspace}
  {\usepackage{needspace}}
  {\newcommand{\needspace}[1]{}}

% If we have type1cm.sty, use it.
\IfStyFileExists*{type1cm}
  {\usepackage{type1cm}}
  {}

% If we have multirow.sty, use it.
\newif\ifhavemultirow
\IfStyFileExists*{multirow}
  {\havemultirowtrue\usepackage{multirow}}
  {}

% If we have simplewick.sty, use it.
\newif\ifhavesimplewick
\IfStyFileExists*{simplewick}
  {\havesimplewicktrue\usepackage{simplewick}}
  {}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Because most (La)TeX builds are limited to 16 math alphabets, we       %
% define our own _text_ commands below instead of doing a \usepackage,   %
% because the latter would invoke a \DeclareMathAlphabet.                %
%                                                                        %

\IfStyFileExists{mathrsfs}
  {\newcommand{\mathscr}[1]{\mbox{\usefont{U}{rsfs}{m}{n} ##1}}}
  {}

\IfStyFileExists{chancery}
  {\newcommand{\mathpzc}[1]{\mbox{\usefont{OT1}{pzc}{m}{it} ##1}}}
  {}

\IfStyFileExists{calligra}
  {\savesymbol{filename}
   \usepackage{calligra}
   \restoresymbol{CAL}{filename}
   \newcommand{\mathcalligra}[1]{\mbox{\usefont{T1}{calligra}{m}{n} ##1}}
  }
  {}

\IfStyFileExists{bbold}
  {\newcommand{\BBmathbb}[1]{\mbox{\usefont{U}{bbold}{m}{n} ##1}}
   % We have to manually define all of the symbols we care about.
   \newcommand{\BBsym}[1]{\ensuremath{\BBmathbb{\char##1}}}
   \newcommand{\Langle}{\BBsym{`<}}
   \newcommand{\Lbrack}{\BBsym{`[}}
   \newcommand{\Lparen}{\BBsym{`(}}
   \newcommand{\bbalpha}{\BBsym{"0B}}
   \newcommand{\bbbeta}{\BBsym{"0C}}
   \newcommand{\bbgamma}{\BBsym{"0D}}
   \newcommand{\Rparen}{\BBsym{`)}}
   \newcommand{\Rbrack}{\BBsym{`]}}
   \newcommand{\Rangle}{\BBsym{"3E}}
  }
  {}

\IfStyFileExists{mbboard}
  {\newcommand{\MBBmathbb}[1]{\mbox{\usefont{OT1}{mbb}{m}{n} ##1}}}
  {}
\ifx\MBBmathbb\undefined
\else
  % Define only the symbols we actually use.
  \newcommand{\bbnabla}{\MBBmathbb{\char"9A}}
  \newcommand{\bbdollar}{\MBBmathbb{\char"24}}
  \newcommand{\bbeuro}{\MBBmathbb{\char"FB}}
  \newcommand{\bbpe}{\MBBmathbb{\char"D4}}
  \newcommand{\bbqof}{\MBBmathbb{\char"D7}}
  \newcommand{\bbyod}{\MBBmathbb{\char"C9}}
  \newcommand{\bbfinalnun}{\MBBmathbb{\char"CF}}

  % The following was copied from mbboard.sty.
  \DeclareFontFamily{OT1}{mbb}{\hyphenchar\font45}
  \DeclareFontShape{OT1}{mbb}{m}{n}{
        <5> <6> <7> <8> <9> <10> gen * mbb
        <10.95> mbb10 <12> <14.4> mbb12 <17.28> <20.74> <24.88> mbb17
        }{}
\fi

\IfStyFileExists{dsfont}
  {\newcommand{\mathds}[1]{\mbox{\usefont{U}{dsrom}{m}{n}##1}}
   \newcommand{\mathdsss}[1]{\mbox{\usefont{U}{dsss}{m}{n}##1}}}
  {}

\IfStyFileExists{bbm}
  {\newcommand{\mathbbm}[1]{\mbox{\usefont{U}{bbm}{m}{n}##1}}
   \newcommand{\mathbbmss}[1]{\mbox{\usefont{U}{bbmss}{m}{n}##1}}
   \newcommand{\mathbbmtt}[1]{\mbox{\usefont{U}{bbmtt}{m}{n}##1}}}
  {}

% \mathfrak is defined by a number of packages, to check for it by name.
\ifx\mathfrak\undefined
\else
  \renewcommand{\mathfrak}[1]{\mbox{\fontencoding{U}\fontfamily{euf}\selectfont#1}}
\fi

% msym10 doesn't have a corresponding LaTeX package.  We establish its
% existence via the msym10.tfm file.  However, this file is not normally
% in LaTeX's input path, so be sure to point LaTeX to it (e.g., by
% copying it into the current directory).
\makeatletter
\IfFileExists{msym10.tfm}
  {\DeclareFontFamily{OT1}{msym}{}
   \DeclareFontShape{OT1}{msym}{m}{n}{ <-> msym10 }{}
   \newcommand{\MSYMmathbb}[1]{\mbox{\fontfamily{msym}\selectfont##1}}
  }
  {\completefalse
   \@cons\missingpkgs{{msym10.tfm}}     % Not really a package
  }
\makeatother

%                                                                        %
%                                                                        %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Resolve the stmaryrd/wasysym \lightning conflict by defining \lightning
% to use stmaryrd in math mode and wasysym in text mode.
\DeclareRobustCommand{\lightning}{\ifmmode\STlightning\else\WASYlightning\fi}

% Index a symbol, which may or may not begin with a backslash.  (Is
% there a better way to do this?)  Also, if symbol is given as an
% optional argument is given, typeset that symbol in the index, as well.
% We define a related macro for indexing accents.  In a previous version
% of this file, \indexaccent additionally included "see also accents" in
% the index.  This became distracting so I made \indexaccent a synonym
% for \indexcommand for the time being.  Because punctuation marks can
% be problematic for makeindex, we define an \indexpunct macro that
% sorts its argument under the comparatively innocuous "_".
\begingroup
 \catcode`\|=0
 \catcode`\\=12
 |gdef|sanitize#1#2!!!{%
   |ifx#1\%
     #2%
   |else%
     #1#2%
   |fi%
}
|endgroup
\makeatletter
  \newcommand{\indexcommand}[2][]{%
    \edef\sanitized{\expandafter\sanitize\string#2!!!}%
    \def\first@arg{#1}%
    \ifx\first@arg\@empty
      \expandafter\index\expandafter{\sanitized=\string\verb+\string#2+}%
    \else
      \expandafter\index\expandafter{\sanitized=\string\verb+\string#2+ (#1)}%
    \fi
  }
  \let\indexaccent=\indexcommand
  \newcommand{\indexpunct}[2][]{%
    \def\first@arg{#1}%
    \ifx\first@arg\@empty
      \expandafter\index\expandafter{_=\string\verb+\string#2+}%
    \else
      \expandafter\index\expandafter{_=\string\verb+\string#2+ (#1)}%
    \fi
  }
\makeatother

% Enable the use of makeindex's nicer-looking gind.ist style.
% I swiped the following from doc.dtx.
\makeatletter
\newif\ifscan@allowed
\def\efill{\hfill\nopagebreak}%
\def\dotfill{\leaders\hbox to.6em{\hss .\hss}\hskip\z@ plus 1fill}%
\def\dotfil{\leaders\hbox to.6em{\hss .\hss}\hfil}%
\def\pfill{\unskip~\dotfill\penalty500\strut\nobreak
           \dotfil~\ignorespaces}%
\makeatother

% If we have the multicol package, typeset the index in three columns instead
% of the usual two.
\ifhavemulticol
  \makeatletter
  \renewenvironment{theindex}{%
    \clearpage
    \section*{\indexname}

    If you're having trouble locating a symbol, try looking under
    ``T'' for ``\texttt{\string\text}$\ldots$''.  Many text-mode
    commands begin with that prefix.  Also, accents are shown
    over/under a gray box, e.g.,~``\,\blackacchack{\'}\,''
    for~``\texttt{\string\'}''.

    Some symbol entries appear to be listed repeatedly.  This happens
    when multiple packages define identical (or nearly identical)
    glyphs with the same symbol name.%
\ifAMS\ifABX
    \footnote{This occurs frequently between \pkgname{amssymb} and
    \pkgname{mathabx}, for example.}
\fi\fi
    \setlength{\columnsep}{1em}%
    \begin{multicols}{3}%
    \let\item\@idxitem
  }{%
    \end{multicols}%
  }
  \makeatother
\fi

% Define a counter to keep track of how many symbols are listed.
% Output this counter to the log file at the end of each run.
% Define \prevtotalsymbols to be the total number of symbols from
% the previous run.
\newcounter{totalsymbols}
\newcommand{\incsyms}{\addtocounter{totalsymbols}{1}}
\makeatletter
\AtEndDocument{%
  \typeout{Number of symbols documented: \thetotalsymbols}
  \immediate\write\@auxout{%
    \noexpand\gdef\noexpand\prevtotalsymbols{\thetotalsymbols}}
}
\makeatother

% Define \prevtotalsymbols as "??" if this is our first run.  Define
% \approxcount as "~" unless explicitly defined otherwise in the .aux
% file.  To get a true count you should count the number of lines in the
% .ind file that contain "\item \verb".  Write an empty definition of
% \approxcount and the correct definition of \prevtotalsymbols to the
% .aux file.
\makeatletter
  \@ifundefined{prevtotalsymbols}{%
    \def\prevtotalsymbols{\fbox{\textbf{??}}}%
  }{}
  \@ifundefined{approxcount}{%
    \def\approxcount{\ensuremath{\sim}}%
  }{}
\makeatother

% If we have color.sty, use it to display accents atop gray boxes in the
% index.  (See below.)  If we don't have color.sty, use black boxes.
\IfStyFileExists*{color}
  {\usepackage{color}
   \newcommand*{\graybox}{\textcolor[gray]{0.7}{\rule[-\adp]{\awd}{\aht}}}}
  {\newcommand*{\graybox}{\rule[-\adp]{\awd}{\aht}}}

% Define \blackacc to display an accented box, given an accent command.
% Define \blackacchack to display an accented "a" and then black out
% the "a".
\newlength\awd
\newlength\aht
\newlength\adp
\settowidth{\awd}{a}
\settoheight{\aht}{a}
\settodepth{\adp}{a}
\advance\aht by \adp
\gdef\blackacchack#1{#1a\llap{\graybox}}
\gdef\blackacc#1{#1{\graybox}}
\gdef\blackacctwo#1{#1{\graybox}{\graybox}}

% Symbol+verbatim for various types of symbols
\def\E#1{%
  \begingroup
    \lccode`|=`\\
    \def\EStruename{ES#1T}
    \lowercase{\incsyms\index{#1=\string\verb+\string|#1+ (\string|\EStruename)}}
  \endgroup
  \csname ES#1T\endcsname & \csname ES#1D\endcsname &
  \ttfamily\expandafter\string\csname#1\endcsname
}
\def\IGOb#1{\incsyms\indexcommand\blackstone
  \indexcommand[\string\igoblackstone{#1}]{#1}\igoblackstone{#1} &
  \ttfamily\string\blackstone[\string#1]}
\def\IGOw#1{\incsyms\indexcommand\whitestone
  \indexcommand[\string\igowhitestone{#1}]{#1}\igowhitestone{#1} &
  \ttfamily\string\whitestone[\string#1]}
\def\Jiv#1#2{\incsyms\indexcommand{#1}{\fontencoding{T4}\selectfont#1#2} &
  \ttfamily\string#1\string{#2\string}}
\makeatletter
  \def\K@opt@arg[#1]#2{\incsyms\indexcommand[#1]{#2}#1 &\ttfamily\string#2}
  \def\K@no@opt@arg#1{\incsyms\indexcommand[#1]{#1}#1 &\ttfamily\string#1}
  \def\K{\@ifnextchar[{\K@opt@arg}{\K@no@opt@arg}}
\makeatother
\def\KED[#1][#2][#3]#4{\incsyms\indexcommand[#1]{#2}#3 &\ttfamily\string#4}
\def\Kfeyn#1{\incsyms\indexcommand[\string\feyn{#1}]{\feyn{#1}}\feyn{#1} &\ttfamily\string\feyn\string{\string#1\string}}
\def\Kp#1{\incsyms\indexpunct[$#1$]{#1}#1 &\ttfamily\string#1}
\def\Ks#1{\incsyms\indexcommand[\string\encone{\string#1}]{#1}{\encone{#1}} &\ttfamily\string#1$^*$}
\def\Kt#1{\incsyms\indexcommand[\string\encone{\string#1}]{#1}{\encone{#1}} &\ttfamily\string#1}
\def\Kv#1{\incsyms\indexcommand[\string\encfive{\string#1}]{#1}{\encfive{#1}} &\ttfamily\string#1}
\def\KN[#1][#2]#3{\incsyms\indexcommand[\string#1]{#3} #1 & #2 & \ttfamily\string#3}
\def\KNbig[#1][#2]#3{\incsyms\indexcommand[\string#2]{#3} #1 & #2 & \ttfamily\string#3}
\makeatletter
  \def\N@opt@arg[#1]#2{\incsyms\indexcommand[$\string#1$]{#2}$#1$ & $\Big#1$ &\ttfamily\string#2}
  \def\N@no@opt@arg#1{\incsyms\indexcommand[$\string#1$]{#1}$#1$ & $\Big#1$ &\ttfamily\string#1}
  \def\N{\@ifnextchar[{\N@opt@arg}{\N@no@opt@arg}}
  \def\Nn[#1]#2{%
    \incsyms\indexcommand[$\string\nathdouble\string#1$]{#2}%
    $\nathdouble#1$ & $\nathdouble{\Big#1}$ & \ttfamily\string#2}
  \def\Nnt#1[#2]#3{%
    \incsyms\indexcommand{\triple}%
    $\nathtriple#2$ & $\nathtriple{\Big#2}$ &
    \ttfamily\expandafter\string\csname#1triple\endcsname\string#3}
  \def\Np@opt@args[#1]{\@ifnextchar[{\Np@two@opt@args[#1]}{\Np@one@opt@arg[#1]}}
  \def\Np@two@opt@args[#1][#2]#3{\incsyms\index{_=\string#2{} ($\string#1$)}$#1$ & $\Big#1$ &\ttfamily\string#3}
  \def\Np@one@opt@arg[#1]#2{\incsyms\indexpunct[$\string#1$]{#2}$#1$ & $\Big#1$ &\ttfamily\string#2}
  \def\Np@no@opt@args#1{\incsyms\indexpunct[$\string#1$]{#1}$#1$ & $\Big#1$ &\ttfamily\string#1}
  \def\Np{\@ifnextchar[{\Np@opt@args}{\Np@no@opt@args}}
  \def\Nbig[#1]#2{\incsyms\indexcommand[$\string\Big\string#1$]{#2}$#1$ & $\Big#1$ &\ttfamily\string#2}
\makeatother
\def\Mt#1{\incsyms\indexcommand[\string\metra\string#1]{#1}\metra#1 &\ttfamily\string#1}
\makeatletter
  \def\Q@opt@arg[#1]#2{\incsyms\indexaccent[\string\blackacchack{\string#1}]{#2}#1{A}#1{a} &
           \ttfamily\string#2\string{A\string}\string#2\string{a\string}}
  \def\Q@no@opt@arg#1{\incsyms\indexaccent[\string\blackacchack{\string#1}]{#1}#1{A}#1{a} &
           \ttfamily\string#1\string{A\string}\string#1\string{a\string}}
  \def\Q{\@ifnextchar[{\Q@opt@arg}{\Q@no@opt@arg}}
\makeatother
\def\Qc#1{\incsyms\indexaccent[\string\blackacc{\string#1}]{#1}#1{A}#1{a} &
         \ttfamily\string#1\string{A\string}\string#1\string{a\string}}
\def\Qe[#1][#2]#3{%
  \incsyms\incsyms\index{_=\string#2{} (\string\blackacchack{\string#1})}%
  #3{A}#3{a} &
  \ttfamily\string#3\string{A\string}\string#3\string{a\string}}
\def\Qt#1{\incsyms\indexaccent[\string\encone{\string\blackacc{\string#1}}]{#1}{\encone{#1{A}#1{a}}} &
          \ttfamily\string#1\string{A\string}\string#1\string{a\string}}

\def\Qpc#1#2{\incsyms\indexcommand{#2}{\raisebox{1pt}{\tiny[#1]}} &
             \ttfamily\string#2\string{A\string}\string#2\string{a\string}}
\def\Qpfc[#1]#2{\incsyms\indexaccent[\string\encfour{\string\blackacchack{\string#1}}]{#2}\encfour{#1{A}#1{a}} &
           \ttfamily\string#2\string{A\string}\string#2\string{a\string}}
\ifFC
  \def\Qiv#1#2{\incsyms\indexaccent[\string\encfour{\string\blackacchack{\string#1}}]{#1}\encfour{#1{A}#1{a}} &
               \ttfamily\string#1\string{A\string}\string#1\string{a\string}$^#2$}
  \def\QivBAR#1{\incsyms\index{_=\string\magicVertname{}
                (\string\encfour{\string\blackacchack{\string\FCbar}})}
                \encfour{\FCbar{A}\FCbar{a}} &
                \ttfamily\string\|\string{A\string}\string\|\string{a\string}$^#1$}
\else
  \def\Qiv#1#2{\Qpc{T4}{#1}$^#2$}
  \def\QivBAR#1{\Qpc{T4}{\|}$^#1$}
\fi
\ifVIET
  \def\Qv#1#2{\incsyms\indexaccent[\string\encfive{\string\blackacchack{\string#1}}]{#1}{\encfive{#1{A}#1{a}}} &
              \ttfamily\string#1\string{A\string}\string#1\string{a\string}$^#2$}
\else
  \def\Qv#1#2{\Qpc{T5}{#1}$^#2$}
\fi
\makeatletter
  % We use \displaystyle so that variable-sized symbols will be big.
  \def\R@opt@arg[#1]#2{\incsyms\indexcommand[$\string#1$]{#2}$#1$ & $\displaystyle#1$ &\ttfamily\string#2}
  \def\R@no@opt@arg#1{\incsyms\indexcommand[$\string#1$]{#1}$#1$ & $\displaystyle#1$ &\ttfamily\string#1}
  \def\R{\@ifnextchar[{\R@opt@arg}{\R@no@opt@arg}}
\makeatother
\def\Tp#1{\incsyms\indexcommand{\ding}\ding{#1} &\ttfamily\string\ding\string{#1\string}}
\def\Tm#1{\incsyms\indexcommand{\maya}$\mayadigit{#1}$ &\ttfamily\string\maya\string{#1\string}}
\newcommand{\V}[2][]{\incsyms#1 & \indexcommand[#2]{#2}#2 &\ttfamily\string#2}
\newcommand{\Vp}[2][]{\incsyms#1 & \indexpunct[$#2$]{#2}#2 &\ttfamily\string#2}
\makeatletter
  \newcommand{\VV}[2]{%
    \incsyms\indexaccent[$\string\blackacc{\string\vv}$]{\vv}%
    \expandafter\let\expandafter\fldrVV\csname fldr#1\endcsname
    \def\vectfill@{\traitfill@\relbaredd\relbareda\fldrVV}%
    $\vv{#2}$ & \texttt{\string\vv\string{#2\string}}
    with package option \optname{esvect}{#1}
  }
  \def\W@opt@arg[#1]#2#3{%
    \incsyms\indexaccent[$\string\blackacc{\string#1}$]{#2}%
    $#1{#3}$ &\ttfamily\string#2\string{#3\string}}
  \def\W@no@opt@arg#1#2{%
    \incsyms\indexaccent[$\string\blackacc{\string#1}$]{#1}%
    $#1{#2}$ &\ttfamily\string#1\string{#2\string}}
  \def\W{\@ifnextchar[{\W@opt@arg}{\W@no@opt@arg}}
\makeatother
\def\Wf#1#2{\incsyms\indexcommand{#1}$#1{#2}$ &\ttfamily\string#1\string{#2\string}}
\def\Ww#1#2#3{\incsyms\indexcommand{#2}$#1{#3}$ &\ttfamily\string#2\string{#3\string}}
\def\Wul#1#2#3{%
  \incsyms\indexaccent[$\string\blackacctwo{\string#1}$]{#1}%
  $#1{#2}{#3}$ &\ttfamily\string#1\string{#2\string}\string{#3\string}}
\makeatletter
  \def\X@opt@arg[#1]#2{\incsyms\indexcommand[$\string#1$]{#2}$#1$ &\ttfamily\string#2}
  \def\X@no@opt@arg#1{\incsyms\indexcommand[$\string#1$]{#1}$#1$ &\ttfamily\string#1}
  \def\X{\@ifnextchar[{\X@opt@arg}{\X@no@opt@arg}}
\makeatother
\def\Y#1{\incsyms\indexcommand[$\string\big\string#1$]{#1}$\big#1$ & $\Bigg#1$ &\ttfamily\string#1}
\def\Z#1{\incsyms\indexcommand[$\string#1$]{#1}\ttfamily\string#1}

% Display and index a command, but not its symbol (\cmd).  \cmdI shows
% the symbol in the index, with optional explicit formatting.  \cmdX is
% the same as \cmdI, but with the optional argument hardwired to the
% command displayed in math mode.  \cmdIp is also similar to \cmdI but
% takes no optional argument and formats its argument with \indexpunct
% instead of \indexcommand.
\makeatletter
\def\cmd#1{\texttt{\string#1}\indexcommand{#1}}
\newcommand{\cmdI}[2][]{%
  \def\first@arg{#1}%
  \ifx\first@arg\@empty
    \texttt{\string#2}\indexcommand[#2]{#2}%
  \else
    \texttt{\string#2}\indexcommand[#1]{#2}%
  \fi
}
\newcommand{\cmdX}[1]{\cmdI[$\string#1$]{#1}}
\newcommand{\cmdW}[1]{\cmdI[$\string\blackacc{\string#1}$]{#1}}
\newcommand{\cmdIp}[1]{\texttt{\string#1}\indexpunct[$#1$]{#1}}
\makeatother


% Redefine the LaTeX commands that are replaced by textcomp.
% This was swiped right out of ltoutenc.dtx, but with "\text..."
% changed to "\ltext...".
\DeclareTextCommandDefault{\ltextcopyright}{\textcircled{c}}
\DeclareTextCommandDefault{\ltextregistered}{\textcircled{\scshape r}}
\DeclareTextCommandDefault{\ltexttrademark}{\textsuperscript{TM}}
\DeclareTextCommandDefault{\ltextordfeminine}{\textsuperscript{a}}
\DeclareTextCommandDefault{\ltextordmasculine}{\textsuperscript{o}}


% Needed by the References section.  This was copy&pasted from ltlogos.dtx.
\makeatletter
\DeclareRobustCommand{\LaT}{L\kern-.36em%
        {\sbox\z@ T%
         \vbox to\ht\z@{\hbox{\check@mathfonts
                              \fontsize\sf@size\z@
                              \math@fontsfalse\selectfont
                              A}%
                        \vss}%
        }%
        \kern-.15em T%
}
\makeatother

% Display a metavariable.
\newcommand{\meta}[1]{$\langle$\textit{#1}$\rangle$}

% Many tables have notes beneath them.  Define an environment in which to
% display such a note, with an optional, superscripted math symbol
% preceding it.
\newenvironment{tablenote}[1][]{
  \makebox[1em]{\ensuremath{^{#1}}}%
  \begin{minipage}[t]{0.75\textwidth}%
  \setlength{\parskip}{2ex}
}{%
  \end{minipage}%
}

% Define various messages we reuse repeatedly.
\newcommand{\twosymbolmessage}{%
  \begin{tablenote}
    Where two symbols are present, the left one is the ``faked'' symbol
    that \latexE{} provides by default, and the right one is the ``true''
    symbol that \TC\ makes available.
  \end{tablenote}
}

\newcommand{\notpredefinedmessage}{%
  \begin{tablenote}[*]
    Not predefined in \latexE.  Use one of the packages
    \pkgname{latexsym}, \pkgname{amsfonts}, \pkgname{amssymb},
    \pkgname{txfonts}, \pkgname{pxfonts}, or \pkgname{wasysym}.
  \end{tablenote}
}

\newcommand{\notpredefinedmessageABX}{%
  \begin{tablenote}[*]
    Not predefined in \latexE.  Use one of the packages
    \pkgname{latexsym}, \pkgname{amsfonts}, \pkgname{amssymb},
    \pkgname{mathabx}, \pkgname{txfonts}, \pkgname{pxfonts}, or
    \pkgname{wasysym}.
  \end{tablenote}
}

\newcommand{\usetextmathmessage}[1][]{%
  \begin{tablenote}[#1]
    It's generally preferable to use the corresponding symbol from
    Table~\vref{math-text} because the symbols in that table work
    properly in both text mode and math mode.
  \end{tablenote}
}

\newcommand{\seedocs}[1]{%
  See the #1 documentation for more information%
}


% Define an environment in which to write a single table of symbols.  The
% environment looks a lot like a table, but it doesn't float, and it gets
% an entry in the table of contents (as a subsubsection that looks like a
% subsection), as opposed to the list of tables.
%
% The first argument is a conditional.  The table will appear only if
% the value of the conditional is true.  The second argument is the
% table's caption.
\makeatletter
\def\fnum@table{\textsc{\tablename}~\thetable}
\newenvironment{symtable}[2][true]{%
  \expandafter\global\expandafter\let%
    \expandafter\ifshowsymtable\csname if#1\endcsname
  \ifshowsymtable
    \noindent%
    \begin{minipage}[t]{\linewidth}    % Prevent page breaks
    \begin{center}
    \addtocounter{table}{1}%
    \protected@edef\@currentlabel{\thetable}%
    \addcontentsline{toc}{subsubsection}{%
      \protect\numberline{\tablename~\thetable:}{#2}}%
    \@makecaption{\fnum@table}{#2}\medskip
    \let\next=\relax
  \else
    % The following was taken verbatim from verbatim.sty.
    \let\do\@makeother\dospecials\catcode`\^^M\active
    \let\verbatim@startline\relax
    \let\verbatim@addtoline\@gobble
    \let\verbatim@processline\relax
    \let\verbatim@finish\relax
    \let\next=\verbatim@
  \fi
  \next
}{%
  \ifshowsymtable
    \end{center}
    \end{minipage}
    \vskip 8ex minus 2ex
  \fi
}
\makeatother

% Same as the above, but allows page breaks.
\makeatletter
\newenvironment{longsymtable}[2][true]{%
  \expandafter\global\expandafter\let
    \expandafter\ifshowsymtable\csname if#1\endcsname
  \ifshowsymtable
    \needspace{7\baselineskip}%
    \mbox{}%
    \begin{center}%
    \addtocounter{table}{1}%
    \protected@edef\@currentlabel{\thetable}%
    \addcontentsline{toc}{subsubsection}{%
      \protect\numberline{\tablename~\thetable:}{#2}}%
    \@makecaption{\fnum@table}{#2}%
    \def\lt@indexed{}%
    \let\next=\relax
  \else
    % The following was taken verbatim from verbatim.sty.
    \let\do\@makeother\dospecials\catcode`\^^M\active
    \let\verbatim@startline\relax
    \let\verbatim@addtoline\@gobble
    \let\verbatim@processline\relax
    \let\verbatim@finish\relax
    \let\next=\verbatim@
  \fi
  \next
}{%
  \ifshowsymtable
    \end{center}
    \let\@elt=\index\lt@indexed  % Close our index ranges.
    \addtocounter{table}{-1}     % Make up for longtable's counter increment.
    \vskip 8ex minus 2ex
  \fi
}
\makeatother

% Define \index-like commands for use with longsymtable that
% automatically apply to the entire table, not just the start of it.
\makeatletter
\newcommand{\ltindex}[1]{%
  \index{#1|(}%
  \@cons{\lt@indexed}{{#1|)}}%
}
\newcommand{\ltidxboth}[2]{\mbox{}\ltindex{#1 #2}\ltindex{#2>#1}}
\makeatother


% Define a table environment that's similar to symtable, except that it
% floats and it doesn't write an entry into the Table of Contents.  This
% is used for tables that contain something other than symbol lists.
\newenvironment{nonsymtable}[1]{%
  \begin{table}[htbp]
  \centering
  \caption{#1}\medskip
}{%
  \end{table}
}

% Do the same as the above, but typeset the table in landscape mode (or
% not, if we haven't loaded the rotating package).
\ifhaverotating
  \newenvironment{nonsymtableL}[1]{%
    \begin{sidewaystable}[htbp]
    \centering
    \caption{#1}\medskip
  }{%
    \end{sidewaystable}
  }
\else
  \newenvironment{nonsymtableL}{\begin{nonsymtable}}{\end{nonsymtable}}
\fi

% Make sure we have enough room in the table of contents for
% the word "Table" at the beginning of each symtable entry.
\makeatletter
\settowidth{\@tempdimc}{Table~999:\hspace*{0.5em}}
\renewcommand*\l@subsubsection{\@dottedtocline{3}{1.5em}{\the\@tempdimc}}
\makeatother

% Paragraphs with tall symbols should get a little extra interline spacing.
\newenvironment{morespacing}[1]{\advance\baselineskip by #1\relax}{\par}

% Sometimes, we need a little more horizontal spacing, too.
\newcommand{\qqquad}{\qquad\quad}

% The following are needed later on for various examples but must be
% declared here in the preamble.
\ifAMS
  \DeclareMathOperator{\newlogsym}{newlogsym}
  \DeclareMathOperator*{\newlogsymSTAR}{newlogsym}
  \DeclareMathOperator{\atan}{atan}
  \DeclareMathOperator*{\lcm}{lcm}
\fi
\DeclareFontFamily{U}{lightbulb}{}
\DeclareFontShape{U}{lightbulb}{m}{n}{<-> lightbulb10}{}
\newcommand{\lightbulb}{{\usefont{U}{lightbulb}{m}{n}A}}

% I prefer \vpageref to say "on the previous page" than its default message.
\def\reftextbefore{on the previous page}

% Use Donald Arseneau's improved float parameters.
\renewcommand{\topfraction}{.85}
\renewcommand{\bottomfraction}{.7}
\renewcommand{\textfraction}{.15}
\renewcommand{\floatpagefraction}{.66}
\renewcommand{\dbltopfraction}{.66}
\renewcommand{\dblfloatpagefraction}{.66}
\setcounter{topnumber}{9}
\setcounter{bottomnumber}{9}
\setcounter{totalnumber}{20}
\setcounter{dbltopnumber}{9}

% Tell pdfLaTeX that all .eps files were produced by MetaPost.
\ifx\pdfoutput\undefined
\else
  \ifx\pdfoutput\relax
  \else
    \ifcase\pdfoutput
    \else
      \DeclareGraphicsExtensions{.png,.pdf,.jpg,.mps,.tif,.eps}
      \DeclareGraphicsRule{.eps}{mps}{*}{}
    \fi
  \fi
\fi

% Define a metavariable for "operating-system prompt".
\newcommand{\osprompt}{\textrm{\textit{prompt}}{\small$>$}\xspace}

% Typeset small, superscripted registered trademarks.
\newcommand{\regtm}{\textsuperscript{\textregistered}\xspace}

% Define an environment for typesetting code samples.
\newsavebox{\codebox}
\newenvironment{codesample}{%
  \begin{lrbox}{\codebox}%
  \begin{minipage}{0.9\linewidth}%
}{%
  \end{minipage}%
  \end{lrbox}%
  \fbox{\usebox{\codebox}}%
}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{document}
\sloppy
\maketitle

\begin{abstract}
  This document lists \approxcount\prevtotalsymbols{} symbols and the
  corresponding \latex{} commands that produce them.  Some of these
  symbols are guaranteed to be available in every \latexE{} system;
  others require fonts and packages that may not accompany a given
  distribution and that therefore need to be installed.  All of the
  fonts and packages used to prepare this document---as well as this
  document itself---are freely available from the
  Comprehensive\idxCTAN{} \TeX{} Archive Network
  (\url{http://www.ctan.org/}).
\end{abstract}

\tableofcontents

% Now that we've output the table of contents, let's make \section start a
% new page.  I toyed with the idea of changing the documentclass from
% article to report, but I like having the abstract on the same page as
% the title and the start of the table of contents; I want the tables
% numbered consecutively throughout the document; and I like the smaller,
% less gaudy section headings the article class offers.  In short, article
% seems a better fit than report.
\makeatletter
\let\origsection=\section
\renewcommand\section{\@startsection {section}{1}{\z@}%
                                     {-3.5ex \@plus -1ex \@minus -.2ex}%
                                     {2.3ex \@plus.2ex}%
                                     {\clearpage\normalfont\Large\bfseries}}
\makeatother


% Define an integral containing a dash or a double-dash.
\def\Xint#1{\mathchoice
   {\XXint\displaystyle\textstyle{#1}}%
   {\XXint\textstyle\scriptstyle{#1}}%
   {\XXint\scriptstyle\scriptscriptstyle{#1}}%
   {\XXint\scriptscriptstyle\scriptscriptstyle{#1}}%
   \!\int}
\def\XXint#1#2#3{{\setbox0=\hbox{$#1{#2#3}{\int}$}
     \vcenter{\hbox{$#2#3$}}\kern-.5\wd0}}
\def\ddashint{\Xint=}
\def\dashint{\Xint-}


% Many symbols are merely alphanumerics typeset with a math alphabet.
% Guide the user from the most common of these to the Math Alphabets
% table.
%
% QUESTION: How standard are the following?
%    * action (script A)
%    * Bernoulli (script B)
%    * path integral measure (script D)
%    * domain (script D)
%    * expected value (script E)
%    * energy per symbol [communications theory] (script E)
%    * imaginary line (script I)
%    * identity matrix (blackboard bold I)
%    * likelihood (script L)
%    * M matrix (script M)
%    * Mellin transform (script M)
%    * null space (script N)
%    * order of (script o)
%    * radius (script r)
%    * real line (script R)
%    * Schwartz class (script S)
%    * volume (script V)
%
\ifcomplete
  \makeatletter
  \newcommand{\indexMA}[2][]{%
    \def\first@arg{#1}%
    \ifx\first@arg\@empty
      \index{#2|see{alphabets, math}}%
    \else
      \index{#2=#2 (\string#1)|see{alphabets, math}}%
    \fi
  }
  \makeatother
\else
  \newcommand{\indexMA}[2][]{%
    \index{#2|see{alphabets, math}}%
}
\fi
\indexMA[\mathscr{F}]{Fourier transform}
\indexMA[\mathscr{H}]{Hamiltonian}
\indexMA[\mathscr{H}]{Hilbert space}
\indexMA[\mathscr{L}]{Lagrangian}
\indexMA[\mathscr{L}]{Laplace transform}
\indexMA[\mathcal{L}]{Lie derivative}
\indexMA[\mathscr{P}]{power set}
\indexMA[\mathscr{E}]{electromotive force}
\indexMA[\mathcal{O}]{local ring}
\indexMA[$\mathbbm{C}$]{complex numbers}
%\indexMA{imaginary numbers}
\indexMA[$\mathbbm{Z}$]{integers}
\indexMA[$\mathbbm{N}$]{natural numbers}
\indexMA{number sets}
%\indexMA{prime numbers}
\indexMA[$\mathbbm{1}$]{unity}
\indexMA[$\mathbbm{D}$]{open unit disk}
\indexMA[$\mathbbm{D}$]{unit disk}
\indexMA[$\mathbbm{H}$]{quaternions}
\indexMA[$\mathbbm{Q}$]{rational numbers}
\indexMA[$\mathbbm{R}$]{real numbers}
\indexMA[$\mathbbm{T}$]{torus}
\indexMA{script letters}
\indexMA{blackboard bold}
\indexMA{fraktur}
\indexMA{moduli space}
\indexMA{Schwartz distribution spaces}

% Provide "see ..."s for every accent whose name I happen to know.
\index{arc|see{accents}}
\index{breve|see{accents}}
\index{caron|see{accents}}
\index{cedilla|see{accents}}
\index{circumflex|see{accents}}
\index{diaeresis=di\ae{}resis|see{accents}}
\index{hacek=h\'{a}\v{c}ek|see{accents}}
\index{Hungarian umlaut|see{accents}}
\index{macron|see{accents}}
\index{ogonek|see{accents}}
\index{umlaut|see{accents}}

% Provide "see ..."s for the common logical operators.
\index{logical operators>and|see{\texttt{\string\wedge}}}
\index{logical operators>or|see{\texttt{\string\vee}}}
\index{logical operators>not|see{\texttt{\string\neg} \emph{and} \texttt{\string\sim}}}
\index{operators>logical|see{logical operators}}
\index{and|see{\texttt{\string\wedge}}}
\index{or|see{\texttt{\string\vee}}}
\index{not|see{\texttt{\string\neg}}}
\index{conjunction|see{\texttt{\string\wedge}}}
\index{disjunction|see{\texttt{\string\vee}}}
\index{negation|see{\texttt{\string\neg} \emph{and} \texttt{\string\sim}}}
\index{set operators>union|see{\texttt{\string\cup}}}
\index{set operators>intersection|see{\texttt{\string\cap}}}
\index{operators>set|see{set operators}}
\index{union|see{\texttt{\string\cup}}}
\index{intersection|see{\texttt{\string\cap}}}
\index{material implication|see{\texttt{\string\rightarrow} \emph{and} \texttt{\string\supset}}}
\index{material equivalence|see{\texttt{\string\leftrightarrow} \emph{and} \texttt{\string\equiv}}}
\index{material conditional|see{\texttt{\string\rightarrow} \emph{and} \texttt{\string\supset}}}
\index{material biconditional|see{\texttt{\string\leftrightarrow} \emph{and} \texttt{\string\equiv}}}

% Provide "see ..."s for various punctuation marks.
\index{paragraph mark|see{\texttt{\string\P}}}
\index{pilcrow|see{\texttt{\string\P}}}
\index{percent sign|see{\texttt{\string\%}}}
\index{dollar sign|see{\texttt{\string\$}}}
\index{cents|see{\texttt{\string\textcent}}}
\index{hash mark|see{\texttt{\string\#}}}
\index{ampersand|see{\texttt{\string\&}}}
\index{section mark|see{\texttt{\string\S}}}
\index{caret|see{\texttt{\string\^}}}
\index{swung dash|see{\texttt{\string\sim}}}
\index{underscore|see{\texttt{\string\_}}}
\index{less-than signs|see{inequalities}}
\index{greater-than signs|see{inequalities}}
\index{plus-or-minus sign|see{\texttt{\string\pm}}}

% Provide "see ..."s for various musical symbols.
\index{quaver|see{musical symbols}}
\index{semiquaver|see{musical symbols}}
\index{demisemiquaver|see{musical symbols}}
\index{semibreve|see{musical symbols}}
\index{minim|see{musical symbols}}
\index{crotchet|see{musical symbols}}
\index{whole note|see{musical symbols}}
\index{half note|see{musical symbols}}
\index{quarter note|see{musical symbols}}
\index{eighth note|see{musical symbols}}
\index{sixteenth note|see{musical symbols}}
\index{thirty-second note|see{musical symbols}}

% Provide a few other useful "see ..."s.
\index{CTAN|see{Comprehensive \TeX{} Archive Network}}
\index{letters|see{alphabets}}
\index{numbers|see{digits}}
\index{degrees|see{\texttt{\string\textdegree}}}
\index{registered trademark|see{\texttt{\string\textregistered}}}
\index{trademark|see{\texttt{\string\texttrademark}}}
\index{Cedi|see{\texttt{\string\textcolonmonetary}}}
\index{iff=\texttt{\string\iff}|see{\texttt{\string\Longleftrightarrow}}}
\index{derivitive, partial|see{\texttt{\string\partial}}}
\index{to=\texttt{\string\to}|see{\texttt{\string\rightarrow}}}
\index{adjoint=adjoint (\dag)|see{\texttt{\string\dag}}}
\ifAMS
  \index{implies=\texttt{\string\implies}|see{\texttt{\string\Longrightarrow}
    \emph{and} \texttt{\string\vdash}}}
  \index{impliedby=\texttt{\string\impliedby}|see{\texttt{\string\Longleftarrow}}}
  \index{division times|see{\texttt{\string\divideontimes}}}
  \index{does not exist|see{\texttt{\string\nexists}}}
  \index{ring equal to|see{\texttt{\string\circeq}}}
  \index{ring in equal to|see{\texttt{\string\eqcirc}}}
  \index{does not divide|see{\texttt{\string\nmid}}}
  \index{transversality|see{\texttt{\string\pitchfork}}}
  \index{absolute value|see{\texttt{\string\lvert} \emph{and} \texttt{\string\rvert}}}
  \index{norm|see{\texttt{\string\lVert} \emph{and} \texttt{\string\rVert}}}
%  \index{average|see{\texttt{\string\varnothing}}}
\fi    % AMS test
\ifTIPA
%  \index{symbols>dictionary|see{symbols, phonetic}}
%  \index{dictionary symbols|see{phonetic symbols}}
  \index{pronunciation symbols|see{phonetic symbols}}
\fi    % TIPA test
\index{abzuglich=abz\"uglich|see{\texttt{\string\textdiscount}}}
\index{diacritics|see{accents}}
\index{parts per thousand|see{\texttt{\string\textperthousand}}}
\index{thousandths|see{\texttt{\string\textperthousand}}}
\index{millesimal sign|see{\texttt{\string\textperthousand}}}
\index{prescription|see{\texttt{\string\textrecipe}}}
\index{pharmaceutical prescription|see{\texttt{\string\textrecipe}}}
\ifMARV
  \index{Deleatur=\texttt{\string\Deleatur}|see{\texttt{\string\Denarius}}}
  \index{mouse|see{\texttt{\string\ComputerMouse}}}
\fi    % MARV test
\index{playing cards|see{card suits}}
\ifABX
  \index{nibar=\texttt{\string\nibar}|see{\texttt{\string\ownsbar}}}
  \index{ring equal to|see{\texttt{\string\circeq}}}
  \index{ring in equal to|see{\texttt{\string\eqcirc}}}
  \index{cutoff subtraction|see{\texttt{\string\dotdiv}}}
  \index{lsemantic=\texttt{\string\lsemantic}|see{\texttt{\string\ldbrack}}}
  \index{rsemantic=\texttt{\string\rsemantic}|see{\texttt{\string\rdbrack}}}
\fi    % ABX test
\index{rationalized Planck constant|see{\texttt{\string\hbar}}}
\index{options|see{package options}}
\index{cardinality|see{\texttt{\string\aleph}}}
\index{wreath product|see{\texttt{\string\wr}}}
\index{reverse solidus|see{\texttt{\string\textbackslash}}}
\index{radicals|see{\texttt{\string\sqrt} \emph{and} \texttt{\string\surd}}}
\index{roots|see{\texttt{\string\sqrt}}}
\index{square root|see{\texttt{\string\sqrt}}}
\index{square root>hooked|see{\texttt{\string\hksqrt}}}
\index{cube root|see{\texttt{\string\sqrt}}}
\ifcomplete
  \index{return|see{carriage return}}
  \index{heads|see{faces}}
  \index{people|see{faces}}
\fi
\ifTX
  \index{fish hook|see{\texttt{\string\strictif}}}
  \index{par|see{\texttt{\string\invamp}}}
\fi    % TX test
\index{stochastic independence|see{\texttt{\string\bot}}}
\index{independence>stochastic|see{\texttt{\string\bot}}}
\index{orthogonal to|see{\texttt{\string\bot}}}
\index{entails|see{\texttt{\string\models}}}
\index{micro|see{\texttt{\string\textmu}}}
\index{Angstrom unit=\AA{}ngstr\"om unit>math mode|see{\texttt{\string\mathring}}}
\index{Angstrom unit=\AA{}ngstr\"om unit>text mode|see{\texttt{\string\AA}}}
\index{yen|see{\texttt{\string\textyen}}}
\index{equilibrium|see{\texttt{\string\rightleftharpoons}}}
\index{number|see{\texttt{\string\textnumero}}}
\index{ditto marks|see{\texttt{\string\textquotedbl}}}
\index{Weierstrass p function=Weierstrass $\wp$ function|see{\texttt{\string\wp}}}
\index{inexact differential|see{\texttt{\string\dbar}}}
\ifhaveslashed
  \index{reduced quadrupole moment|see{\texttt{\string\rqm}}}
\fi    % haveslashed
\ifST
  \index{banana brackets|see{\texttt{\string\llparenthesis} \emph{and} \texttt{\string\rrparenthesis}}}
  \index{catamorphism|see{\texttt{\string\llparenthesis} \emph{and} \texttt{\string\rrparenthesis}}}
\fi    % ST test
\ifOTII
  \index{impulse train|see{sha}}
  \index{Tate-Shafarevich group|see{sha}}
\fi
\ifSKAK
  \index{king|see{chess symbols}}
  \index{queen|see{chess symbols}}
  \index{castle|see{chess symbols}}
  \index{rook|see{chess symbols}}
  \index{bishop|see{chess symbols}}
  \index{knight|see{chess symbols}}
  \index{pawn|see{chess symbols}}
\fi    % SKAK test
\index{differential, inexact|see{\texttt{\string\dbar}}}
\index{brackets|see{delimiters}}
\ifcomplete
  \index{equivalence|see{\texttt{\string\equiv}, \texttt{\string\leftrightarrow}, \emph{and} \texttt{\string\threesim}}}
\else
  \index{equivalence|see{\texttt{\string\equiv} \emph{and} \texttt{\string\leftrightarrow}}}
\fi
\index{vinculum|see{\texttt{\string\overline}}}
\index{es-zet|see{\texttt{\string\ss}}}
\index{Maxwell-Stefan diffusion coefficient|see{\texttt{\string\DH}}}
\index{Laplacian=Laplacian ($\nabla^2$)|see{\texttt{\string\nabla}}}
\index{Laplacian=Laplacian ($\Delta$)|see{\texttt{\string\Delta}}}
\index{infinity=infinity ($\infty$)|see{\texttt{\string\infty}}}
%\ifx\BBmathbb\undefined\else
%  \index{double summation=double summation ({\usefont{U}{bbold}{m}{n}\char"06})|see{alphabets, math}}
%  \index{summation, double=summation, double ({\usefont{U}{bbold}{m}{n}\char"06})|see{alphabets, math}}
%\fi
\index{evaluated at|see{\texttt{\string\vert}}}
\index{CP1252|see{code page 1252}}
\index{CP437|see{code page 437}}
\ifSIMP
  \index{nuclear power plant|see{\texttt{\string\SNPP}}}
\fi    % SIMP test
\ifcomplete    % Really only needs to be ARK or DING or PI.
  \index{hands|see{fists}}
  \index{printer's fist|see{fists}}
  \index{pointing finger|see{fists}}
  \index{finger, pointing|see{fists}}
\fi    % complete test

% "See also"s should appear after all page references.
\providecommand*\seealso[2]{\emph{\alsoname}#1}
\providecommand*\alsoname{see also}
\AtEndDocument{%
  \index{carriage return|seealso{\string\texttt{\string\string\string\hookleftarrow}}}
  \index{transforms|seealso{alphabets, math}}
  \ifTX
    \index{parallel|seealso{\string\texttt{\string\string\string\varparallel}}}
  \fi
  \ifST
    \index{Plimsoll line|seealso{\string\texttt{\string\string\string\minuso}}}
  \fi
}

% Multiple packages define \multimap.
\makeatletter
  \@ifundefined{multimap}{}{%
    \index{linear implication|see{\texttt{\string\string\string\multimap}}}
    \index{lollipop|see{\texttt{\string\string\string\multimap}}}}
\makeatother

% Minutes/seconds and feet/inches are normally formed with superscripted
% primes.
\index{arcminutes|see{\texttt{\string\prime}}}
\index{angular minutes|see{\texttt{\string\prime}}}
\index{minutes, angular|see{\texttt{\string\prime}}}
\index{feet|see{\texttt{\string\prime} \emph{and}
  \texttt{\string\textquotesingle}}}
\ifABX
  \index{arcseconds|see{\texttt{\string\second}}}
  \index{angular seconds|see{\texttt{\string\second}}}
  \index{seconds, angular|see{\texttt{\string\second}}}
  \index{inches|see{\texttt{\string\second} \emph{and}
    \texttt{\string\textquotedbl}}}
\else
  \index{arcseconds|see{\texttt{\string\prime}}}
  \index{angular seconds|see{\texttt{\string\prime}}}
  \index{seconds, angular|see{\texttt{\string\prime}}}
  \index{inches|see{\texttt{\string\prime} \emph{and}
    \texttt{\string\textquotedbl}}}
\fi

% \notowns can be mapped to various things depending on package availability.
\ifABX
  \ifTX
    \index{notowns=\texttt{\string\notowns}|see{\texttt{\string\notowner}
      \emph{and} \texttt{\string\notni}}}
  \else
    \index{notowns=\texttt{\string\notowns}|see{\texttt{\string\notowner}}}
  \fi
\else
  \ifTX
    \index{notowns=\texttt{\string\notowns}|see{\texttt{\string\notni}}}
  \fi
\fi

% Double brackets are defined by both ST and ABX.
\ifABX
  \ifST
    \index{semantic valuation|see{\texttt{\string\llbracket}/\texttt{\string\rrbracket}
      \emph{and} \texttt{\string\ldbrack}/\texttt{\string\rdbrack}}}
  \else
    \index{semantic valuation|see{\texttt{\string\ldbrack}/\texttt{\string\rdbrack}}}
  \fi
\else
  \ifST
    \index{semantic valuation|see{\texttt{\string\llbracket}/\texttt{\string\rrbracket}}}
  \fi
\fi

% The following were generated automatically from txfonts.sty.
\ifTX
  \index{circledplus=\texttt{\string\circledplus}|see{\texttt{\string\oplus}}}
  \index{circledminus=\texttt{\string\circledminus}|see{\texttt{\string\ominus}}}
  \index{circledtimes=\texttt{\string\circledtimes}|see{\texttt{\string\otimes}}}
  \index{circledslash=\texttt{\string\circledslash}|see{\texttt{\string\oslash}}}
  \index{circleddot=\texttt{\string\circleddot}|see{\texttt{\string\odot}}}
  \index{le=\texttt{\string\le}|see{\texttt{\string\leq}}}
  \index{ge=\texttt{\string\ge}|see{\texttt{\string\geq}}}
  \index{gets=\texttt{\string\gets}|see{\texttt{\string\leftarrow}}}
  \index{to=\texttt{\string\to}|see{\texttt{\string\rightarrow}}}
  \index{owns=\texttt{\string\owns}|see{\texttt{\string\ni}}}
  \index{lnot=\texttt{\string\lnot}|see{\texttt{\string\neg}}}
  \index{land=\texttt{\string\land}|see{\texttt{\string\wedge}}}
  \index{lor=\texttt{\string\lor}|see{\texttt{\string\vee}}}
  \index{restriction=\texttt{\string\restriction}|see{\texttt{\string\upharpoonright}}}
  \index{Doteq=\texttt{\string\Doteq}|see{\texttt{\string\doteqdot}}}
  \index{doublecup=\texttt{\string\doublecup}|see{\texttt{\string\Cup}}}
  \index{doublecap=\texttt{\string\doublecap}|see{\texttt{\string\Cap}}}
  \index{llless=\texttt{\string\llless}|see{\texttt{\string\lll}}}
  \index{gggtr=\texttt{\string\gggtr}|see{\texttt{\string\ggg}}}
  %\index{Box=\texttt{\string\Box}|see{\texttt{\string\square}}}
  \index{ne=\texttt{\string\ne}|see{\texttt{\string\neq}}}
  %\index{notowns=\texttt{\string\notowns}|see{\texttt{\string\notni}}}
  \index{lrJoin=\texttt{\string\lrJoin}|see{\texttt{\string\Join}}}
  %\index{bowtie=\texttt{\string\bowtie}|see{\texttt{\string\lrtimes}}}
  \index{dasharrow=\texttt{\string\dasharrow}|see{\texttt{\string\dashrightarrow}}}
  \index{circledotright=\texttt{\string\circledotright}|see{\texttt{\string\circleddotright}}}
  \index{circledotleft=\texttt{\string\circledotleft}|see{\texttt{\string\circleddotleft}}}
\fi    % TX test

% The following were generated semi-automatically from SYMLIST using:
%   egrep '\text' SYMLIST | sed 's/\\text//' | xargs -i egrep '^{}$' /usr/share/dict/words | xargs -i sh -c 'egrep -q "^\\\\{}$" SYMLIST || echo "\\index{{}|see{\\texttt{\\string\\text{}}}}"' \;
% then editing the result.
\index{blank|see{\texttt{\string\textblank}}}
\index{born|see{\texttt{\string\textborn}}}
\index{died|see{\texttt{\string\textdied}}}
\index{discount|see{\texttt{\string\textdiscount}}}
\index{divorced|see{\texttt{\string\textdivorced}}}
\index{dollar|see{\texttt{\string\textdollar}}}
%\index{ellipsis|see{\texttt{\string\textellipsis}}}
\index{estimated|see{\texttt{\string\textestimated}}}
\index{florin|see{\texttt{\string\textflorin}}}
%\index{greater|see{\texttt{\string\textgreater}}}
\index{leaf|see{\texttt{\string\textleaf}}}
%\index{less|see{\texttt{\string\textless}}}
\index{married|see{\texttt{\string\textmarried}}}
\index{minus|see{\texttt{\string\textminus}}}
\index{ohm|see{\texttt{\string\textohm}}}
%\index{paragraph|see{\texttt{\string\textparagraph}}}
\index{recipe|see{\texttt{\string\textrecipe}}}
%\index{registered|see{\texttt{\string\textregistered}}}
%\index{section|see{\texttt{\string\textsection}}}
\index{sterling|see{\texttt{\string\pounds}}}
%\index{style|see{\texttt{\string\textstyle}}}
%\index{superscript|see{\texttt{\string\textsuperscript}}}
\index{trademark|see{\texttt{\string\texttrademark}}}
%\index{underscore|see{\texttt{\string\textunderscore}}}
\index{won|see{\texttt{\string\textwon}}}
\ifTIPA
  \index{advancing|see{\texttt{\string\textadvancing}}}
  \index{bullseye|see{\texttt{\string\textbullseye}}}
  \index{lowering|see{\texttt{\string\textlowering}}}
  \index{pipe|see{\texttt{\string\textpipe}}}
  \index{raising|see{\texttt{\string\textraising}}}
  \index{retracting|see{\texttt{\string\textretracting}}}
  \index{seagull|see{\texttt{\string\textseagull}}}
\fi    % TIPA test
%\index{swab|see{\texttt{\string\textswab}}}


\section{Introduction}

Welcome to the \doctitle!  This document strives to be your primary
source of \latex{} symbol information: font samples, \latex{}
commands, packages, usage details, caveats---everything needed to put
thousands of different symbols at your disposal.  All of the fonts
covered herein meet the following criteria:

\begin{enumerate}
  \item They are freely available from the Comprehensive\idxCTAN{}
  \TeX{} Archive Network (\url{http://www.ctan.org}).

  \item All of their symbols have \latexE{} bindings.  That is, a user
  should be able to access a symbol by name, not just by
  \cmd{\char}\meta{number}.
\end{enumerate}

\noindent
These are not particularly limiting criteria; the \doctitle{} contains
samples of \approxcount\prevtotalsymbols{} symbols---quite a large
number.  Some of these symbols are guaranteed to be available in every
\latexE{} system; others require fonts and packages that may not
accompany a given distribution and that therefore need to be
installed.  See
\url{http://www.tex.ac.uk/cgi-bin/texfaq2html?label=instpackages+wherefiles}
for help with installing new fonts and packages.


\subsection{Document Usage}

Each section of this document contains a number of font tables.  Each
table shows a set of symbols, with the corresponding \latex{} command
to the right of each symbol.  A table's caption indicates what package
needs to be loaded in order to access that table's symbols.  For
example, the symbols in Table~\ref{old-style-nums}, ``\TC\ Old-Style
Numerals'', are made available by putting
``\cmd{\usepackage}\verb|{textcomp}|'' in your document's preamble.
``\AMS'' means to use the \AMS{} packages, viz.\ \pkgname{amssymb}
and/or \pkgname{amsmath}.  Notes below a table provide additional
information about some or all the symbols in that table.

One\label{altenc} note that appears a few times in this document,
particularly in Section~\ref{body-text-symbols}, indicates that
certain symbols do not exist in the OT1 \fntenc[OT1]
(Donald\index{Knuth, Donald E.} Knuth's original, 7-bit
\fntenc[7-bit], which is the default \fntenc{} for \latex) and that
you should use \pkgname{fontenc} to select a different encoding, such
as T1 (a common 8-bit \fntenc[8-bit]\index{font encodings>T1}).  That
means that you should put
``\cmd{\usepackage}\verb|[|\meta{encoding}\verb|]{fontenc}|'' in your
document's preamble, where \meta{encoding} is, e.g.,
\texttt{T1}\index{font encodings>T1} or \texttt{LY1}\index{font
encodings>LY1}.  To limit the change in \fntenc[limiting scope of] to
the current group, use
``\cmd{\fontencoding}\verb|{|\meta{encoding}\verb|}|\cmd{\selectfont}''.

Section~\ref{addl-info} contains some additional information about the
symbols in this document.  It shows which symbol names are not unique
across packages, gives examples of how to create new symbols out of
existing symbols, explains how symbols are spaced in math mode,
presents a \latex{} ASCII\index{ASCII} and Latin~1\index{Latin 1}
tables, and provides some information about this document itself.  The
\doctitle{} ends with an index of all the symbols in the document and
various additional useful terms.


\ifcomplete

\subsection{Frequently Requested Symbols}

There are a number of symbols that are requested over and over again
on \ctt.  If you're looking for such a symbol the following list will
help you find it quickly.

\newenvironment{symbolfaq}{%
  \ifhavemulticol
    \setlength{\columnsep}{3em}%
    \begin{multicols}{2}%
  \fi
  \setlength{\parskip}{1ex}%
  \newcommand{\faq}[2]{%
    \noindent##1\quad\dotfill\quad\makebox[1em][r]{##2}\par}%
}{%
  \ifhavemulticol
    \end{multicols}%
  \fi
}

\begin{symbolfaq}
  \faq{\textvisiblespace, as in
       ``Spaces\textvisiblespace are\textvisiblespace significant.''}
      {\pageref{text-predef}}
  \faq{\'{\i}, \`{\i}, \={\i}, \^{\i}, etc.\ (versus \'i, \`i, \=i, and \^i)}
      {\pageref{text-accents}}
  \faq{\textcent}
      {\pageref{tc-currency}}
  \faq{\EUR}
      {\pageref{marv-currency}}
  \faq{\textcopyright, \textregistered, and \texttrademark}
      {\pageref{tc-legal}}
  \faq{\textperthousand}
      {\pageref{tc-misc}}
  \faq{$\oiint$}
      {\pageref{txpx-large}}
  \faq{$\therefore$}
      {\pageref{ams-rel}}
  \faq{$\coloneqq$ and $\Coloneqq$}
      {\pageref{txpx-rel}}
  \faq{$\lesssim$ and $\gtrsim$}
      {\pageref{ams-inequal-rel}}
  \faq{$\MDOTSiddots$}
      {\pageref{mathdots-dots}}
  \faq{\textdegree, as in ``180\textdegree'' or ``15\textcelsius''}
      {\pageref{tc-math}}
  \faq{\mathscr{L}, \mathscr{F}, etc.}
      {\pageref{alphabets}}
  \faq{\mathbbm{N}, \mathbbm{Z}, \mathbbm{R}, etc.}
      {\pageref{alphabets}}
  \faq{$\dashint$}
      {\pageref{dashint}}
  \faq{\diatop[{\diatop[\'|\=]}|a],
       \diatop[{\diatop[\`|\^]}|e], etc.
       (i.e., several accents per character)}
      {\pageref{multiple-accents}}
  \faq{$<$, $>$, and $|$ (instead of <, >, and |)}
      {\pageref{upside-down}}
  \faq{\textasciicircum\ and \textasciitilde\ (or $\sim$)}
      {\pageref{tildes}}
\end{symbolfaq}

\fi    % ifcomplete


\section{Body-text symbols}
\label{body-text-symbols}
\idxbothbegin{body-text}{symbols}

This section lists symbols that are intended for use in running text,
such as punctuation marks, accents, ligatures, and currency symbols.

\bigskip

\begin{symtable}{\latexE{} Escapable ``Special'' Characters}
\index{special characters=``special'' characters}
\index{escapable characters}
\label{special-escapable}
\begin{tabular}{*6{ll@{\qqquad}}ll}
\K\$   & \K\%   & \K\_$\,^*$  & \Kp\}   & \K\&   & \K\#   & \Kp\{   \\
\end{tabular}

\bigskip
\begin{tablenote}[*]
  The \pkgname{underscore} package redefines ``\verb+_+'' to produce
  an underscore in text mode (i.e.,~it makes it unnecessary to escape
  the underscore character).
\end{tablenote}
\end{symtable}


\begin{symtable}{Predefined \latexE{} Text-mode Commands}
\index{space, visible}
\index{inequalities}
\index{tilde}
\index{copyright}
\idxboth{dot}{symbols}
\index{dots (ellipses)} \index{ellipses (dots)}
\idxboth{legal}{symbols}
\label{text-predef}
\begin{tabular}{lll@{\qqquad}lll}
\V\textasciicircum      & \V\textless            \\
\V\textasciitilde       & \V[\ltextordfeminine]\textordfeminine   \\
\V\textasteriskcentered & \V[\ltextordmasculine]\textordmasculine \\
\V\textbackslash        & \V\textparagraph$^*$   \\
\V\textbar              & \V\textperiodcentered  \\
\V\textbraceleft$^*$    & \V\textquestiondown    \\
\V\textbraceright$^*$   & \V\textquotedblleft    \\
\V\textbullet           & \V\textquotedblright   \\
\V[\ltextcopyright]\textcopyright$^*$
                        & \V\textquoteleft       \\
\V\textdagger$^*$       & \V\textquoteright      \\
\V\textdaggerdbl$^*$    & \V[\ltextregistered]\textregistered     \\
\V\textdollar$^*$       & \V\textsection$^*$     \\
\V\textellipsis$^*$     & \V\textsterling$^*$    \\
\V\textemdash           & \V[\ltexttrademark]\texttrademark       \\
\V\textendash           & \V\textunderscore$^*$  \\
\V\textexclamdown       & \V\textvisiblespace    \\
\V\textgreater          \\
\end{tabular}

\bigskip
\twosymbolmessage

\bigskip
\usetextmathmessage[*]

\end{symtable}


\begin{symtable}{\latexE{} Commands Defined to Work in Both Math and Text Mode}
\index{dots (ellipses)} \index{ellipses (dots)}
\index{copyright}
\idxboth{legal}{symbols}
\label{math-text}
\begin{tabular}{*3{lll@{\qqquad}}lll}
\V\$ & \V\_              & \V\ddag    & \Vp\{ \\
\V\P & \V[\ltextcopyright]\copyright
                         & \V\dots    & \Vp\} \\
\V\S & \V\dag            & \V\pounds          \\
\end{tabular}

\bigskip
\twosymbolmessage
\end{symtable}


\begin{symtable}[AMS]{\AMS\ Commands Defined to Work in Both Math and Text Mode}
\label{ams-math-text}
\begin{tabular}{*2{ll@{\qquad}}ll}
\X\checkmark & \X\circledR & \X\maltese
\end{tabular}
\end{symtable}


\begin{symtable}{Non-ASCII Letters (Excluding Accented Letters)}
\index{letters>non-ASCII}\index{ASCII}
\label{non-ascii}
\begin{tabular}{*4{ll@{\hspace*{3em}}}ll}
\K\aa      & \Ks\DH     & \K\L       & \K\o       & \K\ss      \\
\K\AA      & \Ks\dh     & \K\l       & \K\O       & \K\SS      \\
\K\AE      & \Ks\DJ     & \Ks\NG     & \K\OE      & \Ks\TH     \\
\K\ae      & \Ks\dj     & \Ks\ng     & \K\oe      & \Ks\th     \\
\end{tabular}

\bigskip
\begin{tablenote}[*]
  Not available in the OT1 \fntenc[OT1].  Use the \pkgname{fontenc}
  package to select an alternate \fntenc[T1], such as T1.
\end{tablenote}
\end{symtable}


\begin{symtable}[FC]{Letters Used to Typeset African Languages}
\index{alphabets>African}
\label{fc}
\begin{tabular}{*6{ll@{\qquad}}ll}
\Jiv\B{D} & \Jiv\m{c} & \Jiv\m{f} & \Jiv\m{k} & \Jiv\M{t}     & \Jiv\m{Z} \\
\Jiv\B{d} & \Jiv\m{D} & \Jiv\m{F} & \Jiv\m{N} & \Jiv\M{T}     & \Jiv\T{E} \\
\Jiv\B{H} & \Jiv\M{d} & \Jiv\m{G} & \Jiv\m{n} & \Jiv\m{t}     & \Jiv\T{e} \\
\Jiv\B{h} & \Jiv\M{D} & \Jiv\m{g} & \Jiv\m{o} & \Jiv\m{T}     & \Jiv\T{O} \\
\Jiv\B{t} & \Jiv\m{d} & \Jiv\m{I} & \Jiv\m{O} & \Jiv\m{u}$^*$ & \Jiv\T{o} \\
\Jiv\B{T} & \Jiv\m{E} & \Jiv\m{i} & \Jiv\m{P} & \Jiv\m{U}$^*$ \\
\Jiv\m{b} & \Jiv\m{e} & \Jiv\m{J} & \Jiv\m{p} & \Jiv\m{Y}     \\
\Jiv\m{B} & \Jiv\M{E} & \Jiv\m{j} & \Jiv\m{s} & \Jiv\m{y}     \\
\Jiv\m{C} & \Jiv\M{e} & \Jiv\m{K} & \Jiv\m{S} & \Jiv\m{z}     \\
\end{tabular}

\bigskip
\begin{tablenote}
  These characters all need the T4 \fntenc[T4], which is provided by
  the \FC\ package.
\end{tablenote}

\bigskip
\begin{tablenote}[*]
  \verb|\m{v}| and \verb|\m{V}| are synonyms for \verb|\m{u}| and
  \verb|\m{U}|.
\end{tablenote}
\end{symtable}


\begin{symtable}[VIET]{Letters Used to Typeset Vietnamese}
\index{alphabets>Vietnamese}
\begin{tabular}{*3{ll@{\qquad}}ll}
\Kv\OHORN & \Kv\ohorn & \Kv\UHORN & \Kv\uhorn \\
\end{tabular}

\bigskip
\begin{tablenote}
  These characters all need the T5 \fntenc[T5], which is provided by
  the \VIET\ package.
\end{tablenote}

\end{symtable}


\begin{symtable}{Punctuation Marks Not Found in OT1}
\index{punctuation}
\label{punc-no-OT1}
\begin{tabular}{*8l}
\Kt\guillemotleft  & \Kt\guilsinglleft & \Kt\quotedblbase & \Kt\textquotedbl \\
\Kt\guillemotright & \Kt\guilsinglright & \Kt\quotesinglbase \\
\end{tabular}

\bigskip
\begin{tablenote}
  To get these symbols, use the \pkgname{fontenc} package to select an
  alternate \fntenc[T1], such as~T1.
\end{tablenote}
\end{symtable}


\begin{symtable}[PI]{\PI\ Decorative Punctuation Marks}
\index{punctuation}
\label{pi-punctuation}
\begin{tabular}{*5{ll}}
\Tp{123} & \Tp{125} & \Tp{161} & \Tp{163} \\
\Tp{124} & \Tp{126} & \Tp{162} \\
\end{tabular}
\end{symtable}


\begin{longsymtable}[TIPA]{\TIPA\ Phonetic Symbols}
\ltidxboth{phonetic}{symbols}
\ltidxboth{linguistic}{symbols}
\ltidxboth{dictionary}{symbols}
\ltidxboth{rotated}{symbols}
\ltidxboth{upside-down}{symbols}
\ltidxboth{inverted}{symbols}
\ltindex{alphabets>phonetic}
\index{tilde}
\label{tipa-phonetic}
\begin{longtable}{*3{ll}}
\multicolumn{6}{l}{\small\textit{(continued from previous page)}} \\[3ex]
\endhead
\endfirsthead
\\[3ex]
\multicolumn{6}{r}{\small\textit{(continued on next page)}}
\endfoot
\endlastfoot
\K\textbabygamma       & \K\textglotstop        & \K\textrtailn         \\
\K\textbarb            & \K\texthalflength      & \K\textrtailr         \\
\K\textbarc            & \K\texthardsign        & \K\textrtails         \\
\K\textbard            & \K\texthooktop         & \K\textrtailt         \\
\K\textbardotlessj     & \K\texthtb             & \K\textrtailz         \\
\K\textbarg            & \K\texthtbardotlessj   & \K\textrthook         \\
\K\textbarglotstop     & \K\texthtc             & \K\textsca            \\
\K\textbari            & \K\texthtd             & \K\textscb            \\
\K\textbarl            & \K\texthtg             & \K\textsce            \\
\K\textbaro            & \K\texthth             & \K\textscg            \\
\K\textbarrevglotstop  & \K\texththeng          & \K\textsch            \\
\K\textbaru            & \K\texthtk             & \K\textschwa          \\
\K\textbeltl           & \K\texthtp             & \K\textsci            \\
\K\textbeta            & \K\texthtq             & \K\textscj            \\
\K\textbullseye        & \K\texthtrtaild        & \K\textscl            \\
\K\textceltpal         & \K\texthtscg           & \K\textscn            \\
\K\textchi             & \K\texthtt             & \K\textscoelig        \\
\K\textcloseepsilon    & \K\texthvlig           & \K\textscomega        \\
\K\textcloseomega      & \K\textinvglotstop     & \K\textscr            \\
\K\textcloserevepsilon & \K\textinvscr          & \K\textscripta        \\
\K\textcommatailz      & \K\textiota            & \K\textscriptg        \\
\K\textcorner          & \K\textlambda          & \K\textscriptv        \\
\K\textcrb             & \K\textlengthmark      & \K\textscu            \\
\K\textcrd             & \K\textlhookt          & \K\textscy            \\
\K\textcrg             & \K\textlhtlongi        & \K\textsecstress      \\
\K\textcrh             & \K\textlhtlongy        & \K\textsoftsign       \\
\K\textcrinvglotstop   & \K\textlonglegr        & \K\textstretchc       \\
\K\textcrlambda        & \K\textlptr            & \K\texttctclig        \\
\K\textcrtwo           & \K\textltailm          & \K\textteshlig        \\
\K\textctc             & \K\textltailn          & \K\texttheta          \\
\K\textctd             & \K\textltilde          & \K\textthorn          \\
\K\textctdctzlig       & \K\textlyoghlig        & \K\texttoneletterstem \\
\K\textctesh           & \K\textObardotlessj    & \K\texttslig          \\
\K\textctj             & \K\textOlyoghlig       & \K\textturna          \\
\K\textctn             & \K\textomega           & \K\textturncelig      \\
\K\textctt             & \K\textopencorner      & \K\textturnh          \\
\K\textcttctclig       & \K\textopeno           & \K\textturnk          \\
\K\textctyogh          & \K\textpalhook         & \K\textturnlonglegr   \\
\K\textctz             & \K\textphi             & \K\textturnm          \\
\K\textdctzlig         & \K\textpipe            & \K\textturnmrleg      \\
\K\textdoublebaresh    & \K\textprimstress      & \K\textturnr          \\
\K\textdoublebarpipe   & \K\textraiseglotstop   & \K\textturnrrtail     \\
\K\textdoublebarslash  & \K\textraisevibyi      & \K\textturnscripta    \\
\K\textdoublepipe      & \K\textramshorns       & \K\textturnt          \\
\K\textdoublevertline  & \K\textrevapostrophe   & \K\textturnv          \\
\K\textdownstep        & \K\textreve            & \K\textturnw          \\
\K\textdyoghlig        & \K\textrevepsilon      & \K\textturny          \\
\K\textdzlig           & \K\textrevglotstop     & \K\textupsilon        \\
\K\textepsilon         & \K\textrevyogh         & \K\textupstep         \\
\K\textesh             & \K\textrhookrevepsilon & \K\textvertline       \\
\K\textfishhookr       & \K\textrhookschwa      & \K\textvibyi          \\
\K\textg               & \K\textrhoticity       & \K\textvibyy          \\
\K\textgamma           & \K\textrptr            & \K\textwynn           \\
\K\textglobfall        & \K\textrtaild          & \K\textyogh           \\
\K\textglobrise        & \K\textrtaill          &                       \\
\end{longtable}

\begin{tablenote}
  \TIPA\ defines shortcut characters for many of the above.  It also
  defines a command \cmd{\tone} for denoting tone letters (pitches).
  \seedocs{\TIPA}.
\end{tablenote}
\end{longsymtable}


\begin{symtable}[TIPX]{\TIPX\ Phonetic Symbols}
\idxboth{phonetic}{symbols}
\idxboth{linguistic}{symbols}
\idxboth{dictionary}{symbols}
\idxboth{rotated}{symbols}
\idxboth{upside-down}{symbols}
\idxboth{inverted}{symbols}
\index{alphabets>phonetic}
\label{tipx-phonetic}
\begin{longtable}{*3{ll}}
\multicolumn{6}{l}{\small\textit{(continued from previous page)}} \\[3ex]
\endhead
\endfirsthead
\\[3ex]
\multicolumn{6}{r}{\small\textit{(continued on next page)}}
\endfoot
\endlastfoot
\K\textaolig            & \K\texthtbardotlessjvar & \K\textrthooklong     \\
\K\textbenttailyogh     & \K\textinvomega         & \K\textscaolig        \\
\K\textbktailgamma      & \K\textinvsca           & \K\textscdelta        \\
\K\textctinvglotstop    & \K\textinvscripta       & \K\textscf            \\
\K\textctjvar           & \K\textlfishhookrlig    & \K\textsck            \\
\K\textctstretchc       & \K\textlhookfour        & \K\textscm            \\
\K\textctstretchcvar    & \K\textlhookp           & \K\textscp            \\
\K\textctturnt          & \K\textlhti             & \K\textscq            \\
\K\textdblig            & \K\textlooptoprevesh    & \K\textspleftarrow    \\
\K\textdoublebarpipevar & \K\textnrleg            & \K\textstretchcvar    \\
\K\textdoublepipevar    & \K\textObullseye        & \K\textsubdoublearrow \\
\K\textdownfullarrow    & \K\textpalhooklong      & \K\textsubrightarrow  \\
\K\textfemale           & \K\textpalhookvar       & \K\textthornvari      \\
\K\textfrbarn           & \K\textpipevar          & \K\textthornvarii     \\
\K\textfrhookd          & \K\textqplig            & \K\textthornvariii    \\
\K\textfrhookdvar       & \K\textrectangle        & \K\textthornvariv     \\
\K\textfrhookt          & \K\textretractingvar    & \K\textturnglotstop   \\
\K\textfrtailgamma      & \K\textrevscl           & \K\textturnsck        \\
\K\textglotstopvari     & \K\textrevscr           & \K\textturnscu        \\
\K\textglotstopvarii    & \K\textrhooka           & \K\textturnthree      \\
\K\textglotstopvariii   & \K\textrhooke           & \K\textturntwo        \\
\K\textgrgamma          & \K\textrhookepsilon     & \K\textuncrfemale     \\
\K\textheng             & \K\textrhookopeno       & \K\textupfullarrow    \\
\K\texthmlig            & \K\textrtailhth                                 \\
\end{longtable}
\end{symtable}


\begin{longsymtable}[WIPA]{\WIPA\ Phonetic Symbols}
\ltidxboth{phonetic}{symbols}
\ltidxboth{linguistic}{symbols}
\ltidxboth{dictionary}{symbols}
\ltidxboth{rotated}{symbols}
\ltidxboth{upside-down}{symbols}
\ltidxboth{inverted}{symbols}
\ltindex{alphabets>phonetic}
\index{tilde}
\label{wipa-phonetic}
\begin{longtable}{*4{ll}}
\multicolumn{8}{l}{\small\textit{(continued from previous page)}} \\[3ex]
\endhead
\endfirsthead
\\[3ex]
\multicolumn{8}{r}{\small\textit{(continued on next page)}}
\endfoot
\endlastfoot
\K\babygamma        & \K\eng            & \K\labdentalnas     & \K\schwa            \\
\K\barb             & \K\er             & \K\latfric          & \K\sci              \\
\K\bard             & \K\esh            & \K\legm             & \K\scn              \\
\K\bari             & \K[\WSUeth]\eth   & \K\legr             & \K\scr              \\
\K\barl             & \K\flapr          & \K\lz               & \K\scripta          \\
\K[\WSUbaro]\baro   & \K\glotstop       & \K\nialpha          & \K\scriptg          \\
\K\barp             & \K\hookb          & \K\nibeta           & \K\scriptv          \\
\K\barsci           & \K\hookd          & \K\nichi            & \K\scu              \\
\K\barscu           & \K\hookg          & \K\niepsilon        & \K\scy              \\
\K\baru             & \K\hookh          & \K\nigamma          & \K\slashb           \\
\K\clickb           & \K\hookheng       & \K\niiota           & \K\slashc           \\
\K\clickc           & \K\hookrevepsilon & \K\nilambda         & \K\slashd           \\
\K\clickt           & \K\hv             & \K\niomega          & \K\slashu           \\
\K\closedniomega    & \K\inva           & \K\niphi            & \K\taild            \\
\K\closedrevepsilon & \K\invf           & \K\nisigma          & \K\tailinvr         \\
\K\crossb           & \K\invglotstop    & \K\nitheta          & \K\taill            \\
\K\crossd           & \K\invh           & \K\niupsilon        & \K\tailn            \\
\K\crossh           & \K\invlegr        & \K\nj               & \K\tailr            \\
\K\crossnilambda    & \K\invm           & \K\oo               & \K\tails            \\
\K\curlyc           & \K\invr           & \K[\WSUopeno]\openo & \K\tailt            \\
\K\curlyesh         & \K\invscr         & \K\reve             & \K\tailz            \\
\K\curlyyogh        & \K\invscripta     & \K\reveject         & \K\tesh             \\
\K\curlyz           & \K\invv           & \K\revepsilon       & \K[\WSUthorn]\thorn \\
\K\dlbari           & \K\invw           & \K\revglotstop      & \K\tildel           \\
\K\dz               & \K\invy           & \K\scd              & \K\yogh             \\
\K\ejective         & \K\ipagamma       & \K\scg              \\
\end{longtable}
\end{longsymtable}


\begin{symtable}[WASY]{\WASY\ Phonetic Symbols}
\idxboth{phonetic}{symbols}
\idxboth{linguistic}{symbols}
\idxboth{dictionary}{symbols}
\idxboth{rotated}{symbols}
\idxboth{upside-down}{symbols}
\idxboth{inverted}{symbols}
\index{alphabets>phonetic}
\label{wasy-phonetics}
\begin{tabular}{*8l}
\K\DH             & \K\dh             & \K\openo          \\
\K\Thorn          & \K\inve           & \K\thorn          \\
\end{tabular}
\end{symtable}


\begin{symtable}[PHON]{\PHON\ Phonetic Symbols}
\idxboth{phonetic}{symbols}
\idxboth{linguistic}{symbols}
\idxboth{dictionary}{symbols}
\idxboth{rotated}{symbols}
\idxboth{upside-down}{symbols}
\idxboth{inverted}{symbols}
\index{alphabets>phonetic}
\label{phon-phonetic}
\begin{tabular}{*5{ll}}
\K\barj              & \K\flap              & \K[\PHONibar]\ibar   & \K\rotvara           & \K\vari            \\
\K\barlambda         & \K\glottal           & \K[\PHONopeno]\openo & \K\rotw              & \K\varomega        \\
\K\emgma             & \K\hausaB            & \K\planck            & \K\roty              & \K\varopeno        \\
\K\engma             & \K\hausab            & \K\pwedge            & \K[\PHONschwa]\schwa & \K[\PHONvod]\vod   \\
\K\enya              & \K\hausad            & \K\revD              & \K[\PHONthorn]\thorn & \K\voicedh         \\
\K\epsi              & \K\hausaD            & \K\riota             & \K\ubar              & \K[\PHONyogh]\yogh \\
\K[\PHONesh]\esh     & \K\hausak            & \K\rotm              & \K\udesc                                  \\
\K[\PHONeth]\eth     & \K\hausaK            & \K\rotOmega          & \K\vara                                   \\
\K\fj                & \K[\PHONhookd]\hookd & \K\rotr              & \K[\PHONvarg]\varg                        \\
\end{tabular}
\end{symtable}


\begin{symtable}[PHONFC]{\PHONFC\ Phonetic Symbols}
\idxboth{phonetic}{symbols}
\idxboth{linguistic}{symbols}
\idxboth{dictionary}{symbols}
\index{alphabets>phonetic}
\label{phonfc-phonetic}
\begin{tabular}{*3{ll}}
\K[\encfour\PHONFCtextcrd]\textcrd         & \K[\encfour\PHONFCtexthtd]\texthtd       & \K[\encfour\PHONFCtextpipe]\textpipe       \\
\K[\encfour\PHONFCtextcrh]\textcrh         & \K[\encfour\PHONFCtexthtk]\texthtk       & \K[\encfour\PHONFCtextrtaild]\textrtaild   \\
\K[\encfour\PHONFCtextepsilon]\textepsilon & \K[\encfour\PHONFCtexthtp]\texthtp       & \K[\encfour\PHONFCtextrtailt]\textrtailt   \\
\K[\encfour\PHONFCtextesh]\textesh         & \K[\encfour\PHONFCtexthtt]\texthtt       & \K[\encfour\PHONFCtextschwa]\textschwa     \\
\K[\encfour\PHONFCtextfjlig]\textfjlig     & \K[\encfour\PHONFCtextiota]\textiota     & \K[\encfour\PHONFCtextscriptv]\textscriptv \\
\K[\encfour\PHONFCtexthtb]\texthtb         & \K[\encfour\PHONFCtextltailn]\textltailn & \K[\encfour\PHONFCtextteshlig]\textteshlig \\
\K[\encfour\PHONFCtexthtc]\texthtc         & \K[\encfour\PHONFCtextopeno]\textopeno   & \K[\encfour\PHONFCtextyogh]\textyogh       \\
\end{tabular}

\bigskip

\begin{tablenote}
  The idea behind the \PHONFC\ package's phonetic symbols is to
  provide an interface to some of the characters in the T4 \fntenc[T4]
  \ifFC
    (Table~\vref{fc})
  \fi    % FC
  but using the same names as
  \ifTIPA
    the \TIPA\ characters presented in Table~\vref{tipa-phonetic}.
  \else
    the \TIPA\ package.
  \fi    % TIPA
\end{tablenote}
\end{symtable}


\begin{symtable}[SMTR]{\SMTR\ Transliteration Symbols}
\idxboth{phonetic}{symbols}
\idxboth{linguistic}{symbols}
\idxboth{dictionary}{symbols}
\idxboth{transliteration}{symbols}
\idxboth{semitic}{transliteration}
\index{alphabets>phonetic}
\label{semtrans-phonetic}
\begin{tabular}{ll@{\hspace*{3em}}ll}
\K\Alif & \K\Ayn \\
\end{tabular}
\end{symtable}


\begin{symtable}{Text-mode Accents}
\index{accents}
\label{text-accents}
\begin{tabular}{*3{ll@{\hspace*{3em}}}ll}
\Q\"                                & \Q\`         & \Q\d         & \Q\r        \\
\Q\'                                & \QivBAR\ddag & \Qiv\G\ddag  & \Q\t        \\
\Q\.                                & \Q\~         & \Qv\h\S      & \Q\u        \\
\Qe[\magicequal][\magicequalname]\= & \Q\b         & \Q\H         & \Qiv\U\ddag \\
\Q\^                                & \Q\c         & \Qt\k$^\dag$ & \Q\v        \\
\end{tabular}
\par\medskip
\begin{tabular}{ll@{\hspace*{3em}}ll}
\Q\newtie$^*$ & \Qc\textcircled
\end{tabular}

\bigskip
\begin{tablenote}[*]
  Requires the \TC\ package.
\end{tablenote}

\medskip
\begin{tablenote}[\dag]
  Not available in the OT1 \fntenc[OT1].  Use the \pkgname{fontenc}
  package to select an alternate \fntenc[T1], such as T1.
\end{tablenote}

\medskip
\begin{tablenote}[\ddag]
  Requires the T4 \fntenc[T4], provided by the \FC\ package.
\end{tablenote}

\medskip
\begin{tablenote}[\S]
  Requires the T5 \fntenc[T5], provided by the \VIET\ package.
\end{tablenote}

\bigskip
\begin{tablenote}
  \index{dotless i=dotless $i~(\imath)$>text mode}
  \index{dotless j=dotless $j~(\jmath)$>text mode}
  Also note the existence of \cmdI{\i} and \cmdI{\j}, which produce
  dotless versions of ``i'' and ``j'' (viz., ``\i'' and ``\j'').  These
  are useful when the accent is supposed to replace the dot.  For
  example, ``\verb|na\"{\i}ve|'' produces a correct ``na\"{\i}ve'',
  while ``\verb|na\"{i}ve|'' would yield the rather odd-looking
  ``na\"{i}ve''.  (``\verb|na\"{i}ve|'' \emph{does} work in encodings
  other than OT1, however.)
\end{tablenote}
\end{symtable}


\begin{longsymtable}[TIPA]{\TIPA\ Text-mode Accents}
\ltindex{accents}
\index{tilde}
\label{tipa-accents}
\renewcommand{\arraystretch}{1.25}  % Keep high and low accents from touching.
\begin{longtable}{ll}
\multicolumn{2}{l}{\small\textit{(continued from previous page)}} \\[3ex]
\endhead
\endfirsthead
\\[3ex]
\multicolumn{2}{r}{\small\textit{(continued on next page)}}
\endfoot
\endlastfoot
\Q\textacutemacron      \\
\Q\textacutewedge       \\
\Q\textadvancing        \\
\Q\textbottomtiebar     \\
\Q\textbrevemacron      \\
\Q\textcircumacute      \\
\Q\textcircumdot        \\
\Q\textdotacute         \\
\Q\textdotbreve         \\
\Q\textdotbreve         \\
\Q\textdoublegrave      \\
\Q\textdoublevbaraccent \\
\Q\textgravecircum      \\
\Q\textgravedot         \\
\Q\textgravemacron      \\
\Q\textgravemid         \\
\Q\textinvsubbridge     \\
\Q\textlowering         \\
\Q\textmidacute         \\
\Q\textovercross        \\
\Q\textoverw            \\
\Q\textpolhook          \\
\Q\textraising          \\
\Q\textretracting       \\
\Q\textringmacron       \\
\Q\textroundcap         \\
\Q\textseagull          \\
\Q\textsubacute         \\
\Q\textsubarch          \\
\Q\textsubbar           \\
\Q\textsubbridge        \\
\Q\textsubcircum        \\
\Q\textsubdot           \\
\Q\textsubgrave         \\
\Q\textsublhalfring     \\
\Q\textsubplus          \\
\Q\textsubrhalfring     \\
\Q\textsubring          \\
\Q\textsubsquare        \\
\Q\textsubtilde         \\
\Q\textsubumlaut        \\
\Q\textsubw             \\
\Q\textsubwedge         \\
\Q\textsuperimposetilde \\
\Q\textsyllabic         \\
\Q\texttildedot         \\
\Q\texttoptiebar        \\
\Q\textvbaraccent       \\
\end{longtable}

\begin{tablenote}
  \TIPA\ defines shortcut sequences for many of the above.
  \seedocs{\TIPA}.
\end{tablenote}
\end{longsymtable}


\begin{symtable}[XIPA]{\XIPA\ Text-mode Accents}
\index{accents}
\label{xipa-accents}
\renewcommand{\arraystretch}{1.25}  % Keep high and low accents from touching.
\begin{tabular}{ll@{\hspace*{3em}}ll}
\Q\bibridge         & \Q\partvoiceless \\
\Q\crtilde          & \Q\sliding       \\
\Q\dottedtilde      & \Q\spreadlips    \\
\Q\doubletilde      & \Q\subcorner     \\
\Q\finpartvoice     & \Q\subdoublebar  \\
\Q\finpartvoiceless & \Q\subdoublevert \\
\Q\inipartvoice     & \Q\sublptr       \\
\Q\inipartvoiceless & \Q\subrptr       \\
\Q\overbridge       & \Q\whistle       \\
\Q\partvoice                           \\
\end{tabular}
\end{symtable}


\begin{symtable}[WIPA]{\WIPA\ Text-mode Accents}
\index{accents}
\label{wipa-accents}
\renewcommand{\arraystretch}{1.25}  % Keep high and low accents from touching.
\begin{tabular}{ll}
\Q\dental    \\
\Q\underarch \\
\end{tabular}
\end{symtable}


\begin{symtable}[PHON]{\PHON\ Text-mode Accents}
\index{accents}
\label{phon-accents}
\renewcommand{\arraystretch}{1.25}  % Keep high and low accents from touching.
\begin{tabular}{*3{ll}}
\Q\hill  & \Q\rc  & \Q\ut \\
\Q\od    & \Q\syl         \\
\Q\ohill & \Q\td          \\
\end{tabular}

\bigskip
\begin{tablenote}
  \begin{morespacing}{1pt}
    The \PHON\ package provides a few additional macros for linguistic
    accents. \cmd{\acbar} and \cmd{\acarc} compose characters with
    multiple accents; for example, \verb+\acbar{\'}{a}+ produces
    ``\acbar{\'}{a}'' and \verb+\acarc{\"}{e}+ produces
    ``\acbar{\"}{e}''.  \cmd{\labvel} joins two characters with an
    arc: \verb+\labvel{mn}+~$\rightarrow$ ``\labvel{mn}''.
    \cmd{\upbar} is intended to go between characters as in
    ``\verb+x\upbar{}y''+~$\rightarrow$ ``x\upbar{}y''.  Lastly,
    \cmd{\uplett} behaves like \cmd{\textsuperscript} but uses a
    smaller font.  Contrast ``\verb+p\uplett{h}''+~$\rightarrow$
    ``p\uplett{h}'' with ``\verb+p\textsuperscript{h}''+~$\rightarrow$
    ``p\textsuperscript{h}''.
  \end{morespacing}
\end{tablenote}
\end{symtable}


\begin{symtable}[METRE]{\METRE\ Text-mode Accents}
\index{accents}
\label{metre-accents}
\begin{tabular}{ll}
\Q\acutus             \\
\Q[\METREbreve]\breve \\
\Q\circumflexus       \\
\Q\diaeresis          \\
\Q\gravis             \\
\Q\macron             \\
\end{tabular}
\end{symtable}


\begin{symtable}[PHONFC]{\PHONFC\ Text-mode Accents}
\index{accents}
\label{phonfc-accents}
\renewcommand{\arraystretch}{1.25}  % Keep high and low accents from touching.
\begin{tabular}{ll}
\Qpfc[\PHONFCtextdoublegrave]\textdoublegrave \\
\Qpfc[\PHONFCtextvbaraccent]\textvbaraccent \\
\Qpfc[\PHONFCtextdoublevbaraccent]\textdoublevbaraccent \\
\end{tabular}

\bigskip

\begin{tablenote}
  The idea behind the \PHONFC\ package's text-mode accents is to
  provide an interface to some of the accents in the T4 \fntenc[T4]
  (accents marked with ``\ddag'' in Table~\vref{text-accents}) but
  using the same names as
  \ifTIPA
    the \TIPA\ accents presented in Table~\vref{tipa-accents}.
  \else
    the \TIPA\ package.
  \fi    % TIPA
\end{tablenote}
\end{symtable}


\begin{sym