\documentclass[binding=0.6cm,PhD]{sapthesis}

% CLASS OPTIONS:
% PhD: generic PhD
% PhDA: PhD in physics
% PhDB: PhD in mathematics
% LaM: Laurea Magistrale
% Lau: Laurea
% noexaminfo: no information about the final exam

% REQUIRED COMMANDS
% title
% author
% IDnumber
% course (not mandatory if you use PhDA or PhDB)
% courseorganizer (not mandatory if you use PhDA or PhDB)
% cycle (only for PhD, PhDA, PhDB)
% submitdate (use month and year for PhD whereas use XXXX/YYYY academic year for Laurea)
% copyyear
% advisor (at least one)
% authoremail



% OPTIONAL COMMANDS
% coadvisor
% examdate
% examiner
% versiondate
% website
% ISBN



% if pdfLaTeX is used load also:
\usepackage{microtype}
% if you write in italian:
%\usepackage[italian]{babel}
% \usepackage[utf8]{inputenx}

\usepackage{hyperref}
\hypersetup{colorlinks=true,
	linkcolor=blue,
	anchorcolor=blue,
	citecolor=blue,
	urlcolor=blue,
	pdftitle={Sapthesis class example},
	pdfauthor={Francesco Biccari}}

% dummy text
\usepackage{lipsum}

% custom commands
\newcommand{\bs}{\textbackslash}

\title{How to waste time}
\author{Francesco Biccari}
\IDnumber{123456}
\course[Physics]{Fisica} % only one argument for Laurea and Laurea Magistrale
\courseorganizer{Scuola di dottorato in Scienze Avanzatissime}
\cycle{XXII}
\submitdate{April 2010}
\copyyear{2010}
\advisor{Prof. Caio Rossi}
\advisor{Dr. Sempronio Rossi}
\coadvisor{Dr. Lampa Dina}
\authoremail{pippo@pippo.com}

\examdate{16 April 2010}
\examiner{Prof. Enrico Gregorio}
\examiner{Dr. Lorenzo Pantieri}
\versiondate{1 May 2010}
\website{biccari.altervista.org}
\ISBN{000000000-0}

\begin{document}

\frontmatter
\maketitle

\dedication{Dedicated to\\ Donald Knuth}

\begin{abstract} This document is an example which shows the main features of
the \LaTeXe\ class \texttt{sapthesis.cls} developed by Francesco Biccari
with the help of GuIT (Gruppo Utilizzatori Italiani di \TeX).
\end{abstract}

\begin{acknowledgments}[Ringraziamenti]
Ho deciso di scrivere i ringraziamenti in italiano
per dimostrare la mia gratitudine verso i ragazzi
del GuIT, il Gruppo Utilizzatori Italiani di \TeX, e, in particolare,
verso il Prof. Enrico Gregorio.
\end{acknowledgments}

\tableofcontents

\chapter{Non numbered chapter}


\lipsum[1-10]

\mainmatter
\chapter{Style features of \textsf{sapthesis} (this is a numbered chapter)}

The page is fixed at the dimensions of an A4 paper. The font dimension is fixed at 11\, pt and the text column and the margins are chosen to fill to the best an A4 paper while keeping a reasonable line length (396\, pt) for a good readability.

The text heigth and the text width are in golden ratio (\textasciitilde 1.62) as well as the outer and inner margins in a two-side document after binding margin removal.
The top margin and bottom margin are instead in the ratio $1\colon\sqrt{2}$. Finally the header and the footer style have been modified by the \texttt{fancyhdr} package.

The captions have a smaller font respect to the text and the label is in boldface.

The appearance of the margin notes has been improved.
They have the same font dimension of the footnotes and are typed in italics.
Moreover I defined a new command to typeset margin note aligned to the left on the right page and vice versa on the left page.
Notice that if a binding margin greater than 1.5\, cm is used, the dimensions of the margin notes become too small and very ugly.
Do not use them in this case.

The mathematical objects, figures and tables are numbered within the chapters (e.g. 1.1, 1.2,\ldots for the first chapter, 2.1, 2.2 for the second one and so on\ldots)

The titlepage is automatically composed when the \texttt{\bs maketitle} command is given.
The parameters needed for the titlepage, author, title, etc\ldots , are supplied
by dedicated commands explained in the next section.
A copy of the logo, in \texttt{pdf} or in \texttt{eps} format, must be present in the root directory of the thesis.
These files are supplied in the \texttt{sapthesis.zip} archive.


%\section{Common problems}
%
%\subsection{Compose a system of equation in displaystyle}
%
%Using the array environment to typeset a system of equation has the problem that the mathematics is
%in textstyle. Usually a student wants the displaystyle. Instead of using \texttt{\bs dfrac} and so on\ldots
%which produce the wrong vertical spacing, I suggest the following environment definition in the
%preamble of the document:
%\begin{lstlisting}
%\usepackage{mathtools}
%\usepackage{cases}
%
%\newenvironment{system*}%
%{\begin{displaymath}\left\lbrace \begin{lgathered}}%
%{\end{lgathered} \right. \end{displaymath}\ignorespacesafterend}
%
%\newenvironment{system}[1][]%
%{\begin{equation}#1\left\lbrace \begin{lgathered}}%
%{\end{lgathered} \right. \end{equation}\ignorespacesafterend}
%
%\newenvironment{subsystem}[1][]%
%{\begin{subnumcases}{#1}}%
%{\end{subnumcases}\ignorespacesafterend}
%\end{lstlisting}
%
%\texttt{system*} is for unnumbered systems, \texttt{system} for numbered systems with a number
%for the entire system and \texttt{subsystem} for numbered system with a subnumbered equations
%(1a, 1b,\ldots). The optional argument is used to attach a label to the system.
%
%Example of usage:
%\begin{lstlisting}
%\begin{system}[\label{eq:nice_system}]
%  a=b \\
%  c=d
%\end{system}
%\end{lstlisting}
%
%However if you do not want to load mathtools package you can use the aligned environment
%of the amsmath package (already loaded in sapthesis). Example:
%\begin{lstlisting}
%\begin{equation}
%  \label{eq:nice_system}
%  \left\lbrace
%  \begin{aligned}
%    & a=b \\
%    & c=d
%  \end{aligned}
%  \right.
%\end{equation}
%\end{lstlisting}
%Notice the usage of the ampersand (\&) used to align to the left the content of the system.
%


\section{A section}
\lipsum[1-10]

\section{Another section}
\lipsum

\chapter{Some floating objects and some maths}

\begin{figure}
\centering
\includegraphics[width=0.8\textwidth]{marchiologo_rosso_positivo}\\[3ex]
\includegraphics[width=0.8\textwidth]{marchiologo_nero_positivo}
\caption{Use vector images as much as possible! \LaTeX\ supports the eps vector image format whereas pdf\LaTeX\ supports the pdf format (and the eps by the epstopdf package).}
\label{fig:largenenough}
\end{figure}

\lipsum

\begin{table}
\caption{This is a simple table. Remember to typeset
always the table caption above the table. Do not use vertical lines.}
\label{tab:letters}
\centering
\begin{tabular}{lcc}
\toprule
Letter & Test & Test \\
\midrule
A & C & E \\
B & D & F \\
\bottomrule
\end{tabular}
\end{table}

\lipsum

And now a simple equation. Note the form of the equation number.
\begin{equation}
x_{1,2}=\frac{-b\pm\sqrt{b^2-4ac}}{2a}
\end{equation}

\lipsum

\appendix
\chapter{Some special commands}

Some important numbers (we have used the commands \texttt{\bs eu} and \texttt{\bs iu}):
\begin{equation}
\eu^{\iu\pi}+1=0
\end{equation}

\noindent Derivatives (we have used the commands \texttt{\bs der} and \texttt{\bs pder}):
\begin{equation}
\der{f}{x} \qquad \pder[2]{f}{y}
\end{equation}

\noindent Subscripts and superscripts (we have used the commands \texttt{\bs rb} and \texttt{\bs rs}):
\[
a_b \neq a\rb{b}\qquad a^b \neq a\rp{b}
\]

\noindent Unit of measurements (we have used the command \texttt{\bs un}): $25\un{m}$, $3.5\un{m/s}$

\noindent Other commands: (\texttt{\bs g}) 45\g, (\texttt{\bs C}) 30\,\C, (\texttt{\bs A}) 12\,\A, (\texttt{\bs micro}) 40\,\micro m, (\texttt{\bs ohm}) 27\,\ohm, (\$7 \bs x 10\^{}5\$) $7 \x 10^5$. And finally (\texttt{\bs di})
\[
\int x \di x
\]

\medskip
\lipsum
\mnote{This is a fancy margin note!}
\lipsum

\backmatter
% bibliography
%\cleardoublepage
%\bibliographystyle{sapthesis} % BibTeX style
%\bibliography{bibliography} % BibTeX database without .bib extension

\end{document}
