# You're reading: Posts Tagged: CTAN

### nimsticks: LaTeX package for drawing Nim sticks and games

A while ago on this blog I shared a LaTeX macro I had written for drawing games of Nim. I have now taken the plunge and written this into a LaTeX package called nimsticks. (Why? What do you do to relax on a lazy Sunday morning?)

Here is the description of the nimsticks package:

This LaTeX package provides commands \drawnimstick to draw a single nim stick and \nimgame which represents games of multi-pile Nim. Nim sticks are drawn with a little random wobble so they look ‘thrown together’ and not too regular.

What this does it allows commands such as \nimgame{5,3,4} which renders like this:

### realhats: Writing a $\LaTeX$ Package

A few months ago, Adam Townsend went to lunch and had a conversation. I wasn’t there, but I imagine the conversation went something like this:

Adam: Hello.
Smitha: Hello.
Adam: How are you?
Smitha: Not bad. I’ve had a funny idea, actually.
Adam: Yes?
Smitha: You know how the \hat command in LaTeΧ puts a caret above a letter?… Well I was thinking it would be funny if someone made a package that made the \hat command put a picture of an actual hat on the symbol instead?
Adam: (After a few hours of laughter.) I’ll see what my flatmate is up to this weekend…
Jeff: What on Earth are you two talking about?!

As anyone who has been anywhere near maths at a university in the last ∞ years will be able to tell you, LaTeΧ (or $\LaTeX$) is a piece of maths typesetting software. It’s a bit like a version of Word that runs in terminal and makes PDFs with really pretty equations.

By default, LaTeΧ can’t do very much, but features can easily added by importing packages: importing the graphicsx package allows you to put images in your PDF; importing geometry allows you to easily change the page margins; and importing realhats makes the \hat command put real hats above symbols.