Hide menu

This is a short guide to install and start using the typesetting enviroment LaTeX

LaTeX is an environment for typesetting articles, thesis, books and so on. It is suitable for you to use when writing your reports, master thesis for example. This page describes how to getting started with LaTeX. Follow the installation description and download the example below, then you are up and running!

A very good thing is that every components you will need to use LaTeX is FREE!

Install LaTeX on a Linux (Ubuntu) machine

Just "sudo aptitude install texlive"
You will probably need additional packages, they are found by search in you package manager.
In KDE I like the LaTeX-editor "Kile", Kile also works under GNOME.

Install LaTeX on a Windows machine

A windows machine needs a number of programs installed to be ready for producing LaTeX-documents.
The environment implementation for Windows is called MiKTeX. To make ps and pdf:s you will need the Ghostscript interpreter. Finally, you need an editor to use when writing the actual LaTeX-code.

  1. Install Ghostscript. You can find it here. It is a good idea to also install GSview, which provides a graphical interface to Ghostscript (i.e. for showing .ps-files).
  2. Install the MiKTeX environment. You can find it here. Chose the "basic installer".
  3. Install an editor, I suggest the TeXnicCenter editor. It is a free editor. You can find it here. (At first start, point out the path to the file latex.exe i.e. "C:/Program Files/MiKTeX 2.7/miktex/bin/") TeXworks is a new cross platform LaTeX editor which is also really good, it can be found here.

When the installation is finished. Go to STARTMENU => All Programs => MiKTeX 2.7 => Settings
Go to "Packages", press "Change..." and choose a repository near you that are updated. I use a ftp repository in Danmark.
Go back to "General" and press "Refresh FNDB" and "Update Formats" a few times.

LaTeX-tips

Handy packages

To use a package include it in your preamble (before \begin{document}). For example to include the package texpower write on a lonely row:
\includepackage{texpower}

Here follows a list for practical packages to use. Information on how to use the packages are found at CTAN or just by searching the web.

  • amsmath, mathematical features.
  • booktabs, make nice tabulars.
  • graphicx, enhanced support for graphics.
  • listings, write blocks of programming code in your document.
  • psfrag, allow you to replace text in your figures. The text inside your figures will then be right size and font and so on.
  • subfig, allow subfigures.
  • todonotes, write notes in your document during writing.

Is there any support for the swedish language and typing rules?

The support for åÅ, äÄ and öÖ in LaTeX are not by default enabled. You can access them by typing:

å - \aa
ä - \"{a}
ö - \"{o}
Å - \AA
Ä - \"{A}
Ö - \"{O}


Another way is to enable the T1 font encoding. This is done by include the package fontenc with the option T1, it is done by include the row
\usepackage[T1]{fontenc}
and
\usepackage{lmodern}
in your preamble. (the lmodern package is a font package with support for the T1 font encoding)
You can also need to include
\usepackage[utf8]{inputenc} (Linux)
\usepackage[latin1]{inputenc} (Windows)
to tell LaTeX what character encoding you are using. (Linux uses utf-8 and Windows uses latin-1)
To get a swedish style of the document, swedish typographical rules and so on
\usepackage[swedish]{babel}
is a good package to use.

BibTeX for reference handling

BibTeX is a program that comes with most LaTeX packages. BibTeX is like an extension to LaTeX that produces handy and very good looking reference lists in your LaTeX documents. Is accessed by typing "\bibliographystyle{unsrt}" in the preamble to tell BibTeX what style you want in your document, in this case the style "unsrt" is chosen. Different styles can be seen here. Then you put the line "\bibliography{exempelreferens}" at the place where you want your reference list to appear. The "exempelreferens" is telling BibTeX that your references is defined in the file "exempelreferens.bib".
It is very handy to only have one BibTeX-file, i.e. myreferences.bib. Then you always store all your references in this file. As in the example below you do not have refer to all the references in your .bib-file, only that ones that you have referred to will appear in the reference list!

So why bother and use BibTeX?

  • You can keep all you references in one place in a very handy database (your .bib-file).
  • You can add comments and additional information in your database file. Only the right information will automatically show up in the reference lists.
  • The formating and numbering will automatically be handled for you.
  • The database is search-able, it will from now on be simple to find old references! Myself uses JabRef, it is a great program for adding, removing, searching, modifying, storing, etc. your references!

LaTeX-document example including BibTeX reference handling

Below is an example of a small LaTeX-document which uses BibTeX for reference handling.

The .tex-file: (Click on the code to download the source code.)

LaTeX code


 

The .bib-file: (Click on the code to download the source code.)

BibTeX code


 

The result will be: (Click on the document to download the resulting .pdf-file.)

Result from the code above


 


Is there a template to use for a Master Thesis at FluMeS?

-Yes, contact Peter Nordin, he have a custom template for Master thesis performed at our division. It is a built from the "liuthesis" template that can be downloaded from ISY, here.

FAQ - common questions from students

Here you can find common answers and questions on LaTeX.

Links

 


Page responsible: bjorn.eriksson@liu.se
Last updated: 2010-07-21