From OSR
% Enable making the index
\makeindex
%% Encourge figures and text to share the same page
\renewcommand{\topfraction}{0.85}
\renewcommand{\textfraction}{0.1}
\renewcommand{\floatpagefraction}{0.75}
\widowpenalty=5000
\clubpenalty=5000
% Use narrower margins on each side (less wasted paper)
% but keep the inner margin (towards the spine) fairly large.
\usepackage[
inner=5cm,
outer=3cm,
top=3cm,
bottom=3cm,
twoside
]{geometry}
% Define our page style with headers, footers, etc
\makepagestyle{mwstyle}
\makeoddhead{mwstyle}{\rightmark}{}{\thepage}
\makeevenhead{mwstyle}{\thepage}{}{\leftmark}
\makeoddfoot{mwstyle}{}{}{\small\thetitle}
\makeevenfoot{mwstyle}{\small\thetitle}{}{}
\renewcommand*{\footnoterule}{}
%
% Display the page and section in the header of each page
%
\makeatletter
\makepsmarks{mwstyle}{
\def\chaptermark##1{\markboth{%
\ifnum \value{secnumdepth} > -1
\if@mainmatter
\chaptername\ \thechapter\ --- %
\fi
\fi
##1}{}}
\def\sectionmark##1{\markright{%
\ifnum \value{secnumdepth} > 0
\thesection. \ %
\fi
##1}}
}
%
% For sections include a rule that extends across the entire
% page to make them stand out compared to the other
% document divisions.
%
\newcommand{\ruledsection}[1]{%
\noindent%
\parbox[t]{\textwidth}{%
%\hrule\vskip1em
\sffamily\large\bfseries #1%\vskip1em%
\hrule%
}
}
\makerunningwidth{mwstyle}{1.0\textwidth}
\makeheadposition{mwstyle}{flushright}{flushleft}{flushright}{flushleft}
\makeheadrule{mwstyle}{1.0\textwidth}{\normalrulethickness}
%\makefootrule{mwstyle}{1.0\textwidth}{\normalrulethickness}{1mm}
% Use our newly defined style for the page
% and hang the section numbers off the left margin
\pagestyle{mwstyle}
\chapterstyle{ell}
\hangsecnum
%
% Use san-serif fonts and rules for section headers,
%
\setsecheadstyle{\ruledsection}
\setsubsecheadstyle{\sffamily\bfseries\raggedright}
\maxsecnumdepth{subsection} % number subsections
\maxtocdepth{subsection}
% Use italics for the abstract
\renewcommand{\abstracttextfont}{\itshape}
% Make verbatim text slightly smaller so that it doesn't
% overwhelm the article text
\renewcommand{\verbatim@font}{%
\ttfamily\small%\catcode`\<=\active\catcode`\>=\active%
}
% Switch 'at' to be a special command again
\makeatother
%