% LATEX_CRIBSHEET.TEX -- The LaTeX Command Summary
%
% This file is the driver.  The main body (the list of commands) is in
% crib___.tex, where ___ is the LaTeX version number sans period.  There
% are two different files for the tables at the end.  These set the tables
% with or without the extra AMS symbols.  The proper stuff is arranged so
% all you do is toggle the boolean \amsmath.  Note that if you want to use
% the AMS symbols, the definitions are collected from amsmath.sty, so that
% has to be in TeX's search path.  Also, obviously, you have to have the
% AMS fonts.
%
% C. D. Biemesderfer, STScI, 9 Nov 87
%     16 Mar 90, make strlen(filenames) <= 8 for DOS

\documentstyle[twoside,twocolumn]{article}

\includeonly{crib209,cribtab,cribams}

% The AMS math symbols can be added if desired

\newif\ifamsmath
\amsmathfalse	% include AMS math information

\ifamsmath\input amsmath.sty\fi

% The cribsheet can be printed at 8 points for people with good eyes

\newif\ifsmallcrib
%\smallcribtrue	% 8 point cribsheet

% Fix \LaTeX macro so logo is in current font, not always \rm

\newcount\lecurrentfam
\def\LaTeX{\lecurrentfam=\the\fam \leavevmode L\raise.42ex
	\hbox{$\fam\lecurrentfam\scriptstyle\kern-.3em A$}\kern-.15em\TeX}

% Fix \@caption macro so that current font is used, not always \normalsize

\makeatletter
\long\def\@caption#1[#2]#3{\addcontentsline{\csname
  ext@#1\endcsname}{#1}{\protect\numberline{\csname
  the#1\endcsname}{\ignorespaces #2}}\par
  \begingroup
    \@parboxrestore
%    \normalsize
    \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par
  \endgroup}

% Twiddle \@makecaption macro so that caption is flushleft and \bf

\long\def\@makecaption#1#2{
   \setbox\@tempboxa\hbox{\bf #2}
   \ifdim \wd\@tempboxa >\hsize   % IF longer than one line:
       \unhbox\@tempboxa\par      %   THEN set as ordinary paragraph.
     \else                        %   ELSE flushleft
       \hbox to\hsize{\box\@tempboxa\hfil}
   \fi}
\makeatother

% Here are the absolute dimensions for the cribsheet

\topmargin 0in
\oddsidemargin 0in
\evensidemargin 0in
\marginparwidth 0in
\textheight 9.2in
\textwidth 6.5in
\ifsmallcrib \columnwidth 3in \columnsep .4in
  \else \columnwidth 2.85in \columnsep .7in \fi

% All the other dimensions are font-dependent

\parskip .75ex plus .3ex minus .3ex

\pagestyle{myheadings}
\markboth{\LaTeX{} Command Summary}{\today}

\begin{document}

\include{crib209}

\ifamsmath
  \include{cribams}
\else
  \include{cribtab}
\fi

\end{document}
