Writing a PhD thesis

A grandiose title page.

I finished writing my PhD thesis a few weeks ago. It sort of fizzled out at the end – lots of little, irritating tasks to do even after all the writing it done. Before I started writing, and as I was writing, I often looked for blog posts and other material on how to write a thesis, and so, whilst it’s still fresh in my mind, and in the hope that someone else may benefit or at least be entertained, here are my thoughts:

There seem to be two types of issues when writing a thesis, technical and actually writing it. The technical stuff is a bit drier, so I’ll leave the details of how I edited the text until the end. Spoiler alert – it involves a lot of latex and pythons.

Writing

Drawing images is fun and took up a lot of time.

I started writing in August, and came up with an outline of my thesis in the forms of section headings in chapters. Sergey (my advisor) and I discussed this layout and made some minor changes, but the biggest changes came during the writing process. Often, they were frustrating and set me back by weeks, as Sergey found a different, better way to present the arguments and data. I resented some of this ‘extra’ work at the time, but it definitely made the thesis better overall.

Sergey’s particular trick, which I learned and then began to apply in advance, is to go from a narrative format (I did this experiment, then this experiment, then this experiment) to a textbook format (we know these things, and these things, and these things). This usually means taking data and presenting it in figures in contrast to other data. The text then discusses the similarities and differences. If this seems obvious and straightforwards, then you’re well on the path to being a good scientist! To me it was difficult, because it was only after writing the narrative version that I began to spot the similarities and difference between different data sets.

I didn’t write the chapters in order. On Sergey’s advice, I started with a description of the diagnostics I used, before going on to write about the results, then a discussion of the results, followed by the conclusion. I went then back to write the preliminary work, only including what I needed to buttress the rest of the thesis, before finishing off by writing the introduction and theory section.

I would usually try and make all of the figures I needed as I went along, in contrast to others who have told me they made all the figures they wanted on Monday and then spent the rest of the week writing about them. My problem is that as I wrote I would usually change the figures, and then have to go back and revise the old ones, and so writing about the figures as I went along allowed me to spot these necessary changes and implement them quickly.

I never wrote at home. An office environment is an excellent place to focus, and aside from one attempt to write half a chapter on the Oxford Tube as it careened around some side roads, avoiding an accident on the M40, I rarely wrote outside of an office. Without a mouse and a large screen it’s difficult to do the drawings I need in Illustrator, and without the drawings I have nothing to write about.

For the first four months I had trouble focusing, with interruptions to help in the lab, preparing for conferences and spending too much time reading the news. It took four months therefore to write three chapters out of seven. I returned from my Christmas break and surveyed the path ahead of me. My funding runs out on March 1st, and I have four chapters to write in two months. Shit.

Look at that death stare – Sibelius probably wrote a thesis at some point. By fi:Daniel Nyblin (1856–1923) – What We Hear in Music, Anne S. Faulkner, Victor Talking Machine Co., 1913., Public Domain

So I got serious. To drown out the noise I made long playlists of symphonic music (mostly Sibelius and Bruckner) which I would listen to without pause. At lunch I’d eat at my desk, watching cartoons online. I worked a strict 8:15 am to 5 pm for six weeks, bouldering three nights a week and slightly alarming my office mates and colleagues. In six days I had first drafts of three chapters, and set my sights on the final one. Sergey was slightly overwhelmed by the amount of work I was asking him to look through, and initially just skimmed through to look at the figures, which as you are gathering, are a major part of my work.

I began to relax and enjoy writing again, but I decided to keep the pressure on and finish as soon as possible so that I didn’t have to think about it any more. I was almost entirely done by 24th Jan, eighteen days after I got back to work. All that was left was a few days of ensuring copyright notices were appended, checking spelling in the bibliography and writing the acknowledgements.

Writing a thesis was a lot harder than I had anticipated. Initially, I thought that it would be fun or at least tolerable, and the fact that everyone else I had spoken to thought otherwise just indicated they didn’t have the right attitude. This was spectacularly naive, as I began to fully appreciate within the first month, where I would find myself drinking more and more low quality espresso in a desperate attempt to convert caffeine into words. I can’t really think of a way to make the experience more pleasant – certainly several people I’ve spoken to have had the same pattern of taking ages on the first few chapters and finishing up the last few very quickly, so perhaps that’s a consolation to bear in mind.

Technical Stuff

I wrote my thesis in Latex, one file per chapter, using includes. This means quicker compile times as you only need to compile each chapter at any time. I used Daniel Wagner’s template to ensure my margins etc. were compliant, and I chose Palatino as a font so that my math text matched nicely. I used one sentence per line to make error finding easier, and this made it straightforwards to use git to manage my thesis (private repo on github). Having version control like git was really useful, especially when reworking large parts of the text.

Figures were done using Illustrator, with one file per chapter and using artboards the width of my text. Latex can include specific pages of a PDF as figures, so I produced one PDF per chapter. Figures with data were done solely in python with matplotlib, and I had several long jupyter notebooks with all the necessary code. These figures were usually saved as PDFs unless PNG gave a drastically smaller filesize. Matplotlib was set to output figures the width of the text, which meant that I could specific eg. size 10 font and know it would exactly match that in the text.

Landscape triptych – to get the best viewing side, this fills an entire A4 page.

I spent a while writing a neat script to handle figures that fill entire landscape page. The latex file can either produce a print version, in which the figure is rotated onto a portrait page, or a digital version in which the page is rotated (a lot easier for reading on a screen!).

I took a while playing with Biblatex to get [Surname, YEAR] as the citation key, which was DEFINITELY WORTH IT. I also defined plenty of macros for things like x=X mm or JxB which kept cropping up. If I’d done this earlier on I would’ve saved a lot of time.

I definitely learned a lot whilst writing this thesis about Latex, Illustrator, Python and Matplotlib. Looking back there are quite a few things I’d do differently, but making those mistakes was part of the process and probably character building or some tosh like that.

I’m not submitting my thesis for another few weeks as I’d stop being a student and lose my lab insurance before starting my post doc in March, so for now I just help out in the lab and pretend that I’m a post doc already.

Leave a Reply

Your email address will not be published. Required fields are marked *