Getting Ready to Write LaTeX

Ok, so let's get you writing a scientific paper using LaTeX.

Getting LaTeX itself

If you use linux, then there's probably a package (or a set of packages) for your distro. If you use ubuntu, then you can probably just do something like:

sudo apt-get install texlive-latex-extra

If you use windows, then you'll need MiKTeX.

For the OSX, you'll want MacTeX

This will set up a LaTeX system on your machine, including a bunch of frequently used libraries and a compiler. If you're using MiKTeX and you ever try to compile a document that uses a library you don't have, it may offer to get it for you from the net. If you're using ubuntu, the texlive-latex-extra package probably contains all the libraries you'll ever need.

To compile a document, open up a console or DOS window, cd to the directory containing your code, and type "latex mydocument.tex" (or whatever the name of your document is).

Getting an Editor to write your LaTeX with

You will need an editor of some kind to actually edit your LaTeX files. If you have a favourite editor for writing programs, then you can probably use that. Most good general purpose programming editors have syntax highlighting and so on for LaTeX.

If you don't already have a favourite editor, I suggest one of the Big Two: either vim or emacs. Both work well in linux, OSX and windows. I'm unusual in that I go through 8-18 month phases of using each of them exclusively. Most people seem to pick one and stick with it for life. The editor I'm using right now to write this page (in February 2012) is emacs 24. In my department, there are many Professors who use vim, and also many who use emacs. Famous emacs users include Don Knuth, RMS, ESR, JWZ, and Neal Stephenson. Vi[m] users include Bill Joy, Paul Graham, Charlie Stross, Don Stewart and Tom Christiansen.

If you're using ubuntu, you can install both editors like this:

sudo apt-get install vim-full
sudo apt-get install emacs emacs-goodies auctex

You can download emacs for windows here or for OSX here.

Vim for all platforms is available here.

Both are editors are ancient and powerful. Check out their wikipedia pages sometime if you don't already know about them. If you don't even want to read that much then know this: Emacs users start emacs at the beginning of the day, use emacs all day, then quit emacs just before shutting down and going to sleep at night. They heavily customise their emacs. Vim users start vim when they need to edit something, edit it, save and quit. They may have many instances of vim running at once, possibly on many different machines. They value the uniformity of the experience. All servers have a vi of some kind installed on them (vim is vi on steroids), so vi users are comfortable anywhere. A disproportionate percentage of sysadmins are therefore vim users.

If you want something that looks and feels as similar to a regular windows editor as possible, while still being able to handle things like LaTeX, then I suggest cream.

Cream is a version of vim which is designed to look and feel more like a windows program, and less like a unix one. The cream editor trades intuitiveness for efficiency. So it can do all the things that vim can, but will probably require more keypresses to do so. People who like the pure vim editor usually really care about being able to do complicated things in as few keypresses as possible.

Writing LaTeX

Now, once you've got a LaTeX install and an editor, you can get writing your document.

If you google for LaTeX tutorial or learning LaTeX, you'll find a lot of guides and things. Here's one of them.

I'm afraid I no longer remember how I learned LaTeX, so I can't point you at the resource I used. It was probably rubbish anyway.

To get you started, here are a bunch of files:

a skeleton of a report document.
a couple of example macros. You should write more.
a bibliography database.
What all the output of all the above should look like after you've run it through LaTeX.

I suggest you put them all in the same directory and play.

Good luck, and have fun!