tags: ,

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.

\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}


(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:

pdflatex raytrace.tex


Then looked at it in my PDF viewer like this:

gnome-open raytrace.pdf


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

January 8, 2010 10:05 am

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

January 8, 2010 10:19 am

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/