LaTeX Workshop Wrapup Page

The output in PDF format from the LaTeX file we were working with in the workshop is here

All of the input files necessary for the demo including the LaTeX file, bibliography database file, bibliography style files, and images are zipped up and available here.

The text of the LaTeX input file is given below.

\documentclass{article}
\pagestyle{empty}
\setlength{\topmargin}{0in}
\setlength{\headheight}{0in}
\setlength{\headsep}{0in}
\setlength{\textheight}{9.5in}
\setlength{\textwidth}{7in}
\setlength{\oddsidemargin}{-.35in}
\newcommand{\myskip}{\vspace{.1in}}
\usepackage{graphicx}
\usepackage{times}
\usepackage[colorlinks=true,
 	        linkcolor=blue,
        	citecolor=blue,
                urlcolor=blue,
  		filecolor=blue, 
		pdfpagemode=None, 
		pdfstartview=FitH]{hyperref}


\newsavebox{\savepar}
\newenvironment{boxit}{\begin{lrbox}{\savepar}
  \begin{minipage}[b]{6.5in}}
  {\end{minipage}\end{lrbox}\fbox{\usebox{\savepar}}}


\begin{document}


\title{\LaTeX \ Demo}
\author{Brendan Hogan\thanks{I would like to thanks Jimmy John's for bringing tasty sandwiches}}
\date{\today}

\maketitle



\section{Basic Math Stuff}
\label{sec:basic}

Many of the common math symbols you use in reports have very intuitive commands from within \LaTeX.  Also, all of the Greek letters can be used by prefacing the name of the letter with a slash.  Here is how some of them look.

\myskip

\begin{boxit}
\begin{verbatim}
\[ \int_{0}^{2\pi} \sin \theta d\theta \]

\[ F(x) = \sum_{t=0}^{x} \left( 
% in this case we want an array with only one column
% that is aligned in the center 'c'
\begin{array}{c}    
n \\  % end first row
t \\  % end second row
\end{array}
\right) p^t (1-p)^{n-t}
{\mathrm \ \ \ \ } % a clunky way to insert some space in math mode
x = 0, 1, 2, \ldots, n \]
\end{verbatim}
\end{boxit}


\[ \int_{0}^{2\pi} \sin \theta d\theta \]

\[ F(x) = \sum_{t=0}^{x} \left( 
\begin{array}{c}    % in this case we want an array with only one column, that is aligned in the center 'c'
n \\  % end first row
t \\  % end second row
\end{array}
\right) p^t (1-p)^{n-t}
{\mathrm \ \ \ \ } % a clunky way to insert some space in math mode
x = 0, 1, 2, \ldots, n \]


\[ \frac{x}{x + 1} \]

In this Section~\ref{sec:basic} we showed a couple quick examples of inserting math in a document.  In Section~\ref{sec:moreeq} we will expand on this to show multiline equations, and in Section~\ref{sec:graphics} we will show how to include figures and tables in your documents.  And just for kicks I will cite a couple references from Kirlik~\cite{kirlik:hf93} and Erev~\cite{erev:hf04}.


\section{More advanced math stuff}
\label{sec:moreeq}

\subsection{Matrices}

Matrices are commonly used in all kinds of applications, and they are easy to include in a \LaTeX document by wrapping an array inside of square brackets.

\myskip 

\[ \hat{\mathbf{B}} = 
\left[ \begin{array}{ccc} 
-3.0638 & 0.6750/2 & -0.5250/2 \\
0.6750/2 & -1.2138 & 1.4250/2 \\
-0.5250/2 & 1.4250/2 & -2.1638 \\
\end{array} \right] \]



\subsection{Multi-line Equations and Derivations: eqnarray}


\begin{eqnarray}
f_{R|\mathcal{H}_2}(r|\mathcal{H}_2) &=& f_N * f_S = \int_{0}^{r} f_N(\rho) f_S(r-\rho) d\rho \\
&=& \int_{0}^{r} b e^{-b \rho} \cdot ae^{-a(r -\rho)} d \rho \\
&=& ba \int_{0}^{r} e^{-(b-a)\rho -ar} d\rho \\
&=& ba e^{-ar} \int_{0}^{r} e^{-(b-a) \rho} d\rho \\
&=& ba e^{-ar} \left[ - \frac{1}{b-a} \left. e^{-(b-a)\rho} \right|_{\rho=0}^{r} \right] \\
&=& -\frac{ba e^{-ar} }{b-a} \left[ e^{-(b-a) r} -1 \right] \\
&=& \frac{ba}{b-a} \left[ e^{-ar} - e^{-br} \right] \\
\end{eqnarray}





\section{Inserting Figures and Tables}
\label{sec:graphics}

In Figure~\ref{fig:decision} I show a decision region for a recognition problem.


\begin{figure}[h!]
\label{fig:decision}
\centering
\includegraphics[width=4in]{hw3_prob2C}
\caption{Decision regions for the recognition problem in the $S-T$ plane}
\end{figure}


\subsection{An Array of Figures}

\begin{figure}[h!]
\begin{center}
$\begin{array}{c@{\hspace{.1in}}c@{\hspace{.1in}}c}
\includegraphics[width=2in]{6point3_contour_x3_s}  &  
\includegraphics[width=2in]{6point3_contour_x2_s} &
\includegraphics[width=2in]{6point3_contour_x1_s}   \\
\end{array}$
\end{center}
\caption{Pairwise contour plots of the response surface with the third variable set at its value in the stationary point}
\label{fig:contoursStat}
\end{figure}




\subsection{Data Tables: Tabular}

I find the tabular environment to be helpful when I want to line up a bunch of data in a table and have careful control over the alignment of individual columns and where lines are placed relative to the cells.  An examle of this is in Table~\ref{mentalset}.

\begin{table}[h!]
\begin{tabular}{r |c c c c c |c |c c} \hline
Pair $k$ & $a_{k,1}$ & $a_{k,2}$ & $v(a_{k,1},a_{k,2})$ & Direct Ranking & Ranking with $v$ & $b_{k,1}$ & $b_{k,2}$ & $v(b_{k,1},b_{k,2})$ \\ \hline
1 & 10 & 4 & 0.39153 & $\prec$ & $\prec$ & 45 & 10 & 0.79159  \\
2 & 50 & 6 & 0.72223 & $\prec$ & $\prec$ & 60 & 25 & 0.90443  \\  
3 & 20 & 6 & 0.57132 & $\prec$ & $\prec$ & 80 & 13 & 0.92496  \\
4 & 30 & 12 & 0.74108 & $\succ$ & $\succ$ & 70 & 4 & 0.69144  \\
5 & 5 & 15 & 0.43278 & $\succ$ & $\prec$ & 20 & 3 & 0.44843  \\
6 & 2 & 5 & 0.16634 & $\prec$ & $\prec$ & 4 & 15 & 0.39173  \\
7 & 70 & 20 & 0.9278 & $\succ$ & $\succ$ & 5 & 5 & 0.316  \\
8 & 80 & 20 & 0.95224 & $\succ$ & $\succ$ & 10 & 8 & 0.49909  \\
9 & 45 & 11 & 0.8038 & $\succ$ & $\succ$ & 10 & 4 & 0.39153  \\
10 & 7 & 6 & 0.39774 & $\prec$ & $\prec$ & 35 & 12 & 0.76866  \\
11 & 15 & 4 & 0.45419 & $\prec$ & $\prec$ & 40 & 18 & 0.8215  \\
12 & 15 & 6 & 0.52386 & $\prec$ & $\prec$ & 50 & 13 & 0.84046  \\
13 & 15 & 8 & 0.56891 & $\prec$ & $\prec$ & 15 & 20 & 0.64535  \\
14 & 15 & 10 & 0.59805 & $\succ$ & $\succ$ & 17 & 5 & 0.51286  \\
15 & 15 & 15 & 0.63345 & $\succ$ & $\succ$ & 3 & 25 & 0.35049  \\
16 & 20 & 3 & 0.44843 & $\prec$ & $\prec$ & 25 & 12 & 0.70844  \\
17 & 35 & 20 & 0.80083 & $\prec$ & $\prec$ & 40 & 25 & 0.8299  \\
18 & 90 & 20 & 0.97381 & $\succ$ & $\succ$ & 30 & 15 & 0.7594  \\
19 & 70 & 10 & 0.86931 & $\succ$ & $\succ$ & 20 & 4 & 0.49857  \\
20 & 60 & 7 & 0.78251 & $\succ$ & $\succ$ & 15 & 7 & 0.54883  \\
\end{tabular}
\label{mentalset}
\end{table}

\bibliography{bass}

\nocite{*}

% \bibliographystyle{annotation}
\bibliographystyle{IEEEtran}

% \bibliographystyle{decsci}

\end{document}

Maintained by Brendan Hogan, comments or questions: bph4r@virginia.edu
Last Modified: Wednesday, 14-Nov-2007 02:31:25 EST