Recently, due to some project work i had the need to learn to use LaTeX to create my documentation. But as i was googling around for it i found a plethora of stuff that utterly confused me. Hence, This document gives an overview of LaTeX and how get started with it on GNU/Linux
Introduction to TeX
TeX is a typesetting program created by Donald Knuth of Stanford University with the aim of composing quality content that contains a lot of mathematical and technical expressions. It is also suitable for producing all sorts of other documents, from simple letters to complete books. TeX provides Device Independent output(dvi) which contains details only regarding references to fonts and positions of characters on the screen. This output can be used by various printers to convert it to their desired format like pdf, postscript etc.
What is Typesetting?
A type is a way characters look usually called a font. Type-setting is the process of putting characters (of a certain type) in their correct place (layout) on paper or screen.
What is LaTeX then?
TeX by itself is a macro compiler i.e it maps a higher level instruction into a sequence of device independent instructions. LaTeX provides a set of useful macros, which uses TeX underneath to produce the device independent output. LaTeX was introduced by Leslie Lamport, a researcher i admire for his innovation. Similar distributions of TeX include ConTeXt, AMS-TeX etc.
There are 3 main things you ought to be aware of to get started with LaTeX
Writing TeX files
The TeX files is the ASCII specification i.e which is written in characters available on the keyboard. You can use any text editor of your choice to write it – vim, emacs etc..
Here are some good areas to get started on learning to write tex files.
- The (Not So) Short Introduction to LaTeX2e
- This document by Tobias Oetiker is good for beginners
Setting up LaTeX
- Usually most distros of GNU/Linux come with latex pre-installed. If not please check your software sources for a TeX package or install TeX Live directly.
- For Ubuntu you can install it by
$ sudo apt-get install texlive
Once done you have a plethora of options available to you
Converting TeX files
Convert the tex to dvi$ latex program_to_convert.tex
Convert dvi to postscript$ dvips -Pcmz your_dvi_file.dvi -o output_file.ps
Convert tex to pdf directly$ pdflatex program_to_convert.tex
Convert postscript to pdf$ pdf2ps your_file.ps your_file.pdf
Convert pdf to postscript$ pdf2ps your_file.pdf output_file.ps