\def\weburl{http://drorbn.net/SL2PO}
\def\web#1{\href{\weburl/#1}{\begin{greek}web\end{greek}/#1}}

\theoremstyle{plain}
\newtheorem{theorem}{Theorem}[section]
\newtheorem{principle}[theorem]{Principle}
\newtheorem{axiom}[theorem]{Axiom}
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{defprop}[theorem]{Definition-Proposition}
\newtheorem{fact}[theorem]{Fact}
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{corollary}[theorem]{Corollary}
\newtheorem{claim}[theorem]{Claim}
\newtheorem{Truth}[theorem]{Truth}
\newtheorem{AlmostTruth}[theorem]{Almost Truth}
\newtheorem{conjecture}[theorem]{Conjecture}
\newtheorem{slogan}[theorem]{Slogan}

\theoremstyle{definition}
\newtheorem{context}[theorem]{Context}
\newtheorem{convention}[theorem]{Convention}
\newtheorem{definition}[theorem]{Definition}
\newtheorem{defwarn}[theorem]{Definition and Warning}
\newtheorem{figcap}[theorem]{Figure}
\newtheorem{image}[theorem]{Image}
\newtheorem{lemmadefinition}[theorem]{Lemma-Definition}
\newtheorem{problem}[theorem]{Problem}
\newtheorem{question}[theorem]{Question}
\newtheorem{solution}[theorem]{Solution}
\newtheorem{prize}[theorem]{Prize}

\newtheorem{comment}[theorem]{Comment}
\newtheorem{comments}[theorem]{Comments}
\newtheorem{discussion}[theorem]{Discussion}
\newtheorem{example}[theorem]{Example}
\newtheorem{exercise}[theorem]{Exercise}
\newtheorem{hint}[theorem]{Hint}
\newtheorem{interpretation}[theorem]{Interpretation}
\newtheorem{motivation}[theorem]{Motivation}
\newtheorem{note}[theorem]{Note}
\newtheorem{remark}[theorem]{Remark}
\newtheorem{warning}[theorem]{Warning}

\newcommand{\prtag}[1]{\tag*{\llap{$#1$\hskip-\displaywidth}}}

\newcommand{\mathmode}[1]{$#1$}
\newlength{\standardunitlength}
\setlength{\standardunitlength}{0.00083333in}

\newcommand{\eepic}[2]{
  \setlength{\unitlength}{#2\standardunitlength}
  \begin{array}{c}
    {\input #1.eepic } 
  \end{array}
}
\newcommand{\seepic}[2]{
  \setlength{\unitlength}{#2\standardunitlength}
  \begin{array}{c}  \hspace{-1.7mm}
    \raisebox{-2pt}{\input #1.eepic }
    \hspace{-1.9mm}
  \end{array}
}

\newcommand{\fig}[1]{figure~\ref{#1}}
\def\smily{{
  \setlength{\unitlength}{0.4\standardunitlength}
  \begin{array}{c}  \hspace{-1.7mm} \raisebox{-2pt}{
    \begin{picture}(616,629)(0,-10)
    \thicklines
    \put(308.000,344.500){\arc{375.000}{0.6435}{2.4981}}
    \put(308,307){\ellipse{600}{600}}
    \put(195,382){\blacken\ellipse{76}{76}}
    \put(195,382){\ellipse{76}{76}}
    \put(420,382){\blacken\ellipse{76}{76}}
    \put(420,382){\ellipse{76}{76}}
    \end{picture}
  }
  \hspace{-1.9mm}
  \end{array}
}}

\newcommand{\ad}{\operatorname{ad}}
\newcommand{\Ad}{\operatorname{Ad}}
\newcommand{\Alt}{\operatorname{Alt}}
\newcommand{\Aut}{\operatorname{Aut}}
\newcommand{\Diff}{\operatorname{Diff}}
\newcommand{\End}{\operatorname{End}}
\newcommand{\gr}{\operatorname{gr}}
\newcommand{\im}{\operatorname{im}}
\newcommand{\mor}{\operatorname{mor}}
\newcommand{\Span}{\operatorname{span}}
\newcommand{\sign}{\operatorname{sign}}
\newcommand{\sym}{\operatorname{sym}}
\newcommand{\tr}{\operatorname{tr}}
\newcommand{\wt}{\operatorname{wt}}

\def\qed{{\linebreak[1]\null\hfill\text{$\Box$}}}

\newlength{\globalparindent}
\setlength{\globalparindent}{\parindent}

%\newcommand{\udot}{{\mathaccent\cdot\cup}}

\def\arXiv#1{{\href{http://arXiv.org/abs/#1}{arXiv:\linebreak[0]#1}}}

\def\ba{{\mathbf a}}
\def\bp{{\mathbf p}}
\def\bx{{\mathbf x}}
\def\bbe{{\mathbb e}}
\def\bbA{{\mathbb A}}
\def\bbB{{\mathbb B}}
\def\bbC{{\mathbb C}}
\def\bbD{{\mathbb D}}
\def\bbE{{\mathbb E}}
\def\bbH{{\mathbb H}}
\def\bbN{{\mathbb N}}
\def\bbO{{\mathbb O}}
\def\bbQ{{\mathbb Q}}
\def\bbR{{\mathbb R}}
\def\bbV{{\mathbb V}}
\def\calB{{\mathcal B}}
\def\calD{{\mathcal D}}
\def\calE{{\mathcal E}}
\def\calF{{\mathcal F}}
\def\calG{{\mathcal G}}
\def\calK{{\mathcal K}}
\def\calL{{\mathcal L}}
\def\calM{{\mathcal M}}
\def\calP{{\mathcal P}}
\def\calR{{\mathcal R}}
\def\calU{{\mathcal U}}
\def\calZ{{\mathcal Z}}
\def\fraka{{\mathfrak a}}
\def\frakb{{\mathfrak b}}
\def\frakG{{\mathfrak G}}
\def\frakg{{\mathfrak g}}
\def\frakh{{\mathfrak h}}
\def\frakn{{\mathfrak n}}
\def\hatcalU{\hat{\mathcal U}}

\def\act{{\hspace{-1pt}\sslash\hspace{-0.75pt}}}

\def\Hom{\operatorname{Hom}}
\def\Id{\text{\it Id}}

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

\def\blue{\color{blue}}
\definecolor{lightred}{RGB}{255, 217, 217}
\def\lightred#1{\setlength{\fboxsep}{0pt}\colorbox{lightred}{#1}}
\def\gray{\color{gray}}
\def\red{\color{red}}
\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\ds{\displaystyle}

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

%\protected\def\dpg{\text{\bf DoPeGDO}}
\protected\def\dpg{\text{\bf DPG}}
\def\eps{\epsilon}
\def\gdo{\text{\bf GDO}}
\def\sleps{{sl_{2+}^\eps}}

\def\endpar#1{~\hfill\fbox{\footnotesize#1}}

\def\lollipop{\scalebox{0.1}{\input{figs/lollipop.pdf_t}}}

\def\am{\prescript{a}{}{m}}
\def\aeta{\prescript{a}{}{\eta}}
\def\aeps{\prescript{a}{}{\varepsilon}}
\def\aS{\prescript{a}{}{S}}
\def\aD{\prescript{a}{}{\Delta}}
\def\bm{\prescript{b}{}{m}}
\def\beeta{\prescript{b}{}{\eta}}
\def\beps{\prescript{b}{}{\varepsilon}}
\def\bS{\prescript{b}{}{S}}
\def\bD{\prescript{b}{}{\Delta}}
\def\cm{\prescript{c}{}{m}}
\def\ceta{\prescript{c}{}{\eta}}
\def\ceps{\prescript{c}{}{\varepsilon}}
\def\cS{\prescript{c}{}{S}}
\def\cD{\prescript{c}{}{\Delta}}
\def\qm{\prescript{q}{}{m}}
\def\qeta{\prescript{q}{}{\eta}}
\def\qeps{\prescript{q}{}{\varepsilon}}
\def\qS{\prescript{q}{}{S}}
\def\qD{\prescript{q}{}{\Delta}}

\def\Qh{{\bbQ_\hbar}}

\def\face{\input{figs/face.pdf_t}}
\def\human{\input{figs/human.pdf_t}}
\def\machine{\input{figs/machine.pdf_t}}

\def\cellscale{1}
\newsavebox\pdfbox
\newlength{\pdfheight}

\def\nbpdfInput#1{{%
  \savebox{\pdfbox}{\includegraphics[scale=\cellscale]{#1}}%
  \settoheight{\pdfheight}{\usebox{\pdfbox}}%
  %\uselengthunit{mm}\printlength{\pdfheight}%
  \noindent\imagetop{\ifdim\pdfheight<10mm\face\else\human\fi}\ %
  \imagetop{\usebox{\pdfbox}}%
  \vskip 2mm%
}}

\def\nbpdfOutput#1{{\noindent{\imagetop{\machine}\ \imagetop{\includegraphics[scale=\cellscale]{#1}}\vskip 2mm}}}
