Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
118 lines (102 sloc) 3.63 KB
% Default is singlespacing.
\RequirePackage{setspace}
\newcommand{\textspacing}{}
\DeclareOption{singlespacing}{%
\typeout{Using single spacing}%
\renewcommand{\textspacing}{\singlespacing}}
\DeclareOption{onehalfspacing}{%
\typeout{Using one-and-a-half spacing}%
\renewcommand{\textspacing}{\onehalfspacing}}
\DeclareOption{doublespacing}{%
\typeout{Using double spacing}%
\setlength{\parskip}{.6ex plus1pt}
\renewcommand{\textspacing}{\doublespacing}}
\ProcessOptions\relax
\textspacing
% Fill the page a bit more:
\usepackage[hmargin=3.5cm,vmargin=3.5cm]{geometry}
\raggedbottom
% Tame hyphenation:
\hyphenpenalty=3000
\tolerance=200
% Nicer titles:
\RequirePackage{titlesec}
\RequirePackage{numname}
\RequirePackage{textcase}
% Hyperlinks:
\usepackage{color}
\definecolor{navy}{rgb}{0,0,0.4}
\usepackage[colorlinks,citecolor=navy,linkcolor=navy,urlcolor=navy]{hyperref}
% NOTE: I am a big fan of Minion Pro, especially for small caps.
% However, installing it is a pain:
% https://gist.github.com/richfitz/2324707
% So this switches between Minion Pro and Palatino, which at least
% looks substantially nicer than Computer Modern.
% \IfFileExists{MinionPro.sty}{
% \RequirePackage[mathlf,minionint]{MinionPro}
% \RequirePackage[protrusion=true,expansion=false,verbose=silent]{microtype}
% }{
\RequirePackage[osf]{mathpazo}
\def\textssc{\textsc}
\def\sscshape{\scshape}
\RequirePackage[tracking=smallcaps,protrusion=true,expansion=false,verbose=silent]{microtype}
%}
\DeclareRobustCommand{\spacedsmallcaps}[1]{\textls[50]{\scshape{#1}}}%
\DeclareRobustCommand{\spacedallcaps}[1]{\textssc{\MakeTextUppercase{#1}}}
\DeclareRobustCommand{\spacedlowcaps}[1]{\textssc{\MakeTextLowercase{#1}}}
\RequirePackage{fancyhdr}
\fancypagestyle{plain}{%
\fancyhf{} % clear all header and footer fields
\renewcommand{\headrulewidth}{0pt}
\fancyfoot[LE,RO]{\footnotesize\thepage}}
\definecolor{grey}{rgb}{0.4,0.4,0.4}
\pagestyle{plain}
\renewcommand{\headrulewidth}{0pt}
\fancyhf{}
\pagestyle{fancy}
\fancyhf{}
\fancyfoot[LE,RO]{\footnotesize\thepage}
\fancyhead[LO,RE]{\color{grey}{\footnotesize\spacedlowcaps{\@titleprefix}}}
\fancyhead[LE,RO]{\footnotesize\spacedlowcaps{\@runninghead}}
% Can't get spaced sc here
% The classicthesis version won't allow singlespace/raggedright, which
% is still needed unless I shrink some titles...
\titleformat{\section}
{\singlespacing\raggedright}{\large\textssc{\MakeTextLowercase{\thesection}}}{1em}
{\large\spacedlowcaps}
\titleformat{\subsection}
{\sscshape}{\MakeTextLowercase{\thesubsection}}{1em}%
{\normalfont\normalsize\itshape}
\titleformat{\subsubsection}[runin]{\normalfont\sc}{}{0pt}{}[\hspace{1.2ex}---]
\titlespacing*{\chapter}{0pt}{1\baselineskip}{1ex}
\titlespacing*{\section}{0pt}{1\baselineskip}{1.75ex}
\titlespacing*{\subsection}{0pt}{2.75ex}{1ex}
\RequirePackage[labelfont={sc}]{caption}
\def\papertitle{\gdef\@papertitle}
\def\affiliation{\gdef\@affiliation}
\def\titleprefix{\gdef\@titleprefix}
\def\runninghead{\gdef\@runninghead}
\newcommand{\sectionline}{%
\nointerlineskip \vspace{\baselineskip}%
\hspace{\fill}\rule{0.5\linewidth}{.7pt}\hspace{\fill}%
\par\nointerlineskip \vspace{\baselineskip}
}
\def\@maketitle{%
\newpage
\null
\singlespacing
{\noindent{\color{grey}\spacedlowcaps{\@titleprefix}}\par}
\vspace{1ex}
{\noindent\raggedright\large\spacedsmallcaps{\@title}\par}%
\vspace{1ex}%
{\raggedleft\normalsize\spacedsmallcaps\@author\par}%
\vspace{1ex}%
{\raggedleft\scriptsize\it\begin{tabular}{@{\rm}r@{ }l@{}}%
\@affiliation
\end{tabular}\par}%
\vspace{1ex}%
\nointerlineskip\vspace{.75\baselineskip}
\noindent\rule{\linewidth}{.7pt}
\textspacing
\par
\vskip 1em}