% To use these macros, make the first line of your file \input{preamble}, % optionally preceeded by a \documentstyle command and/or alter\natsnate % definitions for lemma, theorem, etc. \addtolength{\parskip}{1ex} %separation between paragraphs \addtolength{\jot}{1ex} %line separation in eqnarray % define \goodgap --- which is used in Ruslan's subfigures... \newcommand{\goodgap}{ \hspace{\subfigtopskip} \hspace{\subfigbottomskip}} % % To make fig generated latex work % \newcommand{\SetFigFont}[3]{} % % theorem environments % % usual latex definition, but italics replaced by \theoremfont % \comment{ \define\theoremfont{\it} \def\@begintheorem#1#2{\theoremfont \trivlist \item[\hskip \labelsep{\bf #1\ #2}]} \def\@opargbegintheorem#1#2#3{\theoremfont \trivlist \item[\hskip \labelsep{\bf #1\ #2\ (#3)}]} \def\@endtheorem{\endtrivlist} } % % Various theorem-like environments % \theoremstyle{break} \newtheorem{theorem}{Theorem}[chapter] \newtheorem{lemma}[theorem]{Lemma} \newtheorem{corollary}[theorem]{Corollary} \newtheorem{proposition}[theorem]{Proposition} \newtheorem{definition}[theorem]{Definition} \newtheorem{openprob}[theorem]{Open Problem} \newtheorem{observation}[theorem]{Observation} \newtheorem{fact}[theorem]{Fact} \newtheorem{example}[theorem]{\hspace*{-.28in} \ding{43} Example} \newtheorem{problem}[theorem]{\hspace*{-.28in} \ding{45} Problem} \newtheorem{remark}[theorem]{\hspace*{-.28in} \ding{37} Remark} \newtheorem{note}[theorem]{\hspace*{-.28in} \ding{228} Note} \newtheorem{convention}[theorem]{\hspace*{-.28in} \ding{46} Convention} \newcommand{\comps}{\mbox{$\mathbb C$}} \newcommand{\irats}{\mbox{$\mathbb I$}} \newcommand{\nats}{\mbox{$\mathbb N$}} \newcommand{\rats}{\mbox{$\mathbb Q$}} \newcommand{\reals}{\mbox{$\mathbb R$}} \newcommand{\ints}{\mbox{$\mathbb Z$}} % \newcommand{\qed}{\;\;\;\Box} \newenvironment{proof}{\par{\sc Proof:}}{\(\qed\) \par} % % figure numbers are reset at section changes like theorem numbers % \@addtoreset{figure}{chapter} \def\thefigure{\thechapter.\arabic{figure}} % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% % %% Equation hacks: %% %% \yesnumber is analogous to \nonumber - turns on eqn number in an %% eqnarray*. %% method: eqnarray* works by forcing a \nonumber at the end of each %% line; we just define an override switch. %% %% \mynumber{z} is used analogously to \nonumber %% in eqnarray or eqnarray* to change numbering of current line, %% but instead of suppressing the number, it uses ``z'' instead. %% also works in equation environment. %% Method: redefine the macro used to format eqn numbers. %% %% \lefttext{z} is like \mynumber, but sets text flush to leftmargin. %% Method: stolen from leqno.doc %% %% default for \@eqnnum is: \def\@eqnnum{{\rm (\theequation)}} %% std. def. for \nonumber: \def\nonumber{\global\@eqnswfalse} %% \makeatletter \newif\if@yeseqnsw\@yeseqnswfalse \def\yesnumber{\global\@yeseqnswtrue} \def\nonumber{\if@yeseqnsw\global\@yeseqnswfalse\else\global\@eqnswfalse\fi} \global\let\save@eqnnum=\@eqnnum \newcommand{\mynumber}[1]{{\global\@yeseqnswtrue\global\def% \@eqnnum{{\mbox{\rm #1}\addtocounter{equation}{-1}% \global\def\@eqnnum{\save@eqnnum}\global\@yeseqnswfalse}}}} \newcommand{\lefttext}[1]{{\global\@yeseqnswtrue\global\def% \@eqnnum{{{\hbox to .01pt{}\rlap{\rm \hskip -\displaywidth #1}}% \addtocounter{equation}{-1}% \global\def\@eqnnum{\save@eqnnum}\global\@yeseqnswfalse}}}} \makeatother %% % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \newcommand{\sloppyfloats}{ % don't be so fussy about floats: \setcounter{topnumber}{5} \setcounter{bottomnumber}{5} \setcounter{totalnumber}{5} \renewcommand{\topfraction}{.99} \renewcommand{\bottomfraction}{.99} \renewcommand{\textfraction}{.01} \renewcommand{\floatpagefraction}{.85} } %\ifempty{x}{YES}{NO} expands to YES if x is the empty string, else NO. \newcommand{\ifempty}[3]{% \def\arga{#1}% \def\zzippo{}% \ifx\arga\zzippo #2\else #3\fi} % % % for flagging index entry in text %\newif\ifindexflag\indexflagtrue \newif\ifindexflag\indexflagfalse \newif\iforg\orgtrue % stuff for pictures \newif\ifframe\frametrue %\indexauthorstrue % turn on plain-a bib style's author indexing \makeindex %\makeglossary % ------------------------------------------------------------ % \ifbold % ------- % true if the current font is \bf; % use like other if's: \ifbold truetext \else falsetext \fi % \newcommand{\ifbold}{% \edef\bolda{\the\font}% {\bf\xdef\boldb{\the\font}}% \ifx\bolda\boldb } % ------------------------------------------------------------ % Figures % ------- \newenvironment{myfigure}% {\begin{figure}[htb]% \mbox{\rule[-1.5mm]{.5mm}{2mm}\rule{\textwidth}{.5mm}\rule[-1.5mm]{.5mm}{2mm}} }%begin text { \mbox{\rule{.5mm}{1mm}\rule{\textwidth}{.5mm}\rule{.5mm}{1mm}} \end{figure}% }%end text \newenvironment{myproblem}% { \hspace*{-.3in} \mbox{\rule[-3.5mm]{.5mm}{4mm}\rule{\textwidth}{.5mm}\rule[-3.5mm]{.5mm}{4mm}} }%begin text { \mbox{\rule{.5mm}{3mm}\rule{\textwidth}{.5mm}\rule{.5mm}{3mm}} }%end text %ALGORITHMS \newcommand{\algopen}{ \noindent \mbox{\rule[-3.5mm]{.5mm}{4mm}\rule{\textwidth}{.5mm}\rule[-3.5mm]{.5mm}{4mm}} } \newcommand{\algclose}{ \noindent \mbox{\rule{.5mm}{4mm}\rule{\textwidth}{.5mm}\rule{.5mm}{4mm}} } % figures with horizontal rules % in a \picture, \fiducial{x,y} gives a 10 unit cross at (x,y). \newcommand{\fiducial}[1]{% \put(#1){\line(1,0){10}} \put(#1){\line(0,1){10}} \put(#1){\line(-1,0){10}} \put(#1){\line(0,-1){10}} } % center pictures, & optionally show origin & bounding box % the 2 args are the args to the picture env., but in {}'s, not ()'s. \newenvironment{pictureframe}[2]% {\begin{center}% \begin{picture}(#1)(#2)% \iforg\fiducial{0,0}\fi% \ifframe\put(#2){\framebox(#1){}}\fi% }%begin text { \end{picture}% \end{center}% }%end text % ------------------------------------------------------------ % Floats % ------ % more & bigger floats with text: \setcounter{topnumber}{5} \setcounter{bottomnumber}{5} \setcounter{totalnumber}{5} \renewcommand{\topfraction}{.99} \renewcommand{\bottomfraction}{.99} \renewcommand{\textfraction}{.01} \renewcommand{\floatpagefraction}{.85} % ------------------------------------------------------------ % Indexing % -------- % % tie-index: \index reads its arg ``verbatim,'' so active characters like % ``tie'' (~) aren't expanded. Unfortunately, if index is called in another % macro, with outer arg passed in, it's too late to totally prevent this % interpretation. In particular, tie turns into ``\penalty\@M'', which % causes a problem when the .ind file is ultimately processed. The % following macro ``\tindex'' re\def's tie (but *not* other control % sequences like accents, for example), so a literal ``~'' goes out to the % .idx file. This is good enough for my immediate purpose in \personal. % Accents are treated right by preceding with ``\protect''. (Well, % almost: there will be a stray space after the accent in the .idx file; % this is OK if we're consistent.) % {\catcode`~=12\gdef\rawtilde{~}} \newcommand{\tindex}[1]{{\def~{\rawtilde}\expandafter\index{#1}}} % % concept indexing, manually generated % put the optional argument in if you want to ensure proper sorting. % Eg \conceptidx[Ldfa]{$\Ldfa$} % % we also have authoridx and problemidx to make life a bit simpler % % conceptidx: \newcommand{\conceptidx}[2][NoOptionalArgument]{% \ifthenelse{\equal{#1}{NoOptionalArgument}}{\index{#2}}{\index{#1@#2}}% } % % authoridx: % \newcommand{\authoridx}[2][NoOptionalArgument]{% \ifthenelse{\equal{#1}{NoOptionalArgument}}{\index{#2}}{\index{#1@#2}}% } % % problemidx: this puts two entries into the index % \problemidx{Circuit Value} % will put an entry under "Circuit Value problem" and one under % "Problem list, Circuit Value" The optional arg can be used to % put a different entry in the problem list. % % \newcommand{\problemidx}[2][NoOptionalArgument]{% \ifthenelse{\equal{#1}{NoOptionalArgument}}% % then {\index{problem list!#2}\index{#2 \textit{problem}}}% %else {\index{problem list!#1}\index{#2 \textit{problem}}}% } %---------------------------------------------------------------- \pagestyle{headings} % %---------------------------------------------------------------- % bibliography (from book.sty) % modified to set text at front: % define \bibintro before \bibliography{} used; % it will be typeset at the front of the bib, flushleft. % use small font \small %---------------------------------------------------------------- \makeatletter \def\thebibliography#1{\chapter*{\bibname\@mkboth {\uppercase{\bibname}}{\uppercase{\bibname}}}\small\list {\@biblabel{\arabic{enumiv}}}{\settowidth\labelwidth{\@biblabel{#1}}% \item[]\bibintro %%% <<< this line is my only addition \leftmargin\labelwidth \advance\leftmargin\labelsep \usecounter{enumiv}% \let\p@enumiv\@empty \def\theenumiv{\arabic{enumiv}}}% \def\newblock{\hskip .11em plus.33em minus.07em}% \sloppy\clubpenalty4000\widowpenalty4000 \sfcode`\.=\@m} \makeatother %---------------------------------------------------------------- % index %------ % \makeatletter % following from book.sty, except \raggedright. empty thispagestyle % make sure indexintro is defined before theindex is used \def\theindex{\@restonecoltrue\if@twocolumn\@restonecolfalse\fi \columnseprule \z@ \columnsep 35\p@\twocolumn[\@makeschapterhead{\indexname}\indexintro]% \@mkboth{\uppercase{\indexname}}{\uppercase{\indexname}}% \thispagestyle{empty}\parindent\z@ \parskip\z@ plus .3\p@\relax\let\item\@idxitem\raggedright} % following from book.sty % \def\@idxitem{\par\hangindent 40\p@} % \def\subitem{\par\hangindent 40\p@ \hspace*{20\p@}} % \def\subsubitem{\par\hangindent 40\p@ \hspace*{30\p@}} %my version: \def\@idxitem{\par\hangindent 20\p@} \def\subitem{\par\hangindent 20\p@ \hspace*{10\p@}} \def\subsubitem{\par\hangindent 20\p@ \hspace*{20\p@}} \makeatother % unnumbered chapter, but DO put in toc, page header: \newcommand{\chapterstar}[1]{ \chapter*{#1}% \addcontentsline{toc}{chapter}{#1}% \markboth{\uppercase{#1}}{\uppercase{#1}}% } \newcommand{\Unix}{$\mathrm{Unix}^\textsc{tm}$} \renewcommand{\thepage}{\roman{page}}