X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=macros.tex;h=2fe07ddb7b7179c4b94de6d1a0c8bf81e750e284;hb=43c49025f1bff523cc3ee0f1a87cfbcb4c99b51d;hp=8af08f27d015069f59093cb598c568ed6dcec5f8;hpb=3eb9eee489f8728e36d1c45b0c23bb083edb04d9;p=saga.git diff --git a/macros.tex b/macros.tex index 8af08f2..2fe07dd 100644 --- a/macros.tex +++ b/macros.tex @@ -32,13 +32,21 @@ \def\<#1>{\leavevmode\hbox{\it #1\/}} \let\>=\noindent \def\qed{{\parfillskip=0pt\allowbreak\hfill\nobreak $\spadesuit$\par}} -\def\FIXME#1{\>{\bo FIXME:} #1} +\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{$^{\the\footcnt}$}{#1}}} +\def\foot#1{\global\advance\footcnt by 1{\parindent=0.25in\parskip=0pt\footnote{$^{\bf\the\footcnt}$}{#1}}} %%% Fonts %%% @@ -232,14 +240,14 @@ % \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 @@ -249,14 +257,13 @@ \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 %%% @@ -271,36 +278,49 @@ \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 {\bo #1 \the\chapcount.\the\seccount.\the\thmcount.\enspace}} +\def\para{\advance\thmcount by 1 +\edef\currentid{\the\chapcount.\the\seccount.\the\thmcount} +\noindent {\bo \currentid.\enspace}} -\def\theorem{\proclaim{Theorem}} +\def\proclaim#1{\para {\bo #1.\enspace}} + +\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.}\enspace} @@ -325,13 +345,7 @@ \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\chapref#1{\ref{ch#1}} -\def\secref#1{\ref{sec#1}} -\def\thmref#1{\ref{thm#1}} +\def\id#1{\writeid{#1}{\currentid}} %%% Bibliography %%% @@ -342,6 +356,16 @@ \bibliography{biblio} } +%%% Figures %%% + +\def\figure#1#2#3{\midinsert +\medskip +\centerline{\epsfxsize=#2\epsfbox{pic/#1}} +\medskip +\smallskip +\centerline{#3} +\endinsert} + %%% Stand-alone chapters %%% \def\endpart{