\def\web{http://drorbn.net/AcademicPensieve/Projects/PPSA/PPSA-170103}

\def\bbQ{{\mathbb Q}}
\def\frakb{{\mathfrak b}}
\def\frakg{{\mathfrak g}}
\def\frakh{{\mathfrak h}}
\def\frakn{{\mathfrak n}}

\def\draftcut{\if\draft y \cleardoublepage \fi}
%\def\draftcut{\cleardoublepage}

\definecolor{lightred}{RGB}{255, 217, 217}
\def\lightred#1{\setlength{\fboxsep}{0pt}\colorbox{lightred}{#1}}
\def\gray{\color{gray}}
\def\yellowm#1{{\setlength{\fboxsep}{0pt}\colorbox{yellow}{$#1$}}}
\def\yellowt#1{{\setlength{\fboxsep}{0pt}\colorbox{yellow}{#1}}}

% Following
% http://tex.stackexchange.com/questions/23521/tabular-vertical-alignment-to-top
\def\imagetop#1{\vtop{\null\hbox{#1}}}

\def\face{\input{figs/face.pdf_t}}
\def\human{\input{figs/human.pdf_t}}
\def\machine{\input{figs/machine.pdf_t}}
\def\shortmathinclude#1{{%
  \newline\vspace{0mm}
  {\imagetop{\face}\
  \imagetop{\includegraphics[scale=0.16]{Snips/#1.pdf}}}
  \newline\vskip 1mm
}}
\def\mathinclude#1{{\label{C:#1}%
  \newline\vspace{0mm}
  {\imagetop{\human}\
  \imagetop{\includegraphics[scale=0.16]{Snips/#1.pdf}}}
  \newline\vskip 1mm
}}
\def\shortdialoginclude#1{{\label{C:#1}%
  \noindent
  \imagetop{\face}\
\imagetop{\includegraphics[scale=0.16]{Snips/Human-#1.pdf}}
  \newline
  \vskip 1mm\noindent
  \imagetop{\machine}\
\imagetop{\includegraphics[scale=0.16]{Snips/Machine-#1.pdf}}
  \newline
}}
\def\shortdialogincludewithlink#1{{\label{C:#1}%
  \noindent
  \imagetop{\face}\
\imagetop{\includegraphics[scale=0.16]{Snips/Human-#1.pdf}}
  \newline
  \vskip 1mm\noindent
  \imagetop{\machine}\
\imagetop{\includegraphics[scale=0.16]{Snips/Machine-#1.pdf}}
  \hfill\parbox[t]{1in}{
    \rightline{Fuller output:}
    \rightline{\citeweb{#1.nb}}
  }
  \newline
}}
\def\dialoginclude#1{{\label{C:#1}%
  \noindent
  \imagetop{\human}\
\imagetop{\includegraphics[scale=0.16]{Snips/Human-#1.pdf}}
  \newline
  \vskip 1mm\noindent
  \imagetop{\machine}\
\imagetop{\includegraphics[scale=0.16]{Snips/Machine-#1.pdf}}
  \newline
}}
\def\dialogincludewithlink#1{{\label{C:#1}%
  \noindent
  \imagetop{\human}\
\imagetop{\includegraphics[scale=0.16]{Snips/Human-#1.pdf}}
  \newline
  \vskip 1mm\noindent
  \imagetop{\machine}\
\imagetop{\includegraphics[scale=0.16]{Snips/Machine-#1.pdf}}
  \hfill\hspace{-1in}\parbox[t]{1in}{
    \rightline{Fuller output:}
    \rightline{\citeweb{#1.nb}}
  }
  \newline
}}

\def\ds{\displaystyle}

\def\glosm#1#2{{\label{g:#1}\yellowm{#2}}}
\def\glosi#1#2#3{{\item[{#2}] #3~\hfill\pageref{g:#1}}}
