After midnight, part 4: LaTeX

Tuesday 11. December, 2007

What has happened since the last blog entry? Well, I’m not sick anymore and I live on my own now (okay, it’s relative “on my own”).

Unlike the previous After midnight -posts, this isn’t actually about a programming language.

Do you know “Structured text processing” (Rakenteellinen tekstinkäsittely, in Finnish)? It was the fancier name for our university’s LaTeX-typesetting course. It’s like text processing, but not at all like it. Today everybody uses these “What You See, Is What You Get” software (M$ Word, OpenOffice.Org Writer), but no one has ever hear that you could type those documents with a TeX-system. Usage of LaTeX is quite a bit different from those wysiwyg-programs as you don’t see what you get until you have compiled the tex file into something more readable such as DVI- or PostScript-file.

Personally I’m impressed by the looks of the documents I have made so far.

If you want to try it out, you need a LaTeX-environment, see MikTex. Then you need the Ghostscript-software. You probably want GSView too. You can write tex-files with Notepad or any text editor, as those files are more or less pure ascii-text. If you really start using LaTeX, I suggest you to download TexMaker. It’s free (open source) LaTeX editor and available for Linux systems too or if you are using Linux, you can also try out Kile editor and if you are using Ubuntu, you can install all you need with “apt-get install kile”. Besides the editor, this should pull all required packages including LaTeX-system.

I suppose our text processing environment is now installed and working (well, you probably don’t know if it is working yet)

Open up you editor, so we can start writing our first LaTeX-document. It all begins with lines

Hello this is our very first \LaTeX-document.

Save it and if you are using Texmaker, there should be a button with text “LATEX”, push it. If your specified paths are correct (you can check them in settings), the latex-system now compiles our document into a dvi-file. The animal button next to LATEX-button opens up a dvi-file viewer and you should see your document there.

The commands given above first define the type of our document, which is “report” with font size 12pt. All options in [] are optional, where {} are required. Without required parameters the compilation will fail. You probably have noticed that all Latex commands begins with \. The \begin{document} defines a document environment and \end{document} will end it. Everything you write and want it to be seen in the final document must be written inside the document environment.

For more information on LaTeX resides in the “doc”-folder inside your miktex installation (if documentation was installed). There’s also a folder named ‘guide’ or ‘guides’ in which resides a tutorial to LaTeX-system. You can also find a lot of information on latex with the help of Google.

(I can’t write a complete tutorial here as this is only a blog posting nor could I do it anyway as I’m not very familiar with LaTeX by myself. If you find these instructions too complicated to understand, leave a comment and I’ll try to help)