## Wikier

### 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

#### Innholdsfortegnelse [-]

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 login.stud.ntnu.no. 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:

\documentclass{class}
\begin{document}
\end{document}

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 filename.ps, the file filename.pdf will be generated in the same folder.

• 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.

3686 Visninger