Hey there! I have an important news... Click here to read it.x

Atom for LaTeX editing


Wednesday 3 February 2016 by

Matteo Merola

  • LaTeX
  • Atom

Atom for LaTeX editing cover image

After having done the experimental work required for my master thesis, I finally decided to start writing it (considering that my graduation is scheduled for next March I think it is time to do it 😁) and, of course, I decided to write it with LaTeX.

Ah the simplicity and beauty of the old good LaTeX!

But where do I have to start from? Firstly I'd need the environment, then a good editor (maybe with integrated controls for compiling and 💩), then a good and light PDF reader. For you to know, I'm running Mac OS X as you can see from the figure below.

My Mac

Ok, I already had the environment set up so fuck it, first problem solved. Preview on the Mac is a very good PDF reader so no extra need of other software but... how am I supposed to write my thesis??? Here comes the story.

I remember that when I wrote my bachelor's degree thesis I did it using TeXworks but I remember as well that it has been a huge pain in the ass. So, I started to look for a different editor, maybe one with integrated controls for compiling, bibliography etc...

I found TeXnicle, a very good piece of software, free and rich of features so I thought that my research was over. I downloaded it and used it a bit but I also found out that I was not liking it. Maybe too many crashes or not so clear UI, I don't know very well. I didn't like it (yes I know I am strange 😁). I decided to give a try to Texpad from the Mac App Store, a very good and complete native app for writing LaTeX documents. I download the trial version and I used it a bit. I really like it, extremely well done.

But, eventually, every trial comes to an end.

Texpad costs 27.99 €, and that is too much for my poor and empty pockets. Of course I have tried to download a cracked version of it!!! I am joking 👼 (no I'm not 😈).

Then, I said to myself: "Hey you, why don't you try to customize Atom, it is a very good editor for development and it has a plethora of very well done packages that could help you with almost everything!". And so I did. I'm writing this blog post to share my set up with you in case you are in the same position in which I was some days ago.

I will show you the result of my configuration, my Atom looks like this at the moment:

atom-latex-look-like

To change UI colors and theme I used a package called Atom Material both for UI and for syntax, check it out, it's amazing.

To obtain support for transforming Atom into a fully featured LaTeX editor I installed the following packages:

  • autocomplete-bibtex: this gives you the possibility to use snippets and advices as you type in your bibliography file. Of course you need to have installed autocomplete-plus package into your atom environment, but everyone has got it so you probably already have got it.
  • language-latex: this is to add syntax highlighting for LaTeX to Atom. A very good package.
  • linter-chktex: this is a linter that uses chktex and it is useful before compiling to avoid committing errors and to avoid warnings.
  • spell-check: this is to obtain a spell check analysis to avoid committing linguistic errors (only works with english). You must then activate the analysis for .tex files otherwise it will not work.
  • latexer: for adding another layer of LaTeX completion suggestions.
  • latex-plus: for adding the compiling features, a very handful cmd+: shortcut to compile your project.
  • pdf-view: to allow Atom to open and view PDF file inside an editor tab instead of launching the default system application for displaying this kind of files.

Along these necessary packages, I found very useful having installed these other handful extensions.

  • dictionary: this package integrates Mac OS X Dictionary.app inside Atom. With a ^+cmd+k shortcut you can fire the dictionary application on the word on which the caret is on. Handful, right?
  • zen: distraction-free writing sometimes is what you need, just ^+cmd+z and enter the zen modality, nothing will distract you from writing anymore.
  • wordcount: need to be careful about the words you are writing? You solved your problems man. Be careful as this package does not ignore LaTeX language tokens.
  • git-plus: gives to Atom the ability to git add push commit even single files or the whole project, sometimes it fits the situation, some others not but it is worth a try.
  • project-manager: organize the projects you are working on and efficiently switch among them all in a while. I find it useful 😉.
  • minimap: this package shows a mini map of the current file you are editing, very useful to visually scroll large files.

To customize a bit my new LaTeX editor I decided to remove the line numbers from the viewport cause I don't need them. So I had to add the following to my Atom styles.less file.

atom-text-editor {
  &[data-grammar~=latex]::shadow {
    .gutter-container {
      display: none !important;
    }
  }
}

That's all for now! I hope you enjoyed the reading and I hope to finish my thesis soon 😂. If you have questions of curiosities about this article just use the comment section below. I leave you some images that will let you have a sneak peak of how Atom will look like and what will be the possible configurations of some packages.

Bye-bye! 👋👋👋

Example of wordcount package

atom-wordcount

Configuration screen shot of latex-plus package

atom-latex-plus

Usage example of git-plus package

atom-git-plus


Do you like?

Drop me a line just to let me know you like (or you don't XD) this post ;)

Comments