X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;f=macros.tex;h=b4c1a2d67e36d6d01d502f28ab0691b2abe68e77;hb=d036f7b5ba50252b445546431509f5c99e7a0c69;hp=aab43d925d96851d6be4e4f5b1fe17eef83aa0d3;hpb=a33791d3f489cf8216516baafa246713b736a204;p=saga.git diff --git a/macros.tex b/macros.tex index aab43d9..b4c1a2d 100644 --- a/macros.tex +++ b/macros.tex @@ -16,6 +16,19 @@ \parindent=0.8cm \parskip=3pt plus 1pt minus 1pt +% Parameters for final typesetting (bigger inner margins etc.) +\newif\iffinal +\finaltrue +\newdimen\hwobble +\advance\hsize by -10mm + +\iffinal +\hwobble=10mm +\else +\hwobble=0mm +\fi + +% Glue \smallskipamount=4pt plus 1.2pt minus 1.2pt \medskipamount=7pt plus 2.5pt minus 2pt \bigskipamount=15pt plus 5pt minus 4pt @@ -30,21 +43,33 @@ \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{\mathop\uparrow} +\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\sgc{\mathbin{.}} + +\def\brk{\hfil\break} % Bit strings \def\0{{\bf 0}} @@ -109,6 +134,8 @@ \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 @@ -152,6 +179,12 @@ %%% 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 @@ -175,6 +208,7 @@ \def\endlist{\interlistskip\endgroup} \def\ibull{\raise0.2ex\hbox{$\bullet$}} % Signs frequently used for \itemize +\def\icirc{\raise0.2ex\hbox{$\circ$}} % Signs frequently used for \itemize \def\idot{\raise0.2ex\hbox{$\cdot$}} \def\istar{\raise0.2ex\hbox{$\ast$}} @@ -303,31 +337,72 @@ \newcount\chapcount \newcount\seccount \newcount\thmcount +\newcount\tmpcount \chapcount=0 \seccount=0 \thmcount=0 \def\currentid{??} +\def\currentchap{??} + +\def\appendices{\chapcount=99} + +\def\oddpage{% +\iffinal + \ifodd\pageno + \else + \hglue 1in \vfill\supereject + \fi +\fi +} + +\def\rawchapter#1{\vfill\supereject +\oddpage +\leftline{\chapfont #1} +\bigskip +} -\def\chapter#1{\vfill\supereject -\advance\chapcount by 1 +\def\unchapter#1{ +\rawchapter{#1} +\writetoc{unchap}{#1} +} + +\def\chapter#1{\advance\chapcount by 1 \seccount=0 \thmcount=0 \footcnt=0 -\edef\currentid{\the\chapcount} -\leftline{\chapfont\currentid. #1} -\bigskip +% Chapter name + \ifnum\chapcount>99 + \tmpcount=\chapcount + \advance\tmpcount by -100 + \edef\currentchap{\ifcase\tmpcount A\or B\or C\or D\or E\or ZZZ\fi} + \else + \edef\currentchap{\the\chapcount} + \fi +\edef\currentid{\currentchap} +\rawchapter{\currentid. #1} +\writetoc{chap}{#1} +} + +\def\vensure#1{\dimen0=#1 +\vskip 0pt plus \dimen0 +\penalty-1000 +\vskip 0pt plus -\dimen0 } \def\section#1{\bigskip +\vensure{0.5in} \advance\seccount by 1 \thmcount=0 -\edef\currentid{\the\chapcount.\the\seccount} +\edef\currentid{\currentchap.\the\seccount} \leftline{\secfont\currentid. #1} +\nobreak \medskip +\nobreak +\writetoc{sec}{#1} } \def\para{\advance\thmcount by 1 -\edef\currentid{\the\chapcount.\the\seccount.\the\thmcount} +\edef\currentid{\currentchap.\the\seccount.\the\thmcount} \noindent {\bo \currentid.\enspace}} \def\proclaim#1{\para {\bo #1.\enspace}} @@ -345,16 +420,53 @@ \def\example{\proclaim{Example}} \def\label#1{{\sl (#1)\/}\enspace} +\def\labelx#1{\label{#1}\hfil\break\eatspaces} +\def\eatspaces{\kern0pt} -\def\thmn#1{\thm\label{#1}\hfil\break} -\def\lemman#1{\lemma\label{#1}\hfil\break} -\def\defnn#1{\defn\label{#1}\hfil\break} +\def\thmn{\thm\labelx} +\def\lemman{\lemma\labelx} +\def\defnn{\defn\labelx} +\def\corn{\cor\labelx} \def\algn{\alg\label} -\def\notan#1{\nota\label{#1}\hfil\break} +\def\notan{\nota\labelx} +\def\examplen{\example\labelx} +\def\problemn{\problem\labelx} +\def\remn{\rem\labelx} + +\def\paran#1{\para {\sl #1.\/}\enspace\eatspaces} \def\proof{\noindent {\sl Proof.}\enspace} \def\proofsketch{\noindent {\sl Proof sketch.}\enspace} +%%% Table of contents %%% + +\newwrite\toc +\immediate\openout\toc=\jobname.toc +\newif\iftoc +\tocfalse + +\def\writetoc#1#2{ + \toctrue + \toks0={\the\pageno} + \edef\tocaux{\write\toc{\noexpand\expandafter\noexpand\string\noexpand\csname toc#1\noexpand\endcsname{\currentid}{#2}{\the\toks0}}} + \tocaux + \tocfalse +} + +\newwrite\tok +\def\includetoc{ +\immediate\openin\tok=\jobname.tok +\ifeof\tok +\else +\input \jobname.tok +\fi +\immediate\closein\tok +} + +\def\tocchap#1#2#3{\smallskip\line{\bo #1.~~#2 \dotfill ~#3}} +\def\tocsec#1#2#3{\line{#1.~~#2 \dotfill ~#3}} +\def\tocunchap#1#2#3{\smallskip\line{\bo #2 \dotfill ~#3}} + %%% References %%% \newwrite\ids @@ -381,7 +493,7 @@ %%% Bibliography %%% %\bibliographystyle{abbrv} -\bibliographystyle{alpha} +\bibliographystyle{mjalpha} \def\dumpbib{ \def\bblhook{\parskip=2pt plus 1pt minus 0.5pt} \bibliography{biblio} @@ -389,14 +501,26 @@ %%% Figures %%% -\def\figure#1#2#3{\midinsert +\def\float#1#2{\midinsert \medskip -\centerline{\epsfxsize=#2\epsfbox{pic/#1}} +\centerline{#1} \medskip \smallskip -\centerline{#3} +\centerline{#2} \endinsert} +\def\figure#1#2#3{\float{\epsfxsize=#2\epsfbox{pic/#1}}{#3}} + +\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{ @@ -405,6 +529,26 @@ \vfill\supereject\end } +%%% Hyphenation %%% + +\hyphenation{Ra-ma-chan-dran} + +%%% Output routine %%% + +\output{\sagaoutput} + +\def\sagaoutput{\ifodd\pageno \hoffset=\hwobble \else \hoffset=0pt \fi +\plainoutput} + +\def\makefootline{\baselineskip30pt\lineskiplimit 0pt\line{\the\footline}} + +\footline={\ifodd\pageno + {\hfil\twelvemi\the\pageno}% +\else + {\twelvemi\the\pageno\hfil}% +\fi +} + %%% The End %%% \catcode`@=12