<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">\documentclass[onecolumn,letterpaper,11pt]{article}

%===================================================================
\input{common_latex/common_latex_packages}
\input{common_latex/common_latex_definitions}
\input{common_latex/common_latex_help_format}
%===================================================================

\begin{document}

\begin{labcover}
\labtitle{Help Topic: Examples for Getting Started with Latex}
\vspace{0.1in}
\labdate{Spring 2020}
\vspace{0.1in}
\labauth{Michael Benjamin, mikerb@mit.edu}
\labauth{Department of Mechanical Engineering}
\labauth{MIT, Cambridge MA 02139}
\labline
\end{labcover}

\wikidoc{file=Help.TexExamples}
\wikidoc{auth=mikerb@mit.edu}

%====================================================================
\section*{Examples for Getting Started with LaTeX}
%====================================================================

The best way to get started with latex is to download it and start
working with examples. So let's get started. We provide three examples:

\begin{packed_itemize}[0]
\item A dead simple bare bones example.
\item A simple one-page memo in the style of a Navy memo.
\item A template for an MIT thesis.
\end{packed_itemize}

\noindent
All three are available in an SVN repository available for download:

\vspace{0.15in}
\begin{consoleverb}
 $ svn co https://oceanai.mit.edu/svn/latex_examples_2680
\end{consoleverb}
\vspace{0.15in}

\noindent
If svn or the above syntax is unfamiliar to you, read more at the link
below.  Getting svn is pretty easy, even if all you do with it for now
is checkout the above repository.

\urlxx{http://oceanai.mit.edu/ivpman/help/subversion}

%====================================================================
\subsection*{A simple bare bones LaTeX example}

Below is a very simple example. This example is in the tree mentioned above:
\var{latex\_examples\_2680/barebones}. It contains the file \var{example.tex}. 
If you don't have the svn tree checked out, you can just cut and paste
this small file from the clip below into a file
called \var{example.tex}.

\vspace{0.15in}
\begin{fileverb}
 \documentclass[11pt]{article}

 \begin{document}
 \title{A LaTeX Example}
 \author{Evan Eugene Samuelson III}
 \maketitle

 This is the first paragraph.

 This is the second paragraph

 \end{document}
\end{fileverb}
\vspace{0.15in}

\noindent
You should be able to build and open the file with:

\vspace{0.15in}
\begin{consoleverb}
 $ pdflatex example.tex
 $ open example.pdf        (In OS X)
 $ xpdf example.pdf        (In GNU/Linux with xpdf installed)
\end{consoleverb}
\vspace{0.15in}

\noindent
The output should look like:

\vspace{0.1in}
\begin{figure}[H]
  \centering 
  \includegraphics[width=0.65\textwidth]{figs_help/xlatex_bare_bones.png}
  \caption{The single page generated from a bare bones example latex document.}
\label{fig_help_xlatex_bare_bones}
\end{figure}

%====================================================================
\subsection*{A simple example using a Navy memo format}

One of my more well-worn comments about about LaTeX used to be: "Using
LaTeX is certainly how you want to write your thesis or journal paper,
but if you want to write a letter to your mom, perhaps MSWord was
more suitable". 

\pskip

Then at one point I found myself needing to write Navy memos rather
frequently and I developed a simple template for this. Now I no longer
recommend MSWord even for writing letters to your mom (although I
recommend using a different format than the Navy memo format, but you
get the idea). This example can be found in the latex examples svn
tree.

\pskip
\noindent
You should be able to build and open the file with:

\vspace{0.15in}
\begin{consoleverb}
 $ cd latex_examples_2680/navy_memo
 $ pdflatex memo.tex
 $ open memo.pdf        (In OS X)
 $ xpdf memo.pdf        (In GNU/Linux with xpdf installed)
\end{consoleverb}
\vspace{0.15in}


\noindent
The output should look like:

\vspace{0.1in}
\begin{figure}[H]
  \centering 
  \includegraphics[width=0.65\textwidth]{figs_help/xlatex_navy_memo.png}
  \caption{The single page generated from a Navy memo example latex document.}
\label{fig_help_xlatex_navy_memo}
\end{figure}

%====================================================================
\subsection*{An MIT thesis example}

The last example is the most extensive and perhaps most useful for MIT students.
It is also in the svn tree mentioned above. As before you should be able to build
it with:

\vspace{0.15in}
\begin{consoleverb}
 $ cd latex_examples_2680/mit_thesis
 $ pdflatex main.tex
 $ open main.pdf        (In OS X)
 $ xpdf main.pdf        (In GNU/Linux with xpdf installed)
\end{consoleverb}
\vspace{0.15in}

\noindent
However - I recommend you begin using the GNU command line tool, \cmd{make}, 
to build the document instead. The benefits of make are discussed below.

\vspace{0.15in}
\begin{consoleverb}
 $ cd latex_examples_2680/mit_thesis
 $ make
 $ open main.pdf        (In OS X)
 $ xpdf main.pdf        (In GNU/Linux with xpdf installed)
\end{consoleverb}
\vspace{0.15in}

%====================================================================
\subsection*{Using \cmd{make} and Makefiles to build LaTeX documents}

The GNU \cmd{make} utility and Makefiles have been around for very
long time and are still essential for building code today. They are
also useful for building LaTeX documents. Once you start producing
documents with indices, bibliographies, and cross references, the build 
evolves from:

\vspace{0.15in}
\begin{consoleverb}
 $ pdflatex paper.tex
\end{consoleverb}
\vspace{0.15in}

\noindent
to:

\vspace{0.15in}
\begin{consoleverb}
 $ pdflatex paper.tex
 $ bibtex paper.tex
 $ makeindex paper.tex
 $ pdflatex paper.tex
\end{consoleverb}
\vspace{0.15in}

\noindent 
Putting these steps into a Makefile and invoking \cmd{make}, simplifies
this process. The \cmd{make} command defaults to looking for a file named
\var{Makefile} in the directory in which it was invoked. You can also launch
a pdf viewer as part of the \cmd{Makefile}. In a sense,
here \cmd{make} is acting only as a script. Here it could be replaced
with other script tools such as a bash script, or perl
script. However, \cmd{make} also has powerful tools for building
sub-components of the thing your building and auto-detecting when
those sub-components need to be re-built.

\pskip

In the three examples we have discussed here, there are Makefiles for each. 
We do recommend you get in the habit of using \cmd{make}, and encourage you
to read up a bit on this tool.

\end{document}

</pre></body></html>