There is a good general reference for LaTeX; use it! Another must-get is the LaTeX cheat sheet, free to download. Get it now!
latex bibtex latex latexFor some things you might need a third latex at the end.
\begin{figure}[ht]
\epsfig{file=figs/fig_adhoc_routing.eps}
\caption{Categorisation of ad hoc routing protocols.}
\label{fig:adhoc_routing_cats}
\end{figure}
The bit in the square brackets on the first line tell LaTeX where to put the
figure. h stands for "here", t stands for "top of a page",
b stands for "bottom of a page", and p stands for "page of
floats". They are tried in order. ht works well for most purposes.
The second line is the location of the figure, relative to the current directory. The best figure format to use is Encapsulated PostScript (EPS), though other formats can be forced to work. If you don't yet have your figures in EPS format, use something like The GIMP to convert into EPS first.
The caption is self-evident. This text will also appear in the List of Figures; if you want them to be different, you can do something like:
\caption[lof_text]{Actual caption text}
The label is the anchor tag used for referencing the figure from elsewhere in the document. It's best to start it with fig: so that the prettyref package can be smart about things.
\chapter{Method}
\label{cha:method}
or
\sec{Definitions}
\label{sec:definitions}
The list of tags that you should use (the bit before the colon) is below, also
showing how they will appear in the output (shortref format).
| Tag | Where | How they appear |
|---|---|---|
| alg | Inside \begin{algorithm} ... \end{algorithm} | Algorithm A |
| app | Appendix chapters | Appendix A |
| cha | Regular chapters | Chapter 2 |
| fig | Inside \begin{figure} ... \end{figure} | Figure 3.4 |
| lem | Inside \begin{lemma} ... \end{lemma} | Lemma 1 |
| sec | Sections, subsections, etc. | Section 3.1.4 |
| tab | Inside \begin{table} ... \end{table} | Table 2.1 |
| thm | Inside \begin{theorem} ... \end{theorem} | Theorem 2 |
\prettyref{sec:definitions}
or
\shortref{sec:definitions}
The first form includes a page reference, whilst the second is only the short
form (as in the table above).
refs.bib in
Thesis-in-a-Box), and it is referenced from main.tex. The file
containing the entries only contains the raw data, and the actual layout is
done separately. There's lots of styles that can be used for bibliographies,
but my preferred style is included with Thesis-in-a-Box
(mybibstyle.bst). The selection of which style to use is made at
the bottom of main.tex (without the ".bst" extension), and other
styles you might like to try are amsalpha, amsplain,
abbrv, ieeetr or plain.
As for the actual bibliographic entries, they look a lot like this:
@inproceedings{Perkins94,
author = {C. Perkins and P. Bhagwat},
title = {Highly Dynamic Destination-Sequenced Distance-Vector Routing ({DSDV}) for Mobile Computers},
booktitle = {{ACM SIGCOMM} Conference on Communications Architectures, Protocols and Applications},
year = {1994},
pages = {234-244},
address = {London, United Kingdom},
note = {doi:~10.1145/190314.190336}
}
Thankfully you don't have to do it all by hand, since there are several tools
that give you a nice GUI for editing these files:
Remember that the idea is to put as much information into that file as you can,
and the style file will tell the LaTeX/BiBTeX system what to do. For example,
it's probably best to use full names in the bibliography file (not like the
example above!). More importantly: use a good key. Like the one above,
"Perkins94", it is easy to remember this when inserting citations (below).
It is not uncommon to cite several papers by the same author, so I recommend
using the system that I use (surname of first author plus year of publication).
So how do I insert an actual citation? Like so:
As mentioned in \cite{Perkins94}, some frogs are green.
The output will look different, depending on the bibliography style chosen. In
my style, they come out looking like [Perkins94]; other styles can give
you boring old numbers like [47] that are more traditional, but are not
as easy to use in practice.
Sample output using this style includes: