% Package for simple LaTeX example.
% Jeff Ondich, 15 September 2015
%
% Illustrates simple package construction and a small number of reusable preferences
% that I used in my simple LaTeX sample.

% This names the package. The package name and the base name of the *.sty
% file containing the package must be the same.
\ProvidesPackage{jondich}

% I use the fullpage package to give myself some standard margins without having
% to think too hard about it.
\usepackage{fullpage}

% These packages from the American Mathematical Society give me access to the
% equation* and split contexts (amsmath) and the \qed symbol (amsthm). Of course,
% these packages contain lots more than that.
\usepackage{amsmath}
\usepackage{amsthm}

% You can define variables to be used elsewhere, in new commands, just in the 
% middle of your regular text, etc.
\def\coursename{CS 252: Algorithms}

% You can also assign values to variables that are included as part of the LaTeX system
% or one of its packages. As an example, I'm adjusting the value of \parskip here.
% I like bigger-than-default gaps between my paragraphs. The "2.0ex" here specifies
% the gap as "2.0 times the height of the lowercase x" (ex is a standard unit in document
% styles, like px and em). The "plus 1.0ex minus 1.0ex" gives the LaTeX engine some
% flexibility in adjusting paragraph gaps (e.g. at the top of a new page).
\setlength{\parskip}{2.0ex plus 1.0ex minus 1.0ex}

% This is a custom command I use to set up the boxed title you see at the top of
% my sample document.
\newcommand{\titlebox}[1]{
   \noindent
   \begin{center}
       \framebox{
         \vbox{\hbox to 6.28in
            { \textbf{\coursename} \hfill }
                \hbox to 6.28in { {\it #1\hfill}}
            }
        }
   \end{center}
}

% In one of the templates I looked at in preparing this sample, I found a footer that
% I liked, including a "Page K of N" under a horizontal rule at the bottom of the page.
% This led me to learn about the fancyhdr and lastpage packages. Google them to
% learn more. Or Bing it. Or go nuts, Duck-Duck-Go it or Ask Jeeves. So many choices.
\usepackage{fancyhdr}
\usepackage{lastpage}
\pagestyle{fancy}
\fancyhead{}
\renewcommand{\headrulewidth}{0pt}
\fancyfoot{}
\rfoot{Page\ \thepage\ of \pageref{LastPage}}
\renewcommand\footrulewidth{0.4pt}

