X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=macros.tex;h=b350a789dbf78c04d1c6c8a9b51384a74b56006e;hb=afdb04367d41d1b54ad3415777af885a9bab40e7;hp=206c037b52f8c46e06c5f05f1d860087155287ae;hpb=6269bd20ae4de28ba017c8932fe61f89116901e3;p=saga.git diff --git a/macros.tex b/macros.tex index 206c037..b350a78 100644 --- a/macros.tex +++ b/macros.tex @@ -3,6 +3,7 @@ \input epsf.tex \input btxmac.tex +\input amssym.tex \catcode`@=11 @@ -27,15 +28,57 @@ %%% 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\/}} +\def\<#1>{\ifmmode + \mathchoice{\hbox{\it #1\/}}{\hbox{\it #1\/}}{\hbox{\eightti #1\/}}{\hbox{\sixti #1\/}}% + \else\leavevmode\hbox{\it #1\/}\fi} \let\>=\noindent \def\qed{{\parfillskip=0pt\allowbreak\hfill\nobreak $\spadesuit$\par}} +\def\qeditem{{\parfillskip=0pt\hfill\rlap{\hskip\rightskip\llap{$\spadesuit$}}\par}} +\def\qedmath{\eqno{\spadesuit}} +\def\FIXME#1{\>{\bo TODO:} #1} +\def\symdiff{\mathbin{\Delta}} +\def\rack#1#2{\setbox0=\hbox{#1}\hbox to \wd0{#2}} +\def\o#1{\accent23 #1} +\def\mst{\mathop{\rm mst}} +\def\msf{\mathop{\rm msf}} +\def\deg{\mathop{\rm deg}} +\def\timesalpha{\mskip2mu\alpha} +\def\timesbeta{\mskip2mu\beta} +\def\tower{\mathbin\uparrow} +\def\Forb{{\rm Forb}} +\def\minorof{\preccurlyeq} +\def\per{\mathop{\rm per}} +\def\poly{\mathop{\rm poly}} +\def\E{{\bb E}} +\def\crpt{\mathbin{\Uparrow}} +\def\C{{\cal C}} + +\def\brk{\hfil\break} + +% Bit strings +\def\0{{\bf 0}} +\def\1{{\bf 1}} +\def\(#1){\mathord{\left<#1\right>}} + +% Bitwise operations +\def\shl{\mathbin{<\!<}} +\def\shr{\mathbin{>\!>}} +\def\bop#1{\mathbin{\hbox{\sc #1}}} +\def\band{\bop{and}} +\def\bor{\bop{or}} +\def\bxor{\bop{xor}} +\def\bnot{\mathop{\hbox{\sc not}}} + +% A reversed version of \ddots with extra space at the top to get good alignment of exponents. +\def\rddots{\mathinner{\mkern1mu\raise\p@\vbox{\kern7\p@\hbox{.}}\mkern2mu + \raise4\p@\hbox{.}\mkern2mu\raise7\p@\hbox{.}\raise11\p@\hbox{}\mkern1mu}} % 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 %%% @@ -77,9 +120,17 @@ \mathf@nt{\fntmathsstok}{sy}{\fntmathsssize}{cm}\skewchar\m@@f='60\scriptscriptfont2=\m@@f \mathf@nt{\fntmathtok}{ex}{\fntmathsize}{cm}\textfont3=\m@@f\scriptfont3=\m@@f\scriptscriptfont3=\m@@f \mathf@nt{\fntmathtok}{ti}{\fntmathsize}{cm}\textfont\itfam=\m@@f +\mathf@nt{\fntmathstok}{ti}{\fntmathssize}{cm}\scriptfont\itfam=\m@@f +\mathf@nt{\fntmathsstok}{ti}{\fntmathssize}{cm}\scriptscriptfont\itfam=\m@@f \mathf@nt{\fntmathtok}{sl}{\fntmathsize}{cm}\textfont\slfam=\m@@f \mathf@nt{\fntmathtok}{bx}{\fntmathsize}{cm}\textfont\bffam=\m@@f \mathf@nt{\fntmathtok}{tt}{\fntmathsize}{cm}\hyphenchar\m@@f=-1\textfont\ttfam=\m@@f +\mathf@nt{\fntmathtok}{msam}{\fntmathsize}{}\textfont\msafam=\m@@f +\mathf@nt{\fntmathstok}{msam}{\fntmathssize}{}\scriptfont\msafam=\m@@f +\mathf@nt{\fntmathsstok}{msam}{\fntmathsssize}{}\scriptscriptfont\msafam=\m@@f +\mathf@nt{\fntmathtok}{msbm}{\fntmathsize}{}\textfont\msbfam=\m@@f +\mathf@nt{\fntmathstok}{msbm}{\fntmathssize}{}\scriptfont\msbfam=\m@@f +\mathf@nt{\fntmathsstok}{msbm}{\fntmathsssize}{}\scriptscriptfont\msbfam=\m@@f % Blackboard bold font \newfam\bbfam @@ -109,10 +160,17 @@ % Other fonts \font\chapfont=csssdc17 scaled \magstep1 \font\secfont=csb14 +\font\secitfont=csbxti14 %%% FIXME \footline={\hss\twelverm\folio\hss} +% We have to redefine \big and friends as we are using 12pt symbols +\def\big#1{{\hbox{$\left#1\vbox to11.5\p@{}\right.\n@space$}}} +\def\Big#1{{\hbox{$\left#1\vbox to14.5\p@{}\right.\n@space$}}} +\def\bigg#1{{\hbox{$\left#1\vbox to17.5\p@{}\right.\n@space$}}} +\def\Bigg#1{{\hbox{$\left#1\vbox to20.5\p@{}\right.\n@space$}}} + %%% Enumerated lists %%% \newif\ifitem\itemtrue @@ -229,14 +287,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 @@ -246,14 +304,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 %%% @@ -268,44 +325,74 @@ \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} +\footcnt=0 +\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\proof{\noindent {\sl Proof.} } +\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\labelx#1{\label{#1}\hfil\break\kern 0pt} % Eat spaces + +\def\thmn{\thm\labelx} +\def\lemman{\lemma\labelx} +\def\defnn{\defn\labelx} +\def\corn{\cor\labelx} +\def\algn{\alg\label} +\def\notan{\nota\labelx} +\def\examplen{\example\labelx} +\def\problemn{\problem\labelx} +\def\remn{\rem\labelx} + +\def\paran#1{\para {\sl #1:\/}\enspace} + +\def\proof{\noindent {\sl Proof.}\enspace} +\def\proofsketch{\noindent {\sl Proof sketch.}\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 ??}% @@ -315,22 +402,37 @@ \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 %%% -\bibliographystyle{abbrv} +%\bibliographystyle{abbrv} +\bibliographystyle{alpha} \def\dumpbib{ \def\bblhook{\parskip=2pt plus 1pt minus 0.5pt} \bibliography{biblio} } +%%% Figures %%% + +\def\figure#1#2#3{\midinsert +\medskip +\centerline{\epsfxsize=#2\epsfbox{pic/#1}} +\medskip +\smallskip +\centerline{#3} +\endinsert} + +\def\multicap#1{ +\let\\=\break +\vbox{\hsize=0.7\hsize +\parindent=0pt +\leftskip=0pt plus 0.3\hsize +\rightskip=\leftskip +\parfillskip=0pt +#1 +}} + %%% Stand-alone chapters %%% \def\endpart{ @@ -339,6 +441,10 @@ \vfill\supereject\end } +%%% Hyphenation %%% + +\hyphenation{Ra-ma-chan-dran} + %%% The End %%% \catcode`@=12