%%% Required by R CMD check
%\VignetteIndexEntry{pbdDEMO-Guide}
\documentclass[oneside,11pt]{book}
 \usepackage[margin=1.1in]{geometry}


\input{./pbdDEMO-include/preamble}
\input{./pbdDEMO-include/style}


\myversion{0.3-1}
\mytitle{Speaking Serial R with a Parallel Accent {\normalsize (Ver. \demoversion)}}
\mysubtitle{\pbdR Package Examples and Demonstrations}
\myauthor{
\centering
Drew Schmidt \\
\textit{Business Analytics and Statistics \\
University of Tennessee}
\\[.4cm]
%
Wei-Chen Chen \\
\textit{pbdR Core Team}
\\[.4cm]
%
George Ostrouchov \\
\textit{Computer Science and Mathematics Division \\
Oak Ridge National Laboratory}
\\[.4cm]
%
Pragneshkumar Patel \\
\textit{National Institute for Computational Sciences \\
University of Tennessee}
}


\begin{document}

% First header/footer style
\prebodyheadfoot

% \begin{textblock*}{0mm}(-7.5mm,-8mm)
%  \includegraphics[scale=1.07]{./cover/cover.pdf}
% \end{textblock*}
\begin{figure}[h]
  \begin{minipage}[c]{8.5in}
  \hspace{-1.0in}
  \includegraphics[width=8.25in,height=10in]{./cover/cover.pdf}
  \end{minipage}
\end{figure}

% ----------------------
% Body
% ----------------------

\makefirstfew

% \newpage
% \pagenumbering{arabic}
% \setcounter{page}{1}
% \pagestyle{fancy}
% 
% % Body header/footer style
% \bodyheadfoot

%%% intro
\part{Preliminaries}
\input{./pbdDEMO-include/01-introduction}
\input{./pbdDEMO-include/02-background}
%% gbd methods
\part{Direct MPI Methods}
\input{./pbdDEMO-include/03-mpi}
\input{./pbdDEMO-include/04-statistics}
%%% ddmatrix methods
\part{Distributed Matrix Methods}\label{part:dmat}
\input{./pbdDEMO-include/05-dmat}
\input{./pbdDEMO-include/06-gen}
\input{./pbdDEMO-include/07-dmat_basic}
\input{./pbdDEMO-include/08-dmat_stats}
%%% reading /managing data
\part{Reading and Managing Data}
\input{./pbdDEMO-include/09-reading}
\input{./pbdDEMO-include/10-pbdNCDF4}
\input{./pbdDEMO-include/11-redist}
%%% applications
\part{Applications}
\input{./pbdDEMO-include/applications/a1-logL}
\input{./pbdDEMO-include/applications/a2-pmclust}
\input{./pbdDEMO-include/applications/a3-phyclust}
\input{./pbdDEMO-include/applications/a4-Bayes}
\input{./pbdDEMO-include/applications/a5-pairwise}
% \input{./pbdDEMO-include/applications/a5-ts}
%%% appendices
\part{Appendix}
\appendix
\input{./pbdDEMO-include/appendix}
%%% references and indexes
\part{Miscellany}

%
\newpage

% \makeatletter
% \def\@makeschapterhead#1{%
%   \vspace*{50\p@}% space before the title
%   {\parindent \z@ \raggedright
%     \normalfont
%     \interlinepenalty\@M
%     \Huge \bfseries  #1\par\nobreak
%     \vskip 40\p@ % space after the title
%   }}
% \makeatother
\renewcommand{\thechapter}{}

\cleardoublepage
\phantomsection
\addcontentsline{toc}{chapter}{References}
\renewcommand{\bibname}{References}

\makeatletter
\renewenvironment{thebibliography}[1]
     {\chapter*{\bibname}
      \@mkboth{\MakeUppercase\bibname}{\MakeUppercase\bibname}%
      \list{\@biblabel{\@arabic\c@enumiv}}%
           {\settowidth\labelwidth{\@biblabel{#1}}%
            \leftmargin\labelwidth
            \advance\leftmargin\labelsep
            \@openbib@code
            \usecounter{enumiv}%
            \let\p@enumiv\@empty
            \renewcommand\theenumiv{\@arabic\c@enumiv}}%
      \sloppy
      \clubpenalty4000
      \@clubpenalty \clubpenalty
      \widowpenalty4000%
      \sfcode`\.\@m}
     {\def\@noitemerr
       {\@latex@warning{Empty `thebibliography' environment}}%
      \endlist}
\makeatother

\bibliography{./pbdDEMO-include/pbdDEMO}
\bibliographystyle{plainnat}

\printindex

\end{document}
