LaTeX - installation and introduction

LaTeX is a typesetting system used for formatting text documents, references, mathmatical formulas and tables in f.ex. scientific and technical articles.

Norsk versjon - LaTeX - installasjon og introduksjon

Looking for something else? Topic page about Software for students | Pages tagged software

Availability #

LaTeX is freely available for anyone.

Installation #

LaTeX is available via For most linux-distributions, LaTeX is available as packages. If you are on Windows, you can use for instance MiKTeX as a compiler, or you can use PCTeX which has a built-in compiler. If you are an OS X user, you can install LaTeX by downloading the MacTeX package. NTNU has a license agreement for PCTeX, while both MiKTeX and MacTeX are freely downloadable online.

Using LaTeX #

First, you need a source file. This is created with normal text editing software, for instance notepad++, vim, emacs, pico, edit, TextPad etc. Many of these have built-in support for syntax highlighting LaTeX code. You can also utilize an IDE (Integrated Development Environment) for LaTeX, such as TeXnicCenter, PCTeX for Windows and Kile for Linux. An alternative for MacOS X is TextMate.

LaTeX commands #

All LaTeX-commands begin with the command name, which is a backslash ( \ ) followed by either text or a single letter. Arguments in square brackets ( [] ) are optional, while arguments in curly brackets ( {} ) are mandatory. LaTeX is case-sensitive.

A standard LaTeX document #

All LaTeX-documents adhere to this structure:

.... this is where you add your text ....

class must be one of the valid classes article, report, letter, book etc.

Printing and displaying the document #

In most cases, you will be interested in converting the LaTeX document to a PDF-document. There are two ways of achieving this, and which one you decide to use largely depends on which image types you are using in the document.

Converting to PDF with common image types #

If you are using common image formats such as JPG, GIF, PNG and so on, you can use a command called pdflatex. This command will convert a LaTeX document directly to PDF.

Converting to PDF with EPS-images #

If you want to use EPS images, you will need to convert the document to a DVI-document first, then to a PostScript-document, and lastly to a PDF-document.

You have created a file with the name test.tex. You will then need to run the command latex test.tex, or use a suitable tool in the software you are using. LaTeX will read the file, typeset it, and save it in the file test.dvi (DVI is short for DeViceIndependent). This file can then be printed, or converted to PostScript (PS).

Converting from DVI to PS #

To convert the file to PS, run the the following command://dvips filename.dvi -o resultfilenameAlternatively, you can use a suitable tool available in the software you are using.

Converting from PS to PDF #

To convert to PS, run the following command://ps2pdf. If you run ps2pdf, the file filename.pdf will be generated in the same folder.

MathTime font set #

Users of LaTeX can use many different fonts. The font used if nothing is specified is called Computer Modern, which is not always the best-looking. To remedy this, NTNU has purchased a site-license for the font set MathTime Professional 2.

This font set contains mathematical symbols for use with fonts of the font-family Times.

All employees and students may use these fonts, both at NTNU and on their personal computers.

Installing MathTime in MiKTeX #

The necessary files can be found in the folder campus\PCTeX\MathTimePro\Kilde\Windows\Utpakket at Progdist. There are guides on how to connect to Progdist for studenter, og for ansatte.

The instructions in this section were made for MiKTeX version 2.4.1461, and assume that the texmf-tree for MiKTeX is under C:\texmf, as well as the local texmf-tree being at C:\localtexmf. This will be the case for most MiKTeX-installations.

  1. Copy all folders at campus\PCTeX\MathTimePro\Kilde\Windows\Utpakket\texmf to C:\localtexmf.
  2. Edit the file C:\texmf\web2c\updmap.cfg in a text-editor, and add the following line at the bottom of the file:
  3. Start the software MiKTeX Options by going to Start - MiKTeX, and MiKTeX Options. In the General tab, click Refresh now and Update Now.
  4. Open a command line window (in Windows XP, this can be done by pressing CTRL+R, entering cmd and hitting Enter). In the command line window, write konsoll #1
    and hit Enter.

Installing MathTime in teTeX #

The required files can be found at campus\PCTeX\MathTimePro\Kilde\Windows\Utpakket on Progdist. More information on how to download software from Progdist is available for for students and for employees.

The instructions in this section were made for teTeX version 2.x. The organization of a teTeX-installation and configuration files varies, and standard folder structure depends on the operating system and distribution. File paths in this section reflect an installation on Ubuntu Linux version 5.10

  1. Copy all folders at campus\PCTeX\MathTimePro\Kilde\Windows\Utpakket\texmf to /usr/local/share/texmf.
  2. Edit the file /var/lib/texmf/web2c/updmap.cfg in a text editor, and add the following line at the bottom of the file:
  3. Run the command konsoll #2

Using the font set #

To start using the font-set, you can add the following lines document preamble:


The package mtpro, however, has a lot of different options, and we recommend skimming the following reference for more information about them, and on how to use the font set with additional packages: dokumentet\campus\PCTeX\MathTimePro2\Kilde\Windows\mtpro2.pdf

  • WikiBooks - LaTeX - a very good resource for all LaTeX users, with many useful examples.

Contact #

Orakel Support Services can help if you encounter difficulties installing PCTex (or equivalent tool), but do not offer help with the use of LaTeX software. If you are an NTNU employee, consult your local IT Support.

0 Vedlegg
17339 Visninger
Gjennomsnitt (0 Stemmer)