What tools do I use for writing?

Earlier today I was asked about what tools I use when writing. This is not something I have written about here on the blog before, although I do have very strong opinions on my own tools. I actually really enjoy reading about how other people work, so writing about it here may perhaps also be interesting to others.

Text editor: Atom

Most of my writing, whether it is e-mail drafts, meeting notes, or academic papers, is done in the form of plain text files. I use different text editors dependent on what computer/platform I am working on, and that is also one of the beauties of text files. They work everywhere. On my main laptop (running Ubuntu Studio), I primarily use Atom as my main text editor. This is mainly because it is cross-platform, has some plugins that are useful, and has excellent integration with Github.

Most of the time I write using markdown, which is just a structured way to write text files. The nice thing about markdown formatted text files, is that they can easily be converted to other formats using Pandoc. I often have to send off files as either PDFs or DOCX files, and this can easily be done with a terminal command such as:

pandoc file.txt -o file.pdf 

Yes, it is a nerdy way of writing things, but working in a text editor (as opposed to a word processor) is just so much quicker for many things. I use quite a lot of advanced query-replace functions, for example, and then regular expressions are useful. I also like to be able to do multiline editing.

Academic writing: Overleaf

I usually start my academic writing with notes in markdown, but as soon as I start to get into the proper writing mode, I convert into LaTeX. This is also a text-based format, but with a slightly more complex (and also more powerful) syntax than markdown.

Since most of my academic writing these days is collaborative, I almost only work in the web-based LaTeX editor Overleaf. This editor makes it possible for multiple users to work on the same document, and it also handles the compiling into PDFs very nicely. Being a web app, you don’t have to install LaTeX locally on your own computer. This makes it much easier for people to get started with LaTeX than it used to be only a few years ago.

Academic references: Zotero

Zotero is my current reference manager. It is not perfect, but I like that it is cross-platform (and by that I mean Windows, OSX, and Linux), it has a web interface, and it synchronizes between systems. There is a connection from Zotero to Overleaf, but I have found this to be somewhat shaky. So most of the time, I just export a BibTeX file of my complete library from Zotero, and import that .bib file in Overleaf.

Other collaborative writing: Google Docs

When I am writing non-academic texts with others, such as administrative documents, reports, and so on, I typically use Google Docs. I have been using it for several years now, and it really shines when it comes to collaborative writing and editing. I try Office 365 from time to time, but it just cannot compare to the trouble-free collaboration I experience in Google Docs.

Word processor: LibreOffice

When I have to use a normal word processor, it is usually LibreOffice. I never start writing in LibreOffice myself, so this only happens when someone sends me a .docx file that they want me to look at. Fortunately, LibreOffice handles .docx files well most of the time. So I am able to edit documents using “track changes” and send them back to people using MS Word.

In those few cases where LibreOffice does not manage to handle the .docx documents I receive, I connect to a remote desktop at the university and fire up MS Word. This is typically when there are some weird macro functions in the document, or some strange fonts. Fortunately, this happens only once in a while.

Summing up

All in all, I am quite happy with my current set of tools. Relying on text files has worked well for me for many years now. They are also the most future-proof solution I can think of. My software tools will continuously be replaced, but I am sure that plain text files will be around for a long time.

Unofficial ERC Starting Grant LaTeX template

erc2013-B1After I mentioned that I used LaTeX for an ERC Starting Grant application in a previous blog post, I have gotten several questions from people about what type of LaTeX template I used. Unfortunately, the ERC does not provide any LaTeX template, only templates for MS Word and OpenOffice. My scientific workflow is so dependent on LaTeX/BibTeX that I decided to recreate a LaTeX document setup that resembled the MS Word template. The end result is not identical to the MS Word output, but it is pretty close. The most important is that I did not get any complaints from the ERC about the looks of the document (and I made it to the final Brussel interviews last year, though not getting funded, unfortunately).

Sharing is fun, so if anyone wants to save a little bit of time, here you can get a stripped-down version of my LaTeX file:

Please be aware that this template is absolutely unofficial. Also, the ERC tends to change the template a little from year to year, so you should always check with the latest MS Word template. Good luck with the application writing!

LaTeX fonts in OSX

When creating figures for papers written in LaTeX, I have found it aesthetically unpleasing to have different fonts in the figures than in the text. Most figures I create in either OmniGraffle or Matlab, and here I have relied on regular OSX fonts.

Fortunately, I have discovered that it is possible to use LaTeX fonts in OSX. Apparently, this is now included as a feature in the latest version(s) of the MacTeX distribution (?), but I also discovered that it is possible to just download the fonts (as OTF files) and install them directly:

  1. Download the latest Computer Modern (Latex) Unicode fonts, the ones with *otf.tar.xz extension, from sourceforge

  2. Uncompress the archive

  3. Open the OSX application “Font Book”

  4. Drag all the OTF files onto the Font Book

The end result is that the fonts show up in all OSX applications. All the font names start with CMU, so it is easy to find them when opening the font dialogue in your application.

Cmu Font Book

Compact bibliography list in LaTeX

I have already written about how to compact lists earlier today. Now is the time to compact the bibliography… This is how the regular bibliography in LaTeX looks like:

First I found a suggestion to use the setspace function, but it turns out that it is much easier to just use the bibsep option to natbib. Just add the following to the preamble:


and you will get something like this:

Compact lists in LaTeX

I have for a long time been struggling with making lists more compact in LaTeX. While the standard lists often look good, as seen in the example below, there are times when space limits, etc. makes it necessary to save some space.

Screen Shot 2011 11 02 at 10 32 02

Up until now I have been using things like the rather ugly \vspace{-7pt} command to remove space between list items. Now I finally decided to figure out a better solution. While there are many different package to help with this, it seems like the enumitem package is the newest and most comprehensive solution for making compact lists.

It is possible to change the settings of individual lists, but it may be easier to change the settings globally. Then you need to add this to your preamble:


And you can then use the regular itemize function in LaTeX. The above example will then look like this:

Screen Shot 2011 11 02 at 10 32 13

This way you can remove the space between each item, between the list and the surrounding paragraphs, and the indention of the list items.