Showing posts with label latex. Show all posts
Showing posts with label latex. Show all posts

Wednesday, 16 October 2013

ShareLaTeX vs Microsoft Word in scientific writing: Part 1

A co-author and I are in the process of writing two scientific articles for submission to a meteorological journal. As these two papers will be similar in structure and content (obviously not too similar!), this gives me an opportunity to weigh the benefits of LaTeX-in-the-cloud versus the standard Microsoft Office Word application. So let the fight begin! In the cloud corner, I present the Chromebook Pixel:

Chromebook Pixel (left) with external monitor displaying PDF (right)

It's the best Chromebook out there right now, and was produced as more of a showcase for Chrome OS. It's got more power than most people need in a Chromebook. Also, it can simultaneously run Ubuntu Linux thanks to the Crouton project. This comes into play later in the post.

Next, in the local/MS Office corner, I present the Compaq Presario C700:



It's old, but still going. It runs Windows 8 (soon to be 8.1) and Microsoft Office 2013. Its battery is now useless, requiring constant hookup to the mains; fortunately, I can access it from my Chromebook remotely via Chrome Remote Desktop, if I need to be portable.

As with all good scientific sensitivity tests, I need to keep everything the same in both cases, and just change the variable I'm testing. Here are the other helpers in my paper-writing factory:

Bibliography management: Mendeley

First, I use Mendeley to manage my biblography. It's an "iTunes for scientific papers and PDFs", as I've once heard it described. It syncs all my PDFs (metadata and all) to the cloud, so I can access everything from the browser, or download a desktop program (Mac, Linux, Windows). Its major flaw for us Chrome OS users is the almost-impossible way to get PDFs into your online catalogue, as you can't download the application (and shouldn't need to!). Yes, this is a little extremely counter-intuitive for a cloud-friendly application, but that's the way it is right now. The best solution is to run Ubuntu on my Pixel when I need to upload PDFs, via the previously-mentioned Crouton solution. But if I just want to access my papers within Chrome OS, Metatato is a handy website (and Chrome extension) which mimics many features of the desktop Mendeley program.

When I'm using ShareLaTeX, I can upload a .bib file automatically generated by Mendeley. Then I can easily cite references within LaTeX (this ease is a major advantage of LaTeX over Word). And when I'm using Word, there is a plug-in that allows Word to import citations from Word, and automatically generate a bibliography. I've only had experience with ShareLaTeX; I will report back on Word-and-Mendeley integration in Part 2.

Figure creation: Google Drawings

I'm creating figures for publication with Python, but this is maintained on a separate server. I access the server via SSH from Chrome OS. The outputted images are then downloaded onto my Chromebook via a public_html folder on the server, and uploaded into Google Drawings if required (for annotating, combining etc). I've previously mentioned Google Drawings as a good all-round image editor. It can combine smaller images while maintaining their resolution (good for publications); it is good for quick schematic diagrams; it integrates well with other Google Drive office-style applications. It is easy to export (download) the final product as a .pdf to create good-quality figures for either Word or ShareLaTeX. And it certainly beats using Word or Powerpoint to mash together a diagram (often the case in academia it seems!).

Verdict: Using ShareLaTeX for collaboration

If the other person is not as comfortable using LaTeX, it can become difficult. A lot of people are much more comfortable with Word due to its malleable, What-You-See-Is-What-You-Get nature.

Example of ShareLaTeX.com screen, with code in the middle, and the compiled PDF on the right.

Otherwise, ShareLaTeX shows history of edits (with a paid account), has a chat facility, is accessible simultaneously by two (or more, with paid account) people, and compiles relatively reliably. I found that large documents (my thesis, for example) sometimes wouldn't compile, but this was only ever temporary and more likely to do with the huge volume of high-DPI figure files in my project.

The main advantages with (Share)LaTeX is as follows:

  • Seamless, easy management of bibliography
  • An organised folder of high-resolution figures that precludes the need to chase images round your Word document
  • Everyone has the same 'version'; no compatibility errors like with Word (both different years and different OSs!)
  • Fast help from the website developers when there were issues compiling
  • ShareLaTeX is free at its base feature level, which is sufficient for many people (poor students like me included)


    However, there are shortcomings:
    • Can be tedious when trying to get a manuscript to output perfectly in line with a journal's style guide. Sometimes, where a change would be a couple of keystrokes in Word, it would be a time-consuming Google goose-chase to track down the relevant 'hack'.
    • ShareLaTeX is still missing a mature 'track changes' equivalent for collaboration (and the ability to point fingers at whoever just deleted that supremely-written paragraph)
    • Some journals don't like LaTeX. Full stop.
    I hope to discuss these matters further when I begin the entire process again for the second paper, but in Microsoft Word. I look forward to sharing my experiences...

    Completing a Master's in the cloud

    As previously mentioned, I decided to do my Master's Thesis work on a computer running Chrome OS (a Samsung Chromebox). Including a HD monitor, keyboard, and mouse, it cost less than half the price of my colleagues' iMac desktop computers (running OS X). In fact, I started using an iMac before being offered a new computer of my choice, and chose the cheaper Chrome OS route. I'm not saying everyone can save money and do that; but I'd like to explain why I don't think a $1500 desktop computer is the right choice for everyone.

    Example of Chromebook and external monitor (rotated for easy reading of PDFs)

    First, my main tasks as a Master's student were writing essays for classes, writing my thesiscoding in Python and Matlab as part of my research, and putting together poster and projector presentations. Originally, on the iMac, this was completed using Microsoft Office Word, a local build of LaTeX, Mac's native Terminal, and Office Powerpoint, respectively. The iMac wasn't a newer model; it was creaking and slow, and the spinning beachball of death made a frequent cameo throughout. When I switched to the Chromebox, I gained speed and ditched frequent, large application updates. But I also had to create a new workflow. Here's how I did it.

    Writing

    LaTeX is my favourite way of creating a professional-looking manuscript, but for short class essays, it can be overkill. However, Microsoft Word can also be overkill. Google Docs does most of the same, basic tasks, and is frequently updated. It auto-saves every few seconds, is accessible on any computer with internet connection, allows download of .doc files for offline editing (or even switching to e.g. MS Word), and is excellent for collaboration (not that class essays required much of that).

    Google Docs


    ShareLaTeX.com


    When it came to long, organised manuscripts with many images and some mathematical typesetting, I required LaTeX. Luckily, ShareLaTeX.com is a fantastic free resource; it compiles 'in the cloud', meaning it's an all-in-one system to avoid requiring a local build of LaTeX for your typesetting needs. It was slightly slower to upload my figures, and compile remotely, but this downside was countered by frequent auto-saves, and the fact that packages were provided and administered by the website programmers. Less time worrying about admin; more time writing my thesis.

    Coding

    I was fortunate to have access to a university server with plenty of programming power. Chrome OS has an extension that lets the user SSH into another server or computer. In my case, I was harnessing the server's horsepower, and hence my local computer was a terminal with no need for a powerful processor: just the window to connect remotely. If I needed to do anything locally, however, I would have needed to either run a Crouton script (which installs a Linux distribution, such as Ubuntu, to be run alongside Chrome OS with no need to dual boot) or install a ChrUbuntu partition (requires a restart of the computer to boot into Ubuntu). Chrome OS, while based on Linux, does not allow installation of regular Linux applications without some severe modding.

    Presentations

    Google Slides (image created with Google Drawings)

    I ultimately presented my Master's defence in Google Slides, a free alternative to MS Office's Powerpoint. Not only does it automatically back up slides while editing, it can be used to present via a projector on any computer with the Chrome browser. It did not have many templates and some other flashier features found on Microsoft's paid competitor, but it was sufficient for a professional and reliable presentation. In terms of creating a conference poster, Google Slides has recently updated to allow for custom page sizing. I will report back on this when it comes to creating a poster for a conference I am attending in February.

    Other

    To create schematic diagrams, and to perform other image-editing functions, there were two programs that provided all the tools I needed. First, Google Drawings is a Paint-like web application which integrates well with Google Drive's free alternatives to MS Office. It works very well for combining high-resolution images (and keeping the resolution before downloading as a PDF). Second, the offline packaged app Pixlr Touch Up proved useful for changing colour images to black-and-white, cropping, and other basic photo and image tools.

    Overall, the Chrome OS experiment was a success, and I did not regret being an early adopter (I don't know anyone else who currently uses Chrome OS as their main OS for science research). If you have any workflow-related questions, or wondered if this kind of system would work for you, please use the comments section below.