% (c) 2008 Martin Mares <mj@ucw.cz>
\input epsf.tex
+\input btxmac.tex
\catcode`@=11
%%% Miscellanea %%%
\def\em#1{{\it #1\/}}
+\def\df#1{{\it #1\/}} % when we define something
\def\O{{\cal O}}
\def\<#1>{\leavevmode\hbox{\it #1\/}}
\let\>=\noindent
\def\qed{{\parfillskip=0pt\allowbreak\hfill\nobreak $\spadesuit$\par}}
-\let\endpart=\bye
+\def\qeditem{{\parfillskip=0pt\hfill\rlap{\hskip\rightskip\llap{$\spadesuit$}}\par}}
+\def\FIXME#1{\>{\bo TODO:} #1}
+\def\symdiff{\mathbin{\Delta}}
+\def\hphantas#1#2{\setbox0=\hbox{#2}\hbox to \wd0{#1\hss}}
+\def\o#1{\accent23 #1}
+\def\mst{\mathop{\rm mst}}
+\def\deg{\mathop{\rm deg}}
+\def\timesalpha{\mskip2mu\alpha}
+\def\timesbeta{\mskip2mu\beta}
+\def\tower{\mathop\uparrow}
% Footnotes
\newcount\footcnt
\footcnt=0
-\def\foot#1{\global\advance\footcnt by 1{\parindent=0.25in\parskip=0pt\footnote{$^{\left<\the\footcnt\right>}$}{#1}}}
+\def\foot#1{\global\advance\footcnt by 1{\parindent=0.25in\parskip=0pt\footnote{$^{\bf\the\footcnt}$}{#1}}}
%%% Fonts %%%
\def\it{\fam\itfam\twelveit}
\def\bo{\fam\bffam\twelveb}
\def\bf{\fam\bffam\twelvebf}
-\def\tt{\fam\ttfam\twelvett\hyphenchar\currentfont=-1\relax}
+\def\tt{\fam\ttfam\twelvett\hyphenchar\twelvett=-1\relax}
\def\sc{\twelvesc}
\def\sl{\fam\slfam\twelvesl}
% \algout popis vystupu
% \endalgo
-\def\algo#1{
+\def\algo{
\interlistskip
\begingroup
\let\:=\algoitem
\parskip=1pt plus 1pt minus 0.3pt
\rightskip=2em
\itemcount=0
-{\bo Algoritmus\/} {\sc #1}
+\smallskip
}
\def\endalgo{\interlistskip\endgroup}
\def\algopar{\par
\leavevmode
}
\def\algoitem{
-\ifnum\itemcount=0\smallskip\fi
\algopar\advance\itemcount by 1
\hbox to 2em{\hss \the\itemcount. }%
\futurelet\next\algoitemh}
\def\algoitemh{\ifx\next:\let\next=\algohang\else\let\next=\relax\fi\next}
\def\algohang:{\advance\hangindent by 2em \hskip 2em\futurelet\next\algoitemh}
-\def\algin{\par{\it Vstup:\/} }
-\def\algout{\par{\it Výstup:\/} }
+\def\algin{\par{\sl Input:\/} }
+\def\algout{\par{\sl Output:\/} }
%%% Constructs used in algorithms %%%
\chapcount=0
\seccount=0
\thmcount=0
+\def\currentid{??}
-\def\chapter#1{\vfill\eject
+\def\chapter#1{\vfill\supereject
\advance\chapcount by 1
\seccount=0
\thmcount=0
-\leftline{\chapfont\the\chapcount. #1}
+\edef\currentid{\the\chapcount}
+\leftline{\chapfont\currentid. #1}
\bigskip
}
\def\section#1{\bigskip
\advance\seccount by 1
\thmcount=0
-\leftline{\secfont\the\chapcount.\the\seccount. #1}
+\edef\currentid{\the\chapcount.\the\seccount}
+\leftline{\secfont\currentid. #1}
\medskip
}
-\def\proclaim#1{\advance\thmcount by 1
-\noindent {\bf #1 \the\chapcount.\the\seccount.\the\thmcount. }
-}
+\def\para{\advance\thmcount by 1
+\edef\currentid{\the\chapcount.\the\seccount.\the\thmcount}
+\noindent {\bo \currentid.\enspace}}
+
+\def\proclaim#1{\para {\bo #1.\enspace}}
-\def\theorem{\proclaim{Theorem}}
+\def\thm{\proclaim{Theorem}}
\def\lemma{\proclaim{Lemma}}
\def\defn{\proclaim{Definition}}
+\def\problem{\proclaim{Problem}}
+\def\obs{\proclaim{Observation}}
+\def\rem{\proclaim{Remark}}
+\def\alg{\proclaim{Algorithm}}
+\def\impl{\proclaim{Implementation}}
+\def\cor{\proclaim{Corollary}}
+\def\nota{\proclaim{Notation}}
+\def\example{\proclaim{Example}}
+
+\def\label#1{{\sl (#1)\/}\enspace}
+
+\def\thmn{\thm\label}
+\def\lemman{\lemma\label}
+\def\defnn{\defn\label}
+\def\algn{\alg\label}
-\def\proof{\noindent {\sl Proof.} }
+\def\proof{\noindent {\sl Proof.}\enspace}
%%% References %%%
\newwrite\ids
\def\writeid#1#2{\immediate\write\ids{\string\def\expandafter\string\csname id#1\endcsname{#2}}}
-\immediate\openin\ids=ids.aux
+\immediate\openin\ids=\jobname.ids
\ifeof\ids
\else
-\input ids.aux
+\input \jobname.ids
\fi
\immediate\closein\ids
-\immediate\openout\ids=ids.aux
+\immediate\openout\ids=\jobname.ids
\def\ref#1{\expandafter\ifx\csname id#1\endcsname\relax
{\bo ??}%
\fi
}
-\def\chapid#1{\writeid{ch#1}{\the\chapcount}}
-\def\secid#1{\writeid{sec#1}{\the\chapcount.\the\seccount}}
-\def\thmid#1{\writeid{thm#1}{\the\chapcount.\the\seccount.\the\thmcount}}
+\def\id#1{\writeid{#1}{\currentid}}
+
+%%% Bibliography %%%
+
+%\bibliographystyle{abbrv}
+\bibliographystyle{alpha}
+\def\dumpbib{
+ \def\bblhook{\parskip=2pt plus 1pt minus 0.5pt}
+ \bibliography{biblio}
+}
-\def\chapref#1{\ref{ch#1}}
-\def\secref#1{\ref{sec#1}}
-\def\thmref#1{\ref{thm#1}}
+%%% Figures %%%
+
+\def\figure#1#2#3{\midinsert
+\medskip
+\centerline{\epsfxsize=#2\epsfbox{pic/#1}}
+\medskip
+\smallskip
+\centerline{#3}
+\endinsert}
+
+%%% Stand-alone chapters %%%
+
+\def\endpart{
+ \section{Bibliography}
+ \dumpbib
+ \vfill\supereject\end
+}
%%% The End %%%