<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: 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.TexInstall}
\wikidoc{auth=mikerb@mit.edu}

%====================================================================
\section*{Getting Started with Latex}
%====================================================================

We encourage the use of LaTeX in part because its quality, ubiquity,
and natural support for writing across a team using version control
software like SVN. Lastly, for students pursuing a graduate degree at
MIT, you will very likely write your thesis using LaTeX, and there are
good MIT thesis templates to help make this easy.

\pskip
There is {\em sooo} much on the web to help you learn LaTeX, add new
packages, and example documents and forums. We won't try to replicate
that. However it seems a bit harsh to just say "go learn LaTeX on the
web or the bookstore".  So we have a bit of information here to get
you started:

\vspace{0.1in}
\begin{packed_itemize}[0]
\item Tips for installing LaTeX on your Mac or GNU/Linux machine,
\item A few example LaTeX documents, including an MIT thesis template,
\item A page of personal must-know features, tips, and pointers to 
      resources on the web.
\end{packed_itemize}
\vspace{0.1in}

\noindent
The best way to get started with LaTeX is to put it on your computer
and start experimenting with working document examples. Even better if
the examples are similar to what you may be creating in your immediate
future. Most of basic workings will be apparent to you, e.g.,
that \var{\underline{super}} results in \var{super} being
underlined. Some of the more advanced features you can figure out by
just googling the snippet of code you don't understand.

%---------------------------------------------------------------------
\subsection*{How to tell if LaTeX is already installed}

Your machine may already have a version of \cmd{latex} installed. To
check, try:

\vspace{0.15in}
\begin{consoleverb}
 $ which latex
 /usr/texbin/latex
\end{consoleverb}
\vspace{0.15in}

\noindent
If you get a response like the one above, you're all
set. If \cmd{latex} is not installed you will get a response like the
one below:

\vspace{0.15in}
\begin{consoleverb}
 $ which latex
 latex: Command not found
\end{consoleverb}
\vspace{0.15in}

\noindent
If the \cmd{which} command is telling you that it cannot find
the \cmd{latex} command, you probably just don't have \cmd{latex}
installed. However it may be that you simply don't have the
directory containing the \cmd{latex} executable in your shell path. To
rule this out, try the following (if using GNU/Linux):

\vspace{0.15in}
\begin{consoleverb}
 $ cd /usr/bin
 $ which ./latex
 ./latex
\end{consoleverb}
\vspace{0.15in}

\noindent
or (if using OSX):

\vspace{0.15in}
\begin{consoleverb}
 $ cd /usr/texbin/latex
 $ which ./latex
 ./latex
\end{consoleverb}
\vspace{0.15in}

\noindent 
If you find the \cmd{latex} exutable as above, add the directory to
your shell path. If you're not sure how to do this see the help topic
on augmenting your shell path:

\urlxx{http://oceanai.mit.edu/ivpman/help/help-add-shellpath}

%--------------------------------------------------------------------
\subsection*{Getting LaTeX in GNU/Linux}

If you're running GNU/Linux you probably have access to a package
manager such as \cmd{apt-get} and already know how to use it to some
degree. To install packages like LaTeX, you need root
privileges. Assuming your user account has root privileges, do the
following, and enter your normal login password if prompted:

\vspace{0.15in}
\begin{consoleverb}
 $ sudo apt-get install texlive-latex-base
 $ sudo apt-get install texlive-latex-extra
\end{consoleverb}
\vspace{0.15in}

\noindent
See the discussion above on how to confirm whether \cmd{latex} has
been successfully installed, and adjust your shell path if need be.

%--------------------------------------------------------------------
\subsection*{Getting LaTeX in OSX}

If you're running on a Mac (OSX) you can use MacPorts to install
LaTeX. If you haven't installed MacPorts, see the separate help topic
on this.  To install packages like LaTeX, you need root (admin)
privileges. Assuming your user account has admin privileges, do the
following, and enter your normal login password when or if prompted:

\vspace{0.15in}
\begin{consoleverb}
 $ sudo port install texlive-latex
 $ sudo port install texlive-latex-extra
\end{consoleverb}
\vspace{0.15in}

\noindent
See the discussion above on how to confirm whether svn has been 
successfully installed, and adjust your shell path if need be.

%--------------------------------------------------------------------
\subsection*{Other tools you will need to use LaTeX}

LaTeX works by processing a raw text file and producing a file in a
viewable format like \var{dvi} or \var{pdf} format. It makes no
assumptions about what tool you use to build that raw input file. Nor
does it make any assumption about the tool you use to view the output
document. So you need to have a couple additional tools handy. You
likely already have them:

\vspace{0.1in}
\begin{packed_itemize}[1]
  \item On the front end you need to have a text editor like Emacs or
    vim.  Both editors have support for LaTeX and will render
    components of the language in proper colors and provid some
    support for auto formatting. In our class we recommend using
    Emacs for those not already using another good text editor. 

  \item On the back end you need to have a tool for viewing pdf
    documents.  In OS X, the Preview tool works just fine. Just
    type \cmd{open file.pdf} on the command line. There are several
    other pdf viewer tools available on the Mac. In GNU/Linux, there
    are tools such as \cmd{xpdf} and \cmd{xdvi} available through a
    package manager like \cmd{apt-get}.
\end{packed_itemize}
\vspace{0.1in}

\noindent
In my opinion this is one of the many reasons for wide adoption of
LaTeX.  The users have {\em choices} in the tools for composing the
raw files, as well as in the tools for viewing finished documents. Compare
this to MSWord where everything is all wrapped into one tool. 

\pskip

Finally, we note here that this web page was compiled in LaTeX format,
using Emacs. If you're viewing this as a pdf, the pdf was generated by
pdflatex directly to a pdf. If you're viewing this in a browser, the
wiki page was auto-generated by a home brewed program for converting
LaTeX files to wiki page format.

%--------------------------------------------------------------------
\subsection*{Use the \cmd{pdflatex} command instead of \cmd{latex}}

The \cmd{pdflatex} command should also be installed when you install LaTeX
alongside the \cmd{latex} command.

\vspace{0.15in}
\begin{consoleverb}
 $ which latex
 /usr/texbin/latex
 $ which pdflatex
 /usr/texbin/pdflatex
\end{consoleverb}
\vspace{0.15in}

\noindent
You can think of \cmd{pdflatex} as an extension of \cmd{latex} that generates
pdf files directly and contains certain typesetting improvements and extensions.
It has become the de facto standard for many LaTeX users including myself. For 
me the biggest advantage is the better support for including png formatted
graphics in figures. 

\end{document}

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