James's Den

Computer Stuff

I run Ubuntu Linux as my main OS these days, and as anyone who runs an open source operating system knows, the temptation to tinker can be hard to ignore. Occasionally, that tinkering pays off, and this page has a few bits and pieces that some of you may find interesting.

Some LaTeX Styles

In the course of my maths PhD, I've had to develop a couple of new style files for LaTeX, where stock LaTeX was missing the features I needed. Previously, these style files were buried in the source code for LaTeX documents that no-one was likely to look at, so I decided to package them up so anyone could find and use them.

Thesis Titlepages for amsbook

My university, like many others, has pretty anal regulations about the layout of thesis title pages. Unfortunately, document classes such as amsbook don't include the necessary fields on their title pages by default, so it's necessary to use custom code.

There are currently two main ways people deal with this, and I'll explain why I don't like either of them:

  • Template files: At most universities, the most experienced LaTeX user has usually made up a thesis template, that anyone is free to use. These are perfect if you're just starting out, as they give you a ready-made template to start from. However, they're no good if you've already started writing your thesis. Even if they can be added to an existing thesis (by means of a style file, for example), they can be problematic, as they usually auto-include various packages and macros that you may not want, and mean adding kludgy, non-standard code.
  • Custom Made Title Pages: If you're an experienced LaTeX user, creating a custom titlepage with the \begin{titlepage} environment isn't too tricky. However, you then need to modify headings to include titles or authors, and it means messy non-standard code. In particular, if you're using something like LyX that creates titles with \maketitle, you're boned. Also, it breaks the separation between content and style that LaTeX values so highly

My new theshead.sty LaTeX style automatically tweaks the title page to conform to the Newcastle University thesis submission guidelines, when used in an amsbook document. It doesn't require any changes to the structure of the document, and where possible, it uses information provided by the amsbook class (like \title, \author, \address and \date), as well as adding a couple of other fields, in a similar vein (\degreeclass and \logo). It works with LyX, and doesn't change anything beyond the title page.

Colour Changes in The Beamer smoothtree Theme

In my Beamer presentations, I like to have different colour for sections on different subjects. With most Beamer themes, you can acomplish this with code like

\definecolor{refresh}{RGB}{255,0,0}
\setbeamercolor{structure}{fg=refresh}

which gives subsequent slides a red colour scheme. However, the smoothtree theme doesn't work properly with this code, as it fixes some of the colours at the beginning of the document.

NewSmooth.sty is a slight modification of the smoothtree theme, that removes this limitation. It slows down compilation a touch, but on modern computers this means less than a second's difference.

Both style files are available in this archive

NewSmooth.sty can be distributed under the GPL v2, or the LPPL v1.3. theshead.sty can only be distributed under the LPPL v1.3. This is due to code inherited from other style files.

Rock, Paper, Scissors

A few years ago, I discovered that a friend of mine could consistently beat another friend of mine at rock, paper, scissors. The friend in question was reasonably bright – he wasn't just playing "rock" every time – and that set me off wondering if a computer could do the same.

Apparently I wasn't the first to ask this question; it turns out the University of Alberta had been running a computer Rock Paper Scissors competition for a couple of years. I thought it'd be interesting to pit the best of the bots against a human player, so I got the testing suite they used, and made some modifications to allow a human to compete instead. The package includes the source, a windows version, and a linux version. Go ahead and try it out.

Links

I can't take any credit for these things, but I've found them useful; so might you.

  • Ultimate Gnome: Not as macho as it sounds. A nice scalable icon set for GNOME.
  • xFX Screensaver Settings: A replacement for gnome-screensaver-preferences, which gives you access to more settings.

This site was created with KompoZer and Screem. Contact me at james_pic@hotmail.com. Unless otherwise stated, all material on this website is released into the public domain.

For optimal viewing, Internet Explorer users should either download MathPlayer, or use a better browser.