LaTeX-ing again

Here I am, sitting indoors during a snowstorm, blundering my way through my raytracing script.  Ah, Snell’s law and optics.  What fun!  Anyhow, I realized that it was the perfect opportunity to practice some LaTeX skills.  I’ll be able to describe the theory of what I’m doing in my script.  Not that it’s anything complicated, but it’s enough for me to be able to practice some TeX-style math notation.  Sweet.

Here’s what I’ve got so far, using Emacs.  Easy!  No math yet though.
[sourcecode language=”latex”]
documentclass[12pt]{article}
title{Raytrace script – how it works}
author{M. Weirathmueller}
date{1 January 2010}
begin{document}
maketitle

section{Indroduction}
This document is meant to accompany the my raytrace.py script, in an attempt to describe the theory behind what it’s doing.

The main idea is to read two sound speed profiles, and to compare depths computed by a multibeam echosounder for these profiles.

section{theory}

end{document}
[/sourcecode]

(incidentally – I just discovered that WordPress source code posting supports LaTeX – fun!)

It was also the first time I’d ever compiled a LaTeX file from the command line. I know, I know, it’s no big deal. But it was new for me!

Created my PDF like this:

[sourcecode]
pdflatex raytrace.tex
[/sourcecode]

Then looked at it in my PDF viewer like this:
[sourcecode]
gnome-open raytrace.pdf
[/sourcecode]

gnome-open just opens the file with the default program for that extension. Also – I added an alias to my .bashrc file so that just typing “g file.pdf” works like “gnome-open file.pdf”.

2 thoughts on “LaTeX-ing again

  1. This is a total n00b question, but is there a particular document that you would recommend to get off the ground with (La)TeX?

  2. Well, it sort of depends on what you want to do. If you just want a document that will run through LaTeX and produce a PDF file, you can just copy the text of the LaTeX file above into a text document. If you run it either through the command line, or through a LaTeX editor program, you should get some output (this is satisfying and also encouraging). You can then play around with changing content, and adding things like figures, equations, tables, etc. Have a look at the documentation here:
    http://www.latex-project.org/guides/
    It should help you get started. Good luck!

Leave a Reply to psykotedy Cancel reply

Your email address will not be published. Required fields are marked *