% Use memoir as a (one-sided) article replacement
% (try replacing ``oneside'' with ``twoside'' if you print on both
%  sides)
\documentclass[article,oneside]{memoir}

%% If you want 1in margins, uncomment these lines
\setlrmarginsandblock{1in}{*}{*}
\setulmarginsandblock{1in}{*}{*}
\checkandfixthelayout

% Here, we define \figcaption and \tabcaption, which act like
% \captionof{figure}{...} and \captionof{table}{...} which are used in
% other examples
\newfixedcaption{\figcaption}{figure}
\newfixedcaption{\tabcaption}{table}

% This new "environment" will cause everything in it to be centered and
% grouped on the same page (good for figures and tables when you don't
% want to use floats but you do want to have captions). You can use it
% with
%
% \begin{centergroup}
%  ...
% \end{centergorup}
\newenvironment{centergroup}{\trivlist\item\begin{minipage}{\columnwidth}\centering}{\end{minipage}\endtrivlist}

% Setup title page (\title defines \thetitle, which can be used later)
\title{Lab 0: Introduction to \LaTeX}
\author{%
{\normalsize ECE~557~--- Thursday, 1:30~--- T.~Pavlic (instructor)}
\andnext
\andnext
Table 4: \andnext Sally She \and Henry He}
\date{~\\\today}

% Make a copy of the ``companion'' page style to our ``custom''
\copypagestyle{custom}{companion}
%
% We're not using margin notes, so make header span textwidth
\makerunningwidth{custom}{\textwidth}
\makeheadrule{custom}{\textwidth}{\normalrulethickness}
%
% For two-page printing, what you'd see on the left-hand page
\makeevenhead{custom}
        {\normalfont\bfseries\thepage}          % Left header (page)
        {\thetitle}                             % Center header (title)
        {\normalfont\bfseries\leftmark}         % Right header (chapter)
% The header you see on the right-hand page (or all one-sided pages)
\makeoddhead{custom}
        {\normalfont\bfseries\rightmark}        % Left header (section)
        {\thetitle}                             % Center header (title)
        {\normalfont\bfseries\thepage}          % Right header (page)
% To customize the footers, uncomment (for even and odd pages):
%\makeevenfoot{custom}
%        {left footer}
%        {center footer}
%        {right footer}
%\makeoddfoot{custom}
%        {left footer}
%        {center footer}
%        {right footer}
%
% Switch to our custom page style
\pagestyle{custom}

% Title page has empty page style (empty headers and no page number)
\aliaspagestyle{title}{empty}

% For including graphics (e.g., using \includegraphics{...})
\usepackage{graphicx}

% Include mathematics help
\usepackage{mathtools, amssymb, amsfonts}

% Change figure/table/equation numbering to number by chapter
\numberwithin{figure}{chapter}
\numberwithin{table}{chapter}
\numberwithin{equation}{chapter}

% Style equation references to have parentheses around them
\usepackage{varioref}
\labelformat{equation}{(#1)}

% Include hyperref for linking and \autoref support
\usepackage[colorlinks]{hyperref}

% Even though we're using chapters internally, make the rest of the
% world think we're using sections (this is for \autoref)
\let\chapterautorefname\sectionautorefname
\let\sectionautorefname\subsectionautorefname
\let\subsectionautorefname\subsubsectionautorefname
\let\subsubsectionautorefname\paragraphautorefname

\begin{document}

% Make title page and obliterate its effect on page number
\maketitle
\clearpage
\setcounter{page}{1}

% Use chapters like sections
\chapter{Introduction}

The report is organized as follows. The experimental procedure is
described in \autoref{sec:procedure}. In \autoref{sec:theory},
theoretical predictions about experimental outcomes are described.
Measured results from the actual experiment are given in
\autoref{sec:meas}. The results and their relationship to the theory is
analyzed in \autoref{sec:analysis}. Some concluding remarks and future
directions are given in \autoref{sec:concl}.

\chapter{Procedure}
\label{sec:procedure}

\chapter{Theoretical Predictions}
\label{sec:theory}

As with all theoretical sections, we give some math, as in
\autoref{eq:pi}.
%
\begin{equation}
        \pi \approx 3.141592653589793
        \label{eq:pi}
\end{equation}
%
If I don't want the text after the equation to be indented as a new
paragraph, I better make sure I don't have any empty lines around the
equation in the \TeX{} source. For readability, in the code I can put an
empty comment on lines that I want to be empty. That way \TeX{} ignores
them, but they still look ``empty'' to me.

Here is a new paragraph. It's indented. Note that paragraphs at the
beginning of sections are not indented. That makes them look better.
Typography is about making text look friendly. It's important to note
that \TeX{} handles all of the indenting for me. I can tell \TeX{} not
to indent with a \textbackslash\texttt{noindent} command, and I can
force an indent too. However, without extra work, \TeX{} does all of
that menial stuff for me.

\chapter{Measured Results}
\label{sec:meas}

Our data are shown in \autoref{tab:data}. Note that ``\texttt{data}'' is
the \emph{plural} form of ``\texttt{datum}.''

% memoir absorbs some of the features of the booktabs package, which
% includes \toprule, \midrule, \bottomrule, and \cmidrule
% \cmidrule lets me place lines that span a range of columns (rather
% than all of them) and lets me trim one or both sides of the line to
% add some separation.
%
% (we could have used a floating table environment, but instead
% we fix the table in place and use \tabcaption)
\begin{centergroup}
        \begin{tabular}{ccc}
        \toprule
        Frequency & Gain & Phase Shift\\
        \cmidrule(r){1-1}
        \cmidrule(rl){2-2}
        \cmidrule(l){3-3}
        5 Hz & 5 & $-10^{\circ}$\\
        15 Hz & 5 & $-15^{\circ}$\\
        1 kHz & 0.5 & $-90^{\circ}$\\
        \bottomrule
        \end{tabular}
        \tabcaption{Some data.}
        \label{tab:data}
\end{centergroup}

\chapter{Analysis}
\label{sec:analysis}

\chapter{Conclusions}
\label{sec:concl}

\end{document}
