[texhax] font style package location (was Re: adding boldface to \tt)

Uwe Lück uwe.lueck at web.de
Tue Oct 31 22:08:13 CET 2006


At 19:09 30.10.06, William Adams wrote:
>On Oct 29, 2006, at 10:48 AM, Karl Berry wrote:
>
> > I don't know of any program which can look at an entire TeX
> > installation
> > and create a sensible font chart showing what is available.  It
> > would be
> > a nice thing to have.  Maybe someone here would like to write it?
>
>Perhaps a better solution here would be to have a default location
>for packages which install fonts?
>
>Then, one could just look at that location, see that it includes:
>
>eulervm
>mathptmx
>mathpazo
>&c.

Oh, those directory structure considerations ...

Anyway, for this special purpose (list packages installing
fonts -- rather than fonts), the attached mysymbls.tex is a
first suggestion, exemplifying the limited approach I
suggested earlier on the original thread.

I have just deleted some parts of symbols.tex -- in a lazy
and very sub-optimal way. The attached output MYSYMBLS.dvi
shows you the few packages that are installed on my little
home PC. Maybe somebody finds it interesting enough
to improve mysymbls.tex and put it to CTAN.

Cheers,

   Uwe.
-------------- next part --------------
%% mysymbols.tex -- truncation of Scott Pakin's symbols.tex 
%% (CTAN:/info/symbols/comprehensive/symbols.tex)
%% Uwe Lueck -- http://contact-ednotes.sty.de.vu -- 2006/10/31. 
%% NO WARRANTY. 
%% Observe copyright and license of symbols.tex as above. 

%% PURPOSE of present file: 
%% Output (.dvi/.pdf/...) shows which LaTeX font installation 
%% packages (as known to symbols.tex recently) have been 
%% installed properly. 

\NeedsTeXFormat{LaTeX2e}

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

% 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>\textsf{#1}}}
\newcommand{\optname}[2]{%
  \textsf{#2}%
  \index{#2=\textsf{#2} (\textsf{#1} package option)}%
  \index{package options>\textsf{#2} (\textsf{#1})}}
\newcommand{\filename}[1]{%
  \texttt{#1}%
  \index{#1=\texttt{#1} (file)}}
\newcommand{\PSfont}[1]{%
  #1%
  \index{#1 (PostScript font)}%
  \index{fonts, PostScript>#1}%
  \index{PostScript fonts}%
}
\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.

% 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

% \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 at sty@file at exists@star}[3]{\IfFileExists{#1.sty}{#2}{#3}}
\newcommand{\if at sty@file at exists}[3]{%
  \IfFileExists{#1.sty}%
               {#2\@cons\foundpkgs{{#1}}}%
               {#3\completefalse\@cons\missingpkgs{{#1}}}
}
\newcommand{\IfStyFileExists}{%
  \@ifstar{\if at sty@file at exists@star}{\if at sty@file at 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 at ifstar=\@ifstar
   \usepackage{amsmath}
   \usepackage{amssymb}
   \let\@ifstar=\orig at ifstar
   \let\Rightarrowfill@=\relax
   \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}
  {\savesymbol{Rightarrow}
   \usepackage{marvosym}[2000/05/01]  % Major rewrite at this version.
   \restoresymbol{marv}{Rightarrow}
   \@ifundefined{Denarius}            % \Denarius is a newer symbol.
     {\global\MARVfalse}
     {\global\MARVtrue}
  }
  {}
\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 at wsuipa.sty\endcsname{%
     \csname ver at 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 at 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]{%
    \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}

   \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}
  }
  {}
\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
  }
  {}

% 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\usepackage{ascii}}
  {}

\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\usepackage{mathdots}}
  {}

\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 at universa.sty\endcsname{%
     \csname ver at 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}}
\ifAMS
  \IfStyFileExists{overrightarrow}
    {\ORAtrue\usepackage{overrightarrow}}
    {}
\fi    % AMS test

\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 at 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\ifEEQ
\newcommand\EEQ{\pkgname{empheq}}
\IfStyFileExists{empheq}
  {\EEQtrue
   \savesymbol{overbracket}
   \savesymbol{underbracket}
   \savesymbol{xrightleftharpoons}
   \usepackage{empheq}
   \restoresymbol{EEQ}{overbracket}
   \restoresymbol{EEQ}{underbracket}
   \restoresymbol{EEQ}{xrightleftharpoons}
  }
  {}

% 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}}
  {}

% If we have t5enc.def, use it and its prerequisite definitions directly
% instead of loading t5.sty or dblaccent.sty, as these affect other
% things in the document.
\newif\ifVIET
\newcommand\VIET{\pkgname{vntex}}
\makeatletter
\def\DeclareTextDoubleCompositeCommand#1#2#3#4#5{
  \expandafter\def\csname\expandafter\string\csname
    #2\endcsname\string#1-\string#3-\string#4\endcsname{#5}
}
\catcode\z@=11\relax
\def\DeclareTextDoubleComposite#1#2#3#4#5{
  \def\reserved at a{\DeclareTextDoubleCompositeCommand#1{#2}{#3}{#4}}
  \bgroup
    \lccode\z@#5
    \lowercase{
  \egroup
    \reserved at a ^^@}
}
\catcode\z@=15\relax
\makeatother
\IfStyFileExists{t5}
  {\VIETtrue\input{t5enc.def}}
  {}

\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
   \savesymbol{U}
   \savesymbol{D}
   \savesymbol{T}
   \usepackage{semtrans}
   \restoresymbol{smtr}{U}
   \restoresymbol{smtr}{D}
   \restoresymbol{smtr}{T}
  }
  {}

\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}
  }
  {}

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

% 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 the accents package, use it (for an example in the section
% on constructing new symbols).
\newif\ifACCENTS
\IfStyFileExists{accents}
  {\ACCENTStrue
   \savesymbol{undertilde}
   \usepackage{accents}
   \restoresymbol{ACCENTS}{undertilde}
  }
  {}

% 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]{}}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 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{zapfchan}
  {\newcommand{\mathpzc}[1]{\mbox{\usefont{OT1}{pzc}{m}{it} ##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}}     % 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 at arg{#1}%
    \ifx\first at 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 at arg{#1}%
    \ifx\first at 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 at 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 black 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

% Define \blackacc to display an accented box, given an accent command.
% Define \blackacchack to display and 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{\rule[-\adp]{\awd}{\aht}}}
\gdef\blackacc#1{#1{\rule[-\adp]{\awd}{\aht}}}
\gdef\blackacctwo#1{#1{\rule[-\adp]{\awd}{\aht}}{\rule[-\adp]{\awd}{\aht}}}

% 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\Jiv#1#2{\incsyms\indexcommand{#1}{\fontencoding{T4}\selectfont#1#2} &
  \ttfamily\string#1\string{#2\string}}
\makeatletter
  \def\K at opt@arg[#1]#2{\incsyms\indexcommand[#1]{#2}#1 &\ttfamily\string#2}
  \def\K at no@opt at arg#1{\incsyms\indexcommand[#1]{#1}#1 &\ttfamily\string#1}
  \def\K{\@ifnextchar[{\K at opt@arg}{\K at no@opt at arg}}
\makeatother
\def\Ka#1{\incsyms\indexcommand[\string{\string\ascii\string#1\string}]{#1}{\ascii#1} &\ttfamily\string#1}
\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}
\makeatletter
  \def\N at opt@arg[#1]#2{\incsyms\indexcommand[$\string#1$]{#2}$#1$ & $\Big#1$ &\ttfamily\string#2}
  \def\N at no@opt at arg#1{\incsyms\indexcommand[$\string#1$]{#1}$#1$ & $\Big#1$ &\ttfamily\string#1}
  \def\N{\@ifnextchar[{\N at opt@arg}{\N at no@opt at 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 at opt@args[#1]{\@ifnextchar[{\Np at two@opt at args[#1]}{\Np at one@opt at arg[#1]}}
  \def\Np at two@opt at args[#1][#2]#3{\incsyms\index{_=\string#2{} ($\string#1$)}$#1$ & $\Big#1$ &\ttfamily\string#3}
  \def\Np at one@opt at arg[#1]#2{\incsyms\indexpunct[$\string#1$]{#2}$#1$ & $\Big#1$ &\ttfamily\string#2}
  \def\Np at no@opt at args#1{\incsyms\indexpunct[$\string#1$]{#1}$#1$ & $\Big#1$ &\ttfamily\string#1}
  \def\Np{\@ifnextchar[{\Np at opt@args}{\Np at no@opt at args}}
\makeatother
\def\Mt#1{\incsyms\indexcommand[\string\metra\string#1]{#1}\metra#1 &\ttfamily\string#1}
\makeatletter
  \def\Q at 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 at no@opt at 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 at opt@arg}{\Q at no@opt at 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 at opt@arg[#1]#2{\incsyms\indexcommand[$\string#1$]{#2}$#1$ & $\displaystyle#1$ &\ttfamily\string#2}
  \def\R at no@opt at arg#1{\incsyms\indexcommand[$\string#1$]{#1}$#1$ & $\displaystyle#1$ &\ttfamily\string#1}
  \def\R{\@ifnextchar[{\R at opt@arg}{\R at no@opt at 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 at opt@arg[#1]#2#3{%
    \incsyms\indexaccent[$\string\blackacc{\string#1}$]{#2}%
    $#1{#3}$ &\ttfamily\string#2\string{#3\string}}
  \def\W at no@opt at arg#1#2{%
    \incsyms\indexaccent[$\string\blackacc{\string#1}$]{#1}%
    $#1{#2}$ &\ttfamily\string#1\string{#2\string}}
  \def\W{\@ifnextchar[{\W at opt@arg}{\W at no@opt at 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 at opt@arg[#1]#2{\incsyms\indexcommand[$\string#1$]{#2}$#1$ &\ttfamily\string#2}
  \def\X at no@opt at arg#1{\incsyms\indexcommand[$\string#1$]{#1}$#1$ &\ttfamily\string#1}
  \def\X{\@ifnextchar[{\X at opt@arg}{\X at no@opt at 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 at arg{#1}%
  \ifx\first at 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 at mathfonts
                              \fontsize\sf at size\z@
                              \math at 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 a couple of 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}
}


% 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 at 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 at edef\@currentlabel{\thetable}%
    \addcontentsline{toc}{subsubsection}{%
      \protect\numberline{\tablename~\thetable:}{#2}}%
    \@makecaption{\fnum at table}{#2}\medskip
    \let\next=\relax
  \else
    % The following was taken verbatim from verbatim.sty.
    \let\do\@makeother\dospecials\catcode`\^^M\active
    \let\verbatim at startline\relax
    \let\verbatim at addtoline\@gobble
    \let\verbatim at processline\relax
    \let\verbatim at 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 at edef\@currentlabel{\thetable}%
    \addcontentsline{toc}{subsubsection}{%
      \protect\numberline{\tablename~\thetable:}{#2}}%
    \@makecaption{\fnum at table}{#2}%
    \def\lt at indexed{}%
    \let\next=\relax
  \else
    % The following was taken verbatim from verbatim.sty.
    \let\do\@makeother\dospecials\catcode`\^^M\active
    \let\verbatim at startline\relax
    \let\verbatim at addtoline\@gobble
    \let\verbatim at processline\relax
    \let\verbatim at finish\relax
    \let\next=\verbatim@
  \fi
  \next
}{%
  \ifshowsymtable
    \let\@elt=\index\lt at indexed  % Close our index ranges.
    \end{center}
    \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 at 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 at 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
  \DeclareGraphicsExtensions{.png,.pdf,.jpg,.mps,.tif,.eps}
  \DeclareGraphicsRule{.eps}{mps}{*}{}
\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}

\paragraph{Build characteristics}
Table~\vref{doc-characteristics} lists some of this document's build
characteristics.  Most important is the list of packages that \latex{}
couldn't find, but that \selftex otherwise would have been able to
take advantage of.  Complete, prebuilt versions of this document are
available from CTAN\idxCTAN{} (\url{http://www.ctan.org/} or one of
its many mirror sites) in the directory
\texttt{tex-archive/info/symbols/comprehensive}.
Table~\ref{package-dates} shows the package date (specified in the
\verb|.sty|~file with \cmd{\ProvidesPackage}) for each package that
was used to build this document and that specifies a package date.
Packages are not listed in any particular order in either
Table~\ref{doc-characteristics} or~\ref{package-dates}.

\begin{nonsymtable}{Document Characteristics}
\label{doc-characteristics}
\begin{tabular}{@{}lp{0.5\textwidth}@{}} \toprule
Characteristic      & Value \\ \midrule
Source file:        & \selftex \\
Build date:         & \today \\
Symbols documented: & \approxcount\prevtotalsymbols \\
Packages included:  & \makeatletter
                        \def\@elt#1{\pkgname{#1}\xspace}
                        \foundpkgs
                      \makeatother \\
Packages omitted:   & \makeatletter
                        \ifcomplete
                          \emph{none}
                        \else
                          \def\@elt#1{\pkgname{#1}\xspace}
                          \missingpkgs
                        \fi
                      \makeatother \\
\bottomrule
\end{tabular}
\end{nonsymtable}


% Automatically generate a table of package version numbers.
\makeatletter
\begingroup
  % Given a package name, output the package's date.
  \def\show at package@date#1/#2/#3#4#5!!!{#1/#2/#3#4}
  \newcommand{\showpackagedate}[1]{%
    \edef\package at date@string{\csname ver@#1.sty\endcsname}%
    \expandafter\show at package@date\package at date@string!!!
  }

  % Format a metavariable.
  \def\meta#1{\textlangle{\textit{#1}}\textrangle}

  % Produce the entire table body as a token list.
  \newtoks\pkg at date@toks
  \def\@elt#1{%
    \expandafter\ifx\csname ver@#1.sty\endcsname\relax
    \else
      \expandafter\ifx\csname ver@#1.sty\endcsname\@empty
      \else
        \pkgname{#1} & \showpackagedate{#1} \\
      \fi
    \fi
  }
  \expandafter\pkg at date@toks\expandafter=\expandafter{\foundpkgs}

  % Output a formatted table which contains the previously defined token list.
  \begin{nonsymtable}{Package versions used in the preparation of this document}
  \label{package-dates}
  \begin{tabular}{@{}ll@{}}
    \toprule
    Name & Date \\
    \midrule
    \the\pkg at date@toks
    \bottomrule
  \end{tabular}
  \end{nonsymtable}
\endgroup

\end{document}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: MYSYMBLS.dvi
Type: application/octet-stream
Size: 2768 bytes
Desc: not available
Url : http://tug.org/pipermail/texhax/attachments/20061031/096c25a8/attachment-0001.obj 


More information about the texhax mailing list