Doing a PhD right: Lyx

This post is a part of the series "Doing a PhD right".

Thankfully, long gone are the days since I had to do battle with MS Word in a never-ending war to get figures and paragraphs aligned.

In this post I introduce a vital piece of software that I strongly recommend for PhD students from any field. At the very least I hope that it results in your ditching of MS Word.

Introduction to Lyx

Latex editors take care of paper/report formatting (and more) for you, leaving you to focus entirely on the content. I can honestly say that it saves me dozens of hours every year. In short: please stop using MS Word.

There are many latex editors available such as Overleaf and Kile. I greatly prefer and recommend Lyx as it does an excellent job of keeping the latex code behind-the-scenes, rarely requiring you to intervene in it. With the press of a button, Lyx is able to take your content and somewhat magically output a formatted PDF to the exact style requirements of the journal/conference publisher.

The published output is formatted automatically as per the journal's style requirements, through a downloadable Latex style file from their site

Getting started

When starting out, it will definitely take a few days to adapt to the Lyx way of doing things. When writing content you must designate what the content is (e.g. is it a section, abstract, title etc.). By default your content will be set to Standard. To make a designation, click on your text and select from the dropdown in the top-left:

Setting your content type informs how Lyx should publish the content, as well as keep track of headings and content. When you are ready to submit it is likely that the journal/conference has a latex style file available for download, which you can configure into Lyx. The latex style file will apply the correct style properties to each content type, such that your title, abstract, headings, and even the number of columns required is all automatically included in the output PDF.

To publish to PDF, go to Document →  View (PDF (pdflatex)), or there is an icon on the top bar. By default Lyx comes with some pre-installed style files, viewable at Document → Document Class. Installing new ones that are downloaded from the journal/conference website can be quite confusing the first time and requires its own guide, so please look online for assistance.

Bibliography (citations list)

Gone will be the days of dealing with EndNote/Mandaley in combination with MS Word. Lyx has great support for a number of reference managers, however I highly recommend JabRef. It is free, very easy to use, and just works.

To add it to your paper go to Insert → List/TOC → Bib(la)Tex Bibliography, and browse to your JabRef file. To insert citations into your paper from your JabRef repository, there is the Insert Citation button on the navigation bar:

Keep in mind that all of the navigation bar items can be remapped to keyboard shortcuts. Particularly useful is a keyboard shortcut to the Insert Citation button.

Adding citations to your paper runs much smoother compared to using EndNote with MS Word, which I find always has a bit of lag when performing actions.

Upon outputting your paper to PDF, your citations will automatically be compiled and formatted all according to the journal/conference style requirements, as well as automatic addition/removal of references as per your in-line citations (much like EndNote, but quicker).

The above are the foundations of how to get started with Lyx. After a few days of use you'll adapt to the Lyx workflow, and I guarantee when you've published that first paper via Lyx, that it will be the point where you'll official swear off MS Word for good.

Additional notable features

Lyx has a strong development community on GitHub and thus has many features added regularly. Below are some of the more notable features that really enhance its usefulness for writing papers.

Content labels

Assigning labels to your sections/figures/tables allows you to reference it in your text elsewhere in your paper, done via the Insert Label button on the navigation bar:

Then with the cross-reference button you can apply your reference:

Lyx does an outstanding job of handling the numbering and reference to the label, even if you move the label to a different spot in the paper. Very handy.

Easy reordering of your document outline

One of my favourite features is the ability to easily reorder my paper's sections and paragraphs. Pressing the various arrows will automatically shift things around whilst simultaneously keeping the proper formatting, section numbering and cross-references!

This feature is infinitely more convenient than the classic 'copy+paste' approach we are so used to.

Scientific Notations and Mathematical Formulas

If you need to write scientific notations or mathematical formulas, you're probably already using a Latex-based program. If you're still using MS Word however... yikes.

Figures and Tables

It is an absolute breeze adding, sizing, and placing figures and tables with Lyx. In MS Word, the second I move a figure even one millimeter, paragraphs seem fly around the entire document on their own accord.

With Lyx, place your figure/table, set its size and placement (e.g. one or two columns, top/bottom of page), and it handles the rest for you.

Customization

One of the crucial things I first like to do is change the colours of the interface, in particular the background and the colour of notes. Go to Tools → Preferences → Look and Feel.

You can also spend considerable time configuring your keyboard shortcuts and the navigation bar icons. The benefits of being able to so extensively customise will continue to grow over time as you realise how much more streamlined your work process can become.

Negatives of using Lyx

While I advocate highly the use of Lyx, do be mindful of these negatives before diving in too quickly:

  • There is a bit of a learning curve, and it will take you at least a few days to adapt to the Lyx way of writing papers
  • Only Lyx can edit/view .lyx files, which means that when you are working with others they too will need to be using Lyx (you cannot import/export to MS Word easily)
  • Installing style files (downloaded from journals/conferences) for the first time can be very confusing
  • If things go wrong (for example with formatting) it can be more difficult to find answers online compared to MS Word, however if you work in a research institute there are very likely already latex users present who may assist

Conclusion

The above was only a brief introduction to Lyx, but I hope you can take the time to explore its feature set yourself. Its ease of use, the time that it will save you, and most importantly the option to avoid battling MS Word for formatting are all what ultimately lead me to so strongly recommend its consideration. And if it isn't Lyx that you choose, that is perfectly acceptable... just please stop using MS Word.