% ~/p/tex/wrf.tex  My Standard macros and definitions.
% Time-stamp: </home/wrf/p/tex/wrf.tex, Wed,  2 Sep 1998, 04:42:42 IDT, wrf@speed.ecse.rpi.edu>

%%%%% INTRO

% How to use:
% 1. ln -s /home/wrf/p/tex/wrf.tex, or set TEXINPUTS to include ~/p/tex.
% 2. In tex file: \input{wrf}

% Summary of figure commands:
% \figgz{file}{title}{width=6in e.g.} reads file.ps.gz
% \figsz{file1}{legend1}{size command1}%
%		      {file2}{legend2}{size cmd2}{minipage size}
% \figga{file}{title}{width=6in eg}    reads file.ps
% \figha{file}{title}    width=2.9in
% \figsa: Two side-by-side figs.
% \figsa{file1}{legend1}{size command1}{file2}{legend2}{size cmd2}
% There are different versions of figsa around.
% \figsaa{file1}{legend1}{size command1}%
%	     {file2}{legend2}{size cmd2}{minipage size}
% There are different versions of figsaa around.
% figta: Two figs, one above the other.
% \figta{file1}{legend1}{size command1}{file2}{legend2}{size cmd2}


%* Simple Commands

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%% SIMPLE COMMANDS
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Don't use these; use keyboard macros instead.

% \newcommand{\bi}{\begin{itemize}}
% \newcommand{\ei}{\end{itemize}}
% \newcommand{\be}{\begin{enumerate}}
% \newcommand{\ee}{\end{enumerate}}
% \bezier already in use
% \xspace requires xspace package
\newcommand{\bezierr}{B{\'e}zier\xspace}
% Use vref for pref
%\newcommand{\pref}[1]{\ref{#1} 
%\begin{latexonly}
%on page \pageref{#1}
%\end{latexonly}
%}
% note already defined?
%\newtheorem{note}{Note}
% The rotate package has a degrees command.  I dunno its meaning,
% so probably don't use my degrees with rotate.
\providecommand{\degrees}{{}^{\circ}}  % degrees symbol
% \newcommand{\degrees}{${}^\circ$}

% TE: To format a table entry as a para.
% \newcommand{\te}[1]{\begin{minipage}[t]{3.5in}#1\end{minipage}}


% vref not defined in latex2html

\providecommand{\vref}[1]{\ref{#1}}
\newcommand{\vrefwrf}[1]{\ref{#1}}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%% HYPHENATION
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\hyphenation{Ran-dolph Frank-lin Mohan Kan-kan-halli Chand-ra-se-khar
Nar-ay-an-a-swami} 


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%% FIGURE MACROS
%%%%%% INTRO
%
% figg: 5" wide figure with legend and reference in form  f:<filename>
%	Usage:  \figg{file}{legend}
% figh: 2.9" wide figure with legend and reference in form  f:<filename>
%	Usage:  \figh{file}{legend}
% figa: Figure with legend and reference.  This macro does not change the
% 	figure's size, however the caller may include size commands before this
% 	macro.   Usage: \figa{file}{legend}
% figp: 5" wide figure with legend and reference, on a separate page.
%	Usage:  \figp{file}{legend}
% figc:  Clipped figure with legend and reference.  Under construction.
% 	 Usage:  \figc{file}{legend}
% figt: Two figures on the same page with specified size, legend, and references.
%       Usage:  \figt{size command1}{file1}{legend1}{size cmd2}{file2}{legend2}
% figs: Two 2.9" side-by-side figures in Latex; 2 independent figures
% 	in html.  Do legend, and define references in form  f:<filename>
% 	usage:  \figs{file}{legend}{file}{legend}
%
% fig?a: Like fig? but using epsfig, not epsf.


% figg: 5" wide figure with legend and reference in form  f:<filename>
%	usage:  \figg{file}{legend}
 
%%%%%% FIGG
\newcommand{\figg}[2]{	
   \begin{figure}[htb]
   \begin{center}	
   \leavevmode % w/o this get a latex error	
   \epsfxsize=5in
   \epsffile{#1.ps}	
   \caption{#2}	
   \label{f:#1}	
   \end{center}	
   \end{figure}	
}

 
%%%%%% FIGH
% figh: 2.9" wide figure with legend and reference in form  f:<filename>
%	usage:  \figh{file}{legend}

\newcommand{\figh}[2]{	
   \begin{figure}[htb]
   \begin{center}	
   \leavevmode % w/o this get a latex error	
   \epsfxsize=2.9in
   \epsffile{#1.ps}	
   \caption{#2}	
   \label{f:#1}	
   \end{center}	
   \end{figure}	
}

 
%%%%%% FIGA
% figa: Figure with legend and reference.  This macro does not change the
% 	figure's size, however the caller may include size commands before this
% 	macro.  % Usage: \figa{file}{legend}

\newcommand{\figa}[2]{	
   \begin{figure}[htb] \begin{center} \leavevmode % w/o this get a latex error
   \epsffile{#1.ps} \caption{#2} \label{f:#1} \end{center} \end{figure} }

 
%%%%%% FIGP
% figp: 5" wide figure with legend and reference, on a separate page.
%	Usage:  \figp{file}{legend}

\newcommand{\figp}[2]{	
   \begin{figure}[p]	
   \begin{center}	
   \leavevmode % w/o this get a latex error	
   \epsfxsize=5in
   \epsffile{#1.ps}	
   \caption{#2}	
   \label{f:#1}	
   \end{center}	
   \end{figure}	
}
 
%%%%%% FIGC
% figc:  Clipped figure with legend and reference.  Under construction.
% 	 Usage:  \figc{file}{legend}

\newcommand{\figc}[2]{	
   \begin{figure}[htb]	
   \begin{center}	
   \leavevmode % w/o this get a latex error	
   \epsffile{#1.ps}	
   \caption{#2}	
   \label{f:#1}	
   \end{center}	
   \end{figure}	
}
 
%%%%%% FIGT
% figt: Two figures on the same page with specified size, legend, and references.
%       Usage:  \figt{size command1}{file1}{legend1}{size cmd2}{file2}{legend2}

\newcommand{\figt}[6]{
   \begin{figure}[p]

   \begin{center}
   \leavevmode % w/o this get a latex error
   #1
   \epsffile{#2.ps}
   \caption{#3}
   \label{f:#2}
   \   \\[.2in]\ 
   \leavevmode % w/o this get a latex error
   #4
   \epsffile{#5.ps}
   \caption{#6}
   \label{f:#5}

   \end{center}
   \end{figure}
}
 
%%%%%% FIGS
% figs: Two 2.9" side-by-side figures in Latex; 2 independent figures
% 	in html.  Do legend, and define references in form  f:<filename>
% 	usage:  \figs{file}{legend}{file}{legend}

\newcommand{\figs}[4]{
  \begin{latexonly}
   \begin{figure}[htbp]
      \begin{minipage}[b]{3in}
	 \epsfxsize=2.9in
	 \epsffile{#1.ps}
	 \refstepcounter{figure}
	 \addcontentsline{lof}{figure}{\protect\numberline{\thefigure}{\ignorespaces
	 #2}}
	 % Doesn't work in a box in a figure:    \caption{#2}
	 \label{f:#1}
	 Figure \thefigure: #2
	 \end{minipage}
	\hspace{.2in}
% Trying to leave a space.  Failing.
%      \begin{minipage}[b][0.15in]
%	 \ %
%         \end{minipage}
      \begin{minipage}[b]{3in}
	 \epsfxsize=2.9in
	 \epsffile{#3.ps}
	 \refstepcounter{figure}
	 \addcontentsline{lof}{figure}{\protect\numberline{\thefigure}{\ignorespaces
	 #4}}
	 % Doesn't work in a box in a figure:    \caption{#2}
	 \label{f:#3}
	 Figure \thefigure: #4
         \end{minipage}
   \end{figure}
  \end{latexonly}
% Does not work!  Gives Runaway argument
% Must do this manually in calling file.
%  \begin{htmlonly}
%     { \figg{#1}{#2} }
%     { \figg{#3}{#4} }
%  \end{htmlonly}
}
 
%%%%%% FIG EPSFIG ROUTINES -INTRO
%%%%%% FIGGA
\newcommand{\figga}[3]{	
   \begin{figure}[!htbp]
   \begin{center}	
   \leavevmode % w/o this get a latex error	
   \epsfig{file=#1.ps,#3}	
   \caption{#2}	
   \label{f:#1}	
   \end{center}	
   \end{figure}	
}
 
%%%%%% FIGGZ
\newcommand{\figgz}[3]{	
   \begin{figure}[!htbp]
   \begin{center}	
   \leavevmode % w/o this get a latex error	
   \includegraphics[#3]{#1.ps.gz}	
   \caption{#2}	
   \label{f:#1}	
   \end{center}	
   \end{figure}	
}
 
%%%%%% FIGSZ
% figsz: Two side-by-side figures on the same page, in minipages
% of specified width, with specified size, legend, and references.
% Reads compressed PS files, with implicit extensions .ps.gz ,
% which must come with .bb files.
%
%       Usage:  \figsz{file1}{legend1}{size command1}%
%		      {file2}{legend2}{size cmd2}{minipage size}


\newcommand{\figsz}[7]{
   \begin{figure}[!htbp] \begin{minipage}[t]{#7}
   \includegraphics[#3]{#1.ps.gz}
   \refstepcounter{figure}
   \addcontentsline{lof}{figure}{\protect\numberline{\thefigure}{\ignorespaces
   #2}} % Doesn't work in a box in a figure: \caption{#2}
   \label{f:#1} \\ 
   {Figure \thefigure:} #2\\ \end{minipage}
% Trying to leave a space.  Failing.
%      \begin{minipage}[b][0.15in]
%	 \ %
%         \end{minipage}
      \begin{minipage}[t]{#7}
	 \includegraphics[#6]{#4.ps.gz}
	 \refstepcounter{figure}
	 \addcontentsline{lof}{figure}{\protect\numberline{\thefigure}{\ignorespaces
	 #5}}
	 % Doesn't work in a box in a figure:    \caption{#2}
	 \label{f:#4} \\
	 {Figure \thefigure:} #5
         \end{minipage}
   \end{figure}
}
 
%%%%%% FIGHA
\newcommand{\figha}[2]{	
   \begin{figure}[!htbp]
   \begin{center}	
   \leavevmode % w/o this get a latex error	
   \epsfig{file=#1.ps,width=2.9in}	
   \caption{#2}	
   \label{f:#1}	
   \end{center}	
   \end{figure}	
}
 
%%%%%% FIGSA
% figsa: Two side-by-side figures on the same page, with
% specified size, legend, and references.
%       Usage:  \figsa{file1}{legend1}{size command1}{file2}{legend2}{size cmd2}
% Modified for SSD compress paper 5/95.

\newcommand{\figsa}[6]{
   \begin{figure}[!htbp]
      \begin{minipage}[t]{2.3in}
	 \epsfig{file=#1.ps,#3}
	 \refstepcounter{figure}
	 \addcontentsline{lof}{figure}{\protect\numberline{\thefigure}{\ignorespaces
	 #2}}
	 % Doesn't work in a box in a figure:    \caption{#2}
	 \label{f:#1} \\
	 \textbf{Fig. \thefigure.} #2
	 \end{minipage}
% Trying to leave a space.  Failing.
%      \begin{minipage}[b][0.15in]
%	 \ %
%         \end{minipage}
      \begin{minipage}[t]{2.3in}
	 \epsfig{file=#4.ps,#6}
	 \refstepcounter{figure}
	 \addcontentsline{lof}{figure}{\protect\numberline{\thefigure}{\ignorespaces
	 #5}}
	 % Doesn't work in a box in a figure:    \caption{#2}
	 \label{f:#4} \\
	 \textbf{Fig. \thefigure.} #5
         \end{minipage}
   \end{figure}
}
 
%%%%%% FIGSAA
% figsaa: Two side-by-side figures on the same page, in minipages
% of specified width, with
% specified size, legend, and references.
%       Usage:  \figsa{file1}{legend1}{size command1}%
%		      {file2}{legend2}{size cmd2}{minipage size}
% Modified for SSD compress paper 5/95.

\newcommand{\figsaa}[7]{
   \begin{figure}[!htbp]
      \begin{minipage}[t]{#7}
	 \epsfig{file=#1.ps,#3}
	 \refstepcounter{figure}
	 \addcontentsline{lof}{figure}{\protect\numberline{\thefigure}{\ignorespaces
	 #2}}
	 % Doesn't work in a box in a figure:    \caption{#2}
	 \label{f:#1} \\
	 \textbf{Fig. \thefigure.} #2\\
	 \end{minipage}
% Trying to leave a space.  Failing.
%      \begin{minipage}[b][0.15in]
%	 \ %
%         \end{minipage}
      \begin{minipage}[t]{#7}
	 \epsfig{file=#4.ps,#6}
	 \refstepcounter{figure}
	 \addcontentsline{lof}{figure}{\protect\numberline{\thefigure}{\ignorespaces
	 #5}}
	 % Doesn't work in a box in a figure:    \caption{#2}
	 \label{f:#4} \\
	 \textbf{Fig. \thefigure.} #5
         \end{minipage}
   \end{figure}
}
 
%%%%%% FIGTA
% figta: Two figures on the same page, one above the other, with
% specified size, legend, and references.
%       Usage:  \figta{file1}{legend1}{size command1}{file2}{legend2}{size cmd2}

\newcommand{\figta}[6]{
   \begin{figure}[p]

   \begin{center}
   \leavevmode % w/o this get a latex error
   \epsfig{file=#1.ps,#3}
   \caption{#2}
   \label{f:#1}
   \   \\[.2in]\ 
   \leavevmode % w/o this get a latex error
   #4
   \epsfig{file=#4.ps,#6}
   \caption{#5}
   \label{f:#4}

   \end{center}
   \end{figure}
}

 
%%%%%% FIGCODE
% FIGCODE{file,caption}:  Include a ground file as a boxed, shaded, figure.

\newcommand{\figcode}[2]{
   \begin{figure}[!htbp]
   \begin{center}	
   \leavevmode % w/o this get a latex error	
   \begin{boxitpara}{rectcartouche}
   \lgrindfile{#1}
   \end{boxitpara}
   \caption{#2}	
   \label{f:#1}	
   \end{center}	
   \end{figure}	
}
 
%%%%%% Make the included program be in normal, not small, type.

\def\LGsize{} % Override
\def\LGfsize{} % Override


 
%%%%%% FIGLIST
% FIGLIST{file}  Include a listing file as a boxed, shaded, figure.

\newcommand{\figlist}[1]{
   \begin{figure}[!htbp]
   \begin{center}	
   \leavevmode % w/o this get a latex error	
   \begin{boxitpara}{rectcartouche}
   \listinginput{1}{#1}
   \end{boxitpara}
   \caption{#1}	
   \label{f:#1}	
   \end{center}	
   \end{figure}	
}
 
%%%%% OTHER MACROS
%%%%%% LGRINDA
%
% lgrinda{foo}  lgrindfile mod for html.
%	If in Latex, do lgrindfile{foo.tex}
%	If in html, do 
%     		<MENU>
%     		<LI> <A HREF="http://www.rpi.edu/dept/ecse/graphics/foo.c">foo.c</A>
%     		</MENU>

%\newcommand{\lgrinda}[1]{
%   \begin{latexonly}
%      \lgrindfile{#1.tex}
%   \end{latexonly}
% Uncommenting this, even just the begin and end, causes a runaway arg error?!
% Ditto with htmlonly
%\begin{rawhtml}
%<MENU>
%<LI> HREF="http://www.rpi.edu/dept/ecse/graphics/#1.c">#1.c</A>
%</MENU>
%\end{rawhtml}
%}
 
%%%%%% PRINT CURRENT TIME OF DAY.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% from The Latex Companion, p 469.

\newcounter{hours}\newcounter{minutes}
\newcommand{\printtime}{%
\setcounter{hours}{\time/60}%
\setcounter{minutes}{\time-\value{hours}*60}%
\thehours:\theminutes}

   
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%% HTMLL
% htmll:  List a URL in latex, and make it a link, in html.
\newcommand{\htmll}[1]{\htmlref{\texttt{#1}}{#1}}

% Replacement for center.

% \begin{htmlonly}
% \renewenvironment{center}{\par}{\par}
% \renewcommand{\listinginput}[3][1]{\htmlref{#3}{/dept/ecse/graphics/#3}
% \renewcommand{\texttt}[1]{\begin{rawhtml}<tt>\end{rawhtml}#1\begin{rawhtml}</tt>\end{rawhtml}}
% \renewcommand{\emph}[1]{\begin{rawhtml}<em>\end{rawhtml}#1\begin{rawhtml}</em>\end{rawhtml}}
% \end{htmlonly}
%%%%%% hyphenated pathname
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% From comp.text.tex #69657
% From: eeide@jaguar.cs.utah.edu (Eric Eide)
% [1] Re: How do I force hyphenation in \tt? (Not in FAQ)
% Date: Thu Mar 30 11:27:21 EST 1995
%%
%% `\filename' is the command for typesetting UNIX pathnames.  The argument to
%% `\filename' is set in the typewriter font.  TeX may insert a line break
%% after a slash, except after the initial slash of an absolute pathname.
%% Within the argument to `\filename':
%%
%%   `\-' inserts a discretionary hyphen.  That discretionary hyphen, if
%%   needed, will be set in the Roman font.
%%
%%   `\nb/' inserts a `/' character but prevents TeX from inserting a line
%%   break immediately after that character.  (The initial `/' of an absolute
%%   pathname is automatically turned into `\nb/'.)
%%
%% NOTE that `\filename' is fragile, which means that it must be `\protect'ed
%% when used in a caption or other moving argument.
%%
%% How and why this macro works:
%%
%%   + First, it switches to the typewriter font and also into a new language,
%%     `\nohyphens'.  This new language has no rules for automatic hyphenation,
%%     so all automatic (English-based) hyphenation within a file name is
%%     suppressed.
%%
%%   + Next, the current hyphenation character of the typewriter font is saved,
%%     and then the hyphenation character is set to `/'.  (By the way, the
%%     usual hyphenation character of the typewriter font is -1 --- an illegal
%%     ASCII character value --- which normally prevents TeX from hyphenating
%%     typewriter font text.)
%%
%%   + The `\-' and `\nb' macros are defined.  Note that `\nb' is a *delimited*
%%     macro.  This means that the arguments to `\nb' are delimited by special
%%     characters: in this case, `/'.  The `\nb' macro takes zero arguments; a
%%     `/' marks the end of this null argument list.  The `/' delimiter is
%%     consumed when the `\nb' macro is read.
%%
%%     The expansion of the `\nb' macro produces an `\mbox'ed `/'.  The box
%%     prevents TeX from breaking the line (i.e., hyphenating) after the output
%%     `/'.
%%
%%   + Now that the macros are defined, we look at the first character of the
%%     file name.  If it is `/' then we output `\nb' --- thus making the
%%     initial `/' of the filename become the delimiter that marks the end of
%%     the `\nb' macro call.  (`\nb' then outputs a boxed `/'.)  If the file
%%     name is not an absolute pathname, however, then no extra text is output.
%%
%%   + Finally, the file name is output (#1) and the hyphen character of the
%%     typewriter font is restored to its previous value.
%%
%% Note that the {}'s around `{\def\-...#1}' prevent the expansion of #1 from
%% changing the value of `\@tempcnta'.
%%
%% The current definition of the `\filename' command is entirely due to Donald
%% Arseneau <asnd@erich.triumf.ca>.  I originally wrote a `\filename' macro in
%% September 1993 for use in GradSAC's packet of information for new graduate
%% students.  In January 1995, after an email conversation with Mr. Arseneau, I
%% completely reimplemented the `\filename' command.  My original version
%% relied on changing catcodes (in order to define a command named `/'), which
%% made it impossible to use `\filename' within arguments to other commands,
%% such as figure captions.  Mr. Arseneau explained how I could get the results
%% I wanted simply by fiddling with the typewriter font hyphen characters in
%% the proper way.  He also devised the clever `\nb' delimited macro trick.
%%
%% I named this 'pathname' not 'filename' - WRFn

\makeatletter

\newlanguage\nohyphens

\newcommand{\pathname}[1]{{\tt \language\nohyphens
  \@tempcnta=\hyphenchar\font \hyphenchar\font=`/
  {\def\-{\discretionary{\rm-}{}{}}\def\nb/{\mbox{/}}%
   \@ifnextchar/{\nb}{}#1}%
  \hyphenchar\font=\@tempcnta}}

\makeatother

%%
%% `\lisp' is the command for typesetting Lisp expressions.  The argument to
%% `\lisp' is set in the typewriter font.  TeX may insert a line break after an
%% explicit hyphen.  Within the argument to `\lisp',
%%
%%   `\-' inserts a discretionary hyphen.  That discretionary hyphen, if
%%   needed, will be set in the Roman font.
%%
%% NOTE that `\lisp' is fragile, which means that it must be `\protect'ed when
%% used in a caption or other moving argument.
%%
%% Note that the `\lisp' command is very much like the `\filename' command
%% defined above.  I actually wrote `\lisp' first, in March 1993, for use in
%% the Cassini documentation.  The current definition of `\lisp', however, is
%% due entirely to Donald Arseneau.  In January 1995 he rewrote both my `\lisp'
%% and `\filename' commands as described previously in the comments for the
%% `\filename' command.  Look there for an explanation of the current `\lisp'
%% definition.
%%

\makeatletter

\newcommand{\lisp}[1]{{\tt \language\nohyphens
  \@tempcnta=\hyphenchar\font \hyphenchar\font=`-
  {\def\-{\discretionary{\rm-}{}{}}#1}%
  \hyphenchar\font=\@tempcnta}}

\makeatother


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%% Stuff used in COLD
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%% ULINE{w}  Draw a line w inches wide in a shaded box .5in
%%%%%% hi; leave .05in blank above it. 
\newcommand{\uline}[1]{\mbox{\rule{0in}{.55in}\psboxit{5
cartouche}{\rule{#1in}{.01in}\rule{0in}{.5in}}}}
 
%%%%%% SHADE Shade the contents
\newcommand{\shade}[1]{\psboxit{5 cartouche}{#1}}
 
%%%%%% SHADEBOX Shade a box #1 inches wide by #2 inches hi.
\newcommand{\shadebox}[2]{\psboxit{5 cartouche}{\rule{0in}{#2in}\rule{#1in}{0in}}}
 
%%%%%% CENTERT Center text
\newcommand{\centert}[1]{\begin{center}\texttt{#1}\end{center}}
%%%%% K-Map
%%%%%% KMAPIII
% \KMAPIII{Outvar}{invarleft}{invartopleft}{invartopright}

\newcommand{\kmapiii}[4]{
   {\Large
   \begin{tabular}{c|c|c|c|c|} 
   $#1$ &  $\overline{#3}\ \overline{#4}$\ \  & \uline{.5} &\uline{.5}   &\uline{.5}   \\ \hline
   $\overline{#2}$ &\uline{.5}&\uline{.5}&\uline{.5}&\uline{.5} \\ \hline
   \uline{.5}&\uline{.5}&\uline{.5}&\uline{.5}&\uline{.5}\\ \hline
   \end{tabular}

   \ \\
   $#1$= \uline{3}
   }
}
 
%%%%%% KMAPIV
% \KMAPIV{Outvar}{invarlefttop}{invarleftlow}{invartopleft}{invartopright}

\newcommand{\kmapiv}[5]{
\begin{center}
   {\Large
   \begin{tabular}{c|c|c|c|c|} 
   $#1$ &  $\overline{#4}\ \overline{#5}$\ \  & \uline{.5} &\uline{.5}   &\uline{.5}   \\ \hline
   $\overline{#2}\ \overline{#3}$ &\uline{.5}&\uline{.5}&\uline{.5}&\uline{.5} \\ \hline
   \uline{.5}&\uline{.5}&\uline{.5}&\uline{.5}&\uline{.5}\\ \hline
   \uline{.5}&\uline{.5}&\uline{.5}&\uline{.5}&\uline{.5}\\ \hline
   \uline{.5}&\uline{.5}&\uline{.5}&\uline{.5}&\uline{.5}\\ \hline
   \end{tabular}
   \ \\
   $#1$= \uline{3}
   }
\end{center}
}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% EXAM MACROS
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


% ITE{points}  Start a new question item, show the points it's
% worth, draw a box for the actual number, and keep a running count
% of the total.

\newcounter{points}
\setcounter{points}{0}

\newcommand{\ite}[1]{\addtocounter{points}{#1} %
\item \ovalbox{\hspace*{2em}\rule{0cm}{2em}}/{\tt [#1]\ }}





  
%%%%% Emacs file variables
%    Local Variables:
%    eval: (progn (outline-minor-mode) (setq outline-regexp "%%%%%+") (hide-lower-levels))
%    End:
