\documentclass{article}
\usepackage{url}

\newcommand{\BibTeX}{Bib\TeX\/}

\title{sbthesis Documentation}
\author{K.E. Schubert\\Associate Professor}
\begin{document}
\maketitle

\section{Introduction}

I started this back in 2005, to simplify my student's work in preparing thesis.  \LaTeX\/ does a much nicer job than programs like Word\copyright at typesetting thesis as it automates jobs like bibliographies (through \BibTeX), referencing, and table of contents, figures, and tables.  If you encounter problems please email me at \url{schubert@csusb.edu}, even if you fix them.  Little things always seem to creep up from the reviewers so I have to update the file.  Help your friends and let me keep this current.

\section{Setup}

Each person's installation can be a little different (OS, \LaTeX's root, etc.), so I am going to put this in as general a form as possible.  Before installing sbthesis, make sure you have a nice installation to work with.
\begin{enumerate}
\item Make sure you have a full installation of whatever \TeX\/ package you want.  On Windows I suggest MiKTeX, on unix/Linux I suggest TeTeX, and on OSX I suggest OzTeX.
\item Have a \LaTeX\/ friendly text editor (WinEdt on Windows, emacs on unix/Linux, alpha on OSX are my picks).
\item Install any support packages you want, such as ghostscript and gsview.
\end{enumerate}
Now you can install sbthesis.
\begin{enumerate}
\item Download sbthesis.cls from one of my sites( www.csci.csusb.edu/schubert/tex/ or www.r2labs.org/tex/) (or the department site once it gets uploaded).
\item Go to the root directory for your \TeX\/ installation (i.e. where you put it).
\item There should be at least two directories: texmf and localtexmf.  Note on unix related systems they are often in two places, usually /usr/share/texmf/ and /usr/local/share/texmf/.  In old versions of MiKTeX, this is in the root of your main drive, usually C:\textbackslash, but in the latest version they were odd and combined texmf and localtexmf and used C:\textbackslash Program~Files\textbackslash MiKTeX~2.7\textbackslash in their place (thus a class named clsname is stored as \linebreak C:\textbackslash Program~Files\textbackslash MiKTeX~2.7\textbackslash tex\textbackslash latex\textbackslash clsname\textbackslash clsname.cls).  You should make a third directory (in the tex root on Windows or in your home directory, $\sim$/texmf/ or $\sim$/Library/texmf/, but you could also use localtexmf (in MiKTeX 2.7 and later you can store it in C:\textbackslash Program~Files\textbackslash MiKTeX~2.7\textbackslash ).  I use a third directory because it makes it easier to upgrade (all my customizations are in their own directory) and keeps things neater, but suit yourself.
\item If you chose to use localtex do the following
      \begin{enumerate}
      \item Cd to localtexmf/tex/latex/ (in MiKTeX 2.7+ use a file browser and go to C:\textbackslash Program~Files\textbackslash MiKTeX~2.7\textbackslash tex\textbackslash latex\textbackslash ) and create a directory called sbthesis.
      \item Copy sbthesis.cls to sbthesis.
      \end{enumerate}
\item If you chose to make your own directory (say mytexmf) then do the following
      \begin{enumerate}
      \item Cd to mytexmf and create the directory tex.
      \item Cd to tex and create the directory latex.
      \item Cd to latex and create a directory called sbthesis.
      \item Copy sbthesis.cls to sbthesis.
      \end{enumerate}
\item Now you need to refresh the file name database in \TeX\/ so it knows about sbthesis.
      \begin{itemize}
      \item In a WinEdt/MiKTeX do the following
            \begin{enumerate}
            \item Click on Accessories $\rightarrow$ MiKTeX $\rightarrow$ MiKTeX Options.
            \item A dialog box should appear with tabs.  Select the Roots tab.
            \item Pick the top directory you put sbthesis in.  If you made a new directory it won't be here yet.  Click the Add button, and then browse and select it in the dialog that appears.  It should then appear in the list for you to pick.
            \item Click the Refresh FNDB button.
            \item Click OK, and you are done.
            \end{enumerate}
      \item In unix/Linux/OSX run either texhash or mktexlsr (same command), you can read up on them on the web.  Run \LaTeX\/ then \BibTeX, then \LaTeX\/ twice more.  \LaTeX\/ is a two pass compiler that does only one pass at a time (for efficiency if you know when to only run it once).  The first time you run it, it creates a number of intermediate file, amongst which is a `.aux' file.  The file with the .aux extension holds all the information from the first pass (label declarations, bib references, etc.).  \BibTeX\/ uses the .aux file to know what items to put in the bibliography, so you must run \LaTeX\/ before \BibTeX.  \BibTeX\/ generates a .bbl file, which has all the bibliography entries.  You have to run \LaTeX\/ twice more to (pass one) read the .bbl file into the .aux file, then (pass two) update the .dvi file (which is the output you are trying to generate).  You can view the dvi file directly (with xdvi or equivalent) or convert it to ps by the command dvips (then view with ghostview or your favorite ps viewer).
      \end{itemize}
\item Test your installation with the file sbthesisTest.tex, which you can get from the same place you got sbthesis.cls.
\end{enumerate}

\section{Commands}

I have tried to make this document class as user friendly as possible.  First you need to tell \TeX\/ that this is a \LaTeX\/ sbthesis document by using the command \verb1\documentclass{sbthesis}1.  This should be the first thing in your file.  After this you should include whatever style files you want using the command, \verb1\usepackage{name}1, where name is the style file name (such as graphicx, amsmath, etc.).


\begin{table}
\caption{Commands in sbthesis.cls}
\begin{tabular}{|lp{2.5in}|}\hline
\verb1\documentclass{sbthesis}1 & Lets \LaTeX know you are doing a CSUSB project or thesis. \\\hline
\verb1\Chapter1 & Note that the usual command is \verb1\chapter1, I added this to make a chapter command that has the first page of the chapter have the page number.  \\
\verb1\Appendix1 & The standard calls for the appendix title on a separate page, etc.   \\\hline
\verb1\title{title}1 & Your thesis/project title. \\\hline
\verb1\author{name}1 & Your name as it should appear. \\\hline
\verb1\Department1 & Declare CSCI as your department. \\
\verb1\Department[not csci]1 & If you are not in CSCI you must specify. \\\hline
\verb1\EmailAddress{email}1 & Your email.  Note this is being published so avoid emails like ``hotNwild@gmail.com'', it looks bad when people look at your work. \\\hline
\verb1\Advisor{name}1 & Your advisor's name. \\\hline
\verb1\Committee{name}{name}1 & If you have two committee members, use this form.  Each name enclosed in curly braces. \\
\verb1\Committee*{name}{name}{name}1 & If you have three committee members, use this form.  Each name enclosed in curly braces. \\\hline
\verb1\CSUSBDate{graduation date}1 & The month and year of your graduation (not submission). \\\hline
\verb1\Copyright1 & Include if you want a copyright page. (optional) \\\hline
\verb1\AbstractText{text}1 & Type your abstract where text is. \\\hline
\verb1\AcknowledgementText{text}1 & Type your acknowledgement where text is. \\\hline
\verb1\DedicationText{text}1 & The one you dedicate the thesis/project to (optional) \\\hline
\verb1\NoFigures1 & Prevents the system from generating a List of Figures, only use if you don't have any figures. \\\hline
\verb1\NoTables1 & Prevents the system from generating a List of Tables, only use if you don't have any tables. \\\hline
\verb1\ThesisProposal1 & Place after \verb1\begin{document}1 and your document will be formatted as a thesis proposal. \\
\verb1\Thesis1 & Place after \verb1\begin{document}1 and your document will be formatted as a thesis. \\\hline
\verb1\ProjectProposal1 & Place after \verb1\begin{document}1 and your document will be formatted as a project proposal. \\
\verb1\Project1 & Place after \verb1\begin{document}1 and your document will be formatted as a project. \\\hline
\end{tabular}
\label{t-sbthesis-commands}
\end{table}


Now you will need to execute several commands in the preamble (the part of the document between the \verb1\documentclass1 command and the \verb1\begin{document}1 command) to let the document class know what information to put in the front matter (document title, your name, your advisor, your committee, etc.).  The commands are listed in Table~\ref{t-sbthesis-commands}, note that commands in the same box are mutually exclusive (only execute one). Finally you will need to execute one of \verb1\ThesisProposal1, \verb1\Thesis1, \verb1\ProjectProposal1, or \verb1\Project1, immediately after \verb1\begin{document}1.  All the front pages including table of contents, will be automatically generated.

Some side notes:
\begin{enumerate}
\item Rather than redefine \verb1\chapter1 part way through (a bit of a pain) as is often done, I took the lazy way out and made a new command, \verb1\Appendix1.  Perhaps in the future I will add the other.
\item If you want to use \verb1\chapter1 instead of \verb1\Chapter1, you could type

\verb1\chapter{name}\protect\thispagestyle{fancy}1

which will do the same thing.
\end{enumerate}

\section{Required Hand Editing}

At the moment I don't have a pretty way to force the page number to appear on the bibliography's first page.  I do have an easy fix.  After you run \BibTeX you will have a new YourThesisName.bbl file.  Edit this file and put \verb1\BibFix1 on the second line (after the \verb1\begin...1).  If you don't run \BibTeX again or don't delete the .bbl file you will be fine.  You only need to run \BibTeX when you add or change a reference.  You don't need to delete the .bbl file.  Should the file ever get redone just add the command again manually.

\section{Organization}

If you look at sbthesisTest.tex, you will notice that the file can get big and ugly fast.  \TeX\/ allows you to neaten this up by writing each chapter in a different text file and then placing an \verb1\input{filename}1 command in the main file.  This makes things much nicer, especially if you pick readable filenames.

To help organize your thesis document, I have the following suggestions for chapters and sections:
\begin{enumerate}
\item Introduction
     \begin{enumerate}
     \item Overview
     \item History
     \item Literature Survey
     \item Contributions
     \item Document Organization
     \end{enumerate}
\item Theory
     \begin{enumerate}
     \item Problem Statement/Description
     \item Solution and Proof
     \item Algorithm and Analysis
     \item Summary
     \end{enumerate}
\item Testing
     \begin{enumerate}
     \item Methodology
     \item Analysis of Data
     \item Summary
     \end{enumerate}
\item Conclusions
     \begin{enumerate}
     \item Review of Contributions
     \item Future Directions
     \end{enumerate}
\end{enumerate}

Depending on your work you might have multiple theory and/or testing chapters.



\end{document} 