# You're reading: Posts Tagged: Matthew Scroggs

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