For the unitiated LaTeX is not a rubber based derivative, it is a logical document preparation language developed by Leslie Lamport and based on Donald Knuth’s TeX. It is available for most platforms including Windows and Linux. To get a good introduction look at LaTeX: User’s guide and Reference Manual by Lamport.
This page gives some LaTeX bits and bobs that I’ve written over time.
LaTeX tricks gives some useful techniques that aren’t necessarily particularly hard to do, but whose existence is buried rather deep in the mass of documentation that accompany any LaTeX system. This includes rotating tables, dynamically including source code files and doing word counts.
LaTex includes a package ifthen that gives it basic programming control structures. In a (very) bored moment I fiddled around with this to produce a prime number tester. So, in the interests of geekiness, here it is. The LaTeX source or a really uninteresting example pdf output.