Exercise 0. A good way to get acquainted with vim is to edit your vimrc file to get coloring, spell-check, and other cool features to start up automatically when you load vim. You will need to create this file from scratch by typing vim .vimrc into the terminal, and then adding the lines you want. There is more information that you need on this process available here. I have a text copy of my own vimrc file for you to look at as well.
Unlike text editors, you cannot just type words into a tex file and expect then to be typeset well. You need a few commands before the text, called the preamble, to tell the LaTeX compiler what to do. In the most basic case, this is just the following:
\documentclass[12pt]{article}
\begin{document}
...
All text goes here
...
\end{document}
Note. In LaTeX, all commands are preceded by the backslash \ symbol. Also, all comments are preceded by the ampersand %. These symbols let LaTeX know that you are not typing text that will appear in the final document.
In LaTeX, all normal words typed into the tex file are typeset in the usual way. However, new lines within the tex document do not correspond to new lines in the output. To start a new paragraph, skip a line.
When creating equations, there are two types of output mode. The display style is used for big and important equations, and is created with the command \begin{equation} ... \end{equation} in conjunction with math commands and symbols. For smaller, inline equations, simply surround any math text with dollar signs (i.e. $ ... $). Note that the characters typed in math mode will appear differently in the final document. For example, $a/b$ will not produce a nice-looking fraction; instead, you will need to type the 'fraction' command.
Example. The command \frac{a}{b} to create fractions, and the command \int to make an integral sign are two examples. Note that LaTeX labels equations automatically.
|
\begin{equation} \int \frac{a+bx^2}{2y} \end{equation} |
![]() |
| $\int \frac{a+bx^2}{2y}$ | ![]() |
For a complete list of math symbols, see the online references here.
Once you have created the tex file, you create the output using a latex compiler. To compile a document and view the results, type the following into the terminal.
latex sample.tex   or   pdflatex sample.tex
To view the results, typexdvi sample.dvi   or   open sample.pdf , respectively.
Exercise 1. Reproduce this pdf file. Here is a skeleton tex file to get you started.
Example. The usepackage goes anywhere before the \begin{document}, and after the documentclass commands.
|
\usepackage{url} ... Other code here ... \url{http://math.asu.edu/CSUMS} |
![]() |
Note. You can load many packages at once with the
usepackage command, by separating them with a comma. For example:
\usepackage{graphicx,amssymb,amsmath,verbatim,url}
Exercise 2. Reproduce this file. To figure out what packages you will need, use Google, or the references here.
Example. The includegraphics command takes one argument which gives the location of the picture, and several optional arguments to set height, width, etc. Note that the image is placed in line with the text unless a line is skipped.
|
Figure below. \includegraphics[height=2in]{./images/sample_im_ben.jpg} Figure to the left. |
![]() |
For more important or interesting things such as tables, lists, or figures with captions, you will need to use one of the LaTeX environments. Environments are used with the begin ... end command. For more information about the many LaTeX environments, see this list.
Example. The itemize environment is used to create non-numbered lists. New items are added to the list with the \item command.
|
\begin{itemize} \item Item A \item Item B \item ??? \item Profit \end{itemize} |
![]() |
Exercise 3. Reproduce this file. Here are the images: [1] [2] [3] [4].
Example. The footnote command is also fun.
|
I want a footnote here \footnote{Footnote text goes here} |
![]() |
| Bottom of page | ![]() |
Exercise 4. Write up a short (3-5 sentence) abstract that outlines the research you hope to be working on over the summer, and a prospective title. Of course, you are in no way bound to this, but I personally have found it very helpful to keep a running abstract that describes the work I am doing. This way, when you need to submit a summary of you research, you will be prepared. I have a template here.
Created in 2009 by Taylor Hines. Not for general distribution; some of this content is borrowed from other sources.