CSci 4511w: Latex notes
Typesetting your papers: information on LaTeX
The simplest way of getting up to speed on Latex is to use a
web based version of latex.
Create a free account at
https://www.overleaf.com/.
or
https://www.sharelatex.com/.
The two companies have joined. Overleaf allows multiple users to work
on the same files, while sharelatex allows only one user for the free
accounts. The systems are quite similar.
Click on Create a New Paper (on overleaf) or New Project (on sharelatex).
You'll be given a sample latex document,
with some text, an image, a table, etc and
a bibliography. Modify the text to be what you want and look at how
citations are done. To understand how to write bib entries read
Bibliographies with BibTeX. It seems a lot but it is easy.
Many sites will provide references in bib format.
Resources to learn LaTeX
LaTeX implementations
- Visit TUG, the
TEX Users Group site. Here you can get documentation here
and visit the pages of different packages.
Look at
Getting Started with TeX, LaTeX and Friends for information on
installation and documentation.
- CTAN,
the Comprehensive TEX Archive Network, is the home of all
packages, tools, and documentation.
- TeX Live is a good distribution
for Unix/Linux and Windows. It is the one used in the Department.
- MiKTEX is another
good distribution for Windows.
Recommended for Windows is proTeXt
a MiKTeX-based distribution for Windows.
Typesetting your papers: basic LaTeX instructions
To get started with Latex, create a file, let's call it myfile.tex,
that countains the following:
\documentclass[12pt]{article} % 12 points is a good size, but you can use 11
\usepackage{fullpage} % more lines and longer lines per page
\begin{document}
\title{Whatever}
\author{your name}
\maketitle % generates the title
..... whatever you want to write. To divide into sections use something like
\section{Introduction}
\section{Background}
....
\section{Conclusions}
\end{document}
To generate the output run pdflatex myfile
You can easily generate bibliographic citations, by creating a
bibliography file (.bib), specifying in your document what style you want,
for instance
\bibliographystyle{plain}
and the name of your bibliography file
\bibliography{mybibliofile}
and running
bibtex myfile
After running bibtex, you need to run pdflatex
again twice (latex goes through your file once, so forward references cannot
be filled in a single pass).
If you want include a table, a picture, or an equation in your paper,
here are a few quick instructions:
- For tables, look at
Tables.
For instance, if you want a table to show the
timeframe for remaining work, you can do
something like this:
\begin{tabular}{l | l}
Topic & Expected completion date \\ \hline
Read related work & November 6 \\
Install software package XYZ & November 20\\
... & ... \\ \hline
\end{tabular}
- For pictures, look at
Importing Images, which
explains how to use the package graphicx. It is not the only package
for graphics, but it is widely used and very simple. If you use a latex
implementation under Windows that generates directly the pdf file (under
linux it is called pdflatex) you can include figures in different
formats, including .png and .jpeg. It is always a good idea to include a
caption and figure number for your figure. Look at
Floats, figures, and captions for how to do it.
For example,
\documentclass[12pt]{article}
\usepackage{graphicx}
....
\begin{document}
...
\begin{figure}[ht]
\includegraphics[width=4in]{mypicture.eps}
\caption{\label{mypict} This is a sample picture}
\end{figure}
- For equations look at
Mathematics - Part 1.
To include the equation in the text use $ ... $,
to produce it on a separate line without an equation number use
\[...\],
to produce it on a separate line with an equation number use
\begin{equation} ...\end{equation}. For instance, $x^2$ will produce
x2 in the text, \[ x^2 \] will produce x2 on a
separate line with no equation number. If you need to use special
symbols (greek letters, math symbols, arrows, etc) you can find a
list at
https://en.wikibooks.org/wiki/LaTeX/Special_Characters and in other places.
For more advanced use of math look at
Mathematics - Part 2.
- For references, you need to use bibtex, which allows to specify
references of different types
(journal article, book, conference paper, technical report or thesis, etc).
You can look at
Bibliographies with BibTeX for details on how to do bibliographies in Latex.
Copyright: © 2019 by the Regents of the University
of Minnesota
Department of Computer Science and
Engineering. All rights reserved.
Comments to: Maria Gini
Changes and corrections are in red.