LaTeX in the Atom Editor

A fast guide to setup and use LaTeX for Atom on Mac. Including auto update on PDF viewer window while editing and reference sheet for syntax, and a syntax exemplar project.

rsashna
4 min readJan 9, 2021

Setup

First and foremost, download the latex installer and follow the instructions. For Mac we use MacTex (this will have to be downloaded from their website)

Note: MacTex downloaded takes 6.74 gigs of space! (at least when I was downloading it)

Check if the Install Worked

Check if the install worked by looking for the make file in terminal:

latexmk

This might give an error because of permissions, uninstalled software, etc. The following addresses the issues. If no errors occur, skip this section and go to the ‘Set Up Atom …’ section.

which latexmk

This should show a path to /libraby/tex/texbin

Get TeX Live Utility

TeX Live Utility is not automatically installed for Mac as of Aug 30th 2020, its a known issue and the following link is listed listed under /Applications/TeX in PDF ‘missing apps’ when getting MacTeX.

Use this link to download it instead https://amaxwell.github.io/tlutility/

The app location should be in /Volumes/TeX Live Utility/TeX Live Utility.app

Security Block

Opening the app causes this error message popup:

“TeX Live Utility” can’t be opened because it is from an unidentified developer.

Go to: system preference> security and privacy> general, at the bottom of screen click the “open anyway” button

Opening up the app, you should be able to see the installed packages. And running the following in terminal

latexmk

should return a message and no errors.

Set Up Atom for Automatic PDF Update and View

Install these Atom packages:

https://atom.io/packages/latex
https://atom.io/packages/pdf-view
https://atom.io/packages/language-latex

At this point, you should have a working LaTeX editor on your Atom. I recommend a few changes to the configurations so the PDF can be updated on each save. Within the Atom editor, do the following

Go to Atom dropdown -> Preferences -> Packages. Go to Settings of the latex package and:
* [check] Build on Save (or stick to default using the build shortcut)
* [uncheck] Open Result after Successful Build
* [uncheck] Open Result in Background
* Under Output Directory, type “build”

In language-latex package:
* [check] Soft Wrap

Navigation in Atom

When you make a .tex file and save it it should now automatically create a build folder, some extra files and a .pdf of the file you are coding on. Each time the .tex file is saved, it will update these files. You can ignore most of the build folder files, but sometimes the .pdf gets created inside there instead of the .tex location.

The most efficient way to work on the latex file and see the PDF updates are to split the screen as follows:

Split screen for Atom. (This is a guide I made for LaTeX syntax in LaTeX, it’s linked at the end)

The errors and warnings log at the bottom (! symbols) can be clicked. If there is an error the .tex file cant compile and the PDF and other files wont update.

A Quick(er) Intro to LaTeX-A Guide

Heres a link to my project files on GitHub. This pdf and the associated .tex file should be all you really need to make simple documents. You can take the project and compile it locally to match the code with the PDF output.

It covers symbols, fonts, page formatting, alignment, columns, tables, images and figures, margins spacing and MiniPages that behave like textboxes.

https://github.com/rsashna/quickLatexExemplar

Note: since you are probably using this for professional reasons, remember that .tex files are not spellchecked. Atom spell checks .txt files though, so importing .txt pages can be useful.

Other References

Since I didn’t want to recreate the ‘The Not So Short Introduction to LATEX’ textbook (hint: its not at all short), here are some useful websites and links to resources

Margin and paper sizes
https://www.overleaf.com/learn/latex/Page_size_and_margins

The Not So ShortIntroduction to LATEX
http://ctan.mirror.colo-serv.net/info/lshort/english/lshort.pdf

A more in detail ‘Setting up LaTeX on your Atom Editor’
https://towardsdatascience.com/setting-up-latex-on-your-atom-editor-7ea624571d50

Fonts from CTAN
https://www.ctan.org/tex-archive/fonts

Colours available in LaTeX:

Aand now that document making should be as easy as scanning the PDF guide (or websites), copy pasting the code, and modifying it to your needs!
Happy Documenting :)

--

--