True Type Fonts in LaTeX: a brief guide

Adding new fonts to LaTeX doesn’t have to be painful…

One of the things I love about \LaTeX is how customisable it is.  Separating content from design a long time before web design cottoned on to this.  However, out of the box, \LaTeX comes with very limited fonts and most people just use these defaults, mainly because setting up other fonts isn’t as easy as it should be.

One of the great things about drawing diagrams in \LaTeX is that the fonts match, it’s always a little jarring to my eye when I see papers with a mismatch between diagrams and main text.  However, sometimes you just can’t control what’s in your diagram or you want something a little more modern than Times New Roman for whatever you’re putting together.

So how do you go about doing this?  Like most things, the answer is “it depends”… let’s start with an assumption that you’re starting from scratch and if you’re already a few steps down the process then that’s just less work for you to do 🙂 Continue reading True Type Fonts in LaTeX: a brief guide

Diagrams with LaTeX – easier than you might think

Diagrams like this are easy to do in LaTeX

I’ve written before about the power of literate programming, using \LaTeX to create reports when code runs.  It’s fairly simple to combine this with the graphical drawing packages to create impressive graphs and figures on the fly.  A lot of academics I’ve spoken to have shied away from using \LaTeX for drawing, despite being very proficient with the textual layout.  Similarly, a lot of students on the OU Mathematics degree write up all of their assignments in \LaTeX but drop in hand drawn graphs and diagrams.  Just like anything else in \LaTeX, once you get your head around how it works, it’s actually not that difficult to create very complex structures. Continue reading Diagrams with LaTeX – easier than you might think

Literate programming – effect on performance

Example from the MNIST data set used in this experiment
Example from the MNIST data set used in this experiment

After my introductory post on Literate Programming, it occurred to me that while the concept of being able to create documentation that includes variables from the code being run is amazing, this will obviously have some impact on performance.  At best, this would be the resource required to compile the \LaTeX document as if it was static, while the “at worst” scenario is conceptually unbounded.  Somewhere along the way, pweave is adding extra code to pass the variables back and forth between the python and the \LaTeX, how and when it does this could have implications that you wouldn’t see in a simple example but could be catastrophic when running the kind of neural nets that my department are putting together. So, being a scientist, I decided to run a few experiments….1 Continue reading Literate programming – effect on performance

Using Literate Programming in Research

Literate Programming by Donald Knuth
Literate Programming by Donald Knuth

Over my career in IT there have been a lot of changes in documentation practises, from the heavy detailed design up front to lean1 and now the adoption of literate programming, particularly in research (and somewhat contained to it because of the reliance on \LaTeX as a markup language2).  While there are plenty of getting started guides out there, this post is primarily about why I’m adopting it for my new Science and Innovations department and the benefits that literate programming can give. Continue reading Using Literate Programming in Research