Atom: Compile latex in the editor - how it works
In the well-known editor Atom you can not only program, but also compile LaTeX. In this practical tip, we will show you the packages and additional software required for this.
Compile LaTeX in Atom: You need these extensions
Most TeX and LaTeX distributions such as TeXStudio or Texmaker have their own editors. But if you've worked with Atom before, you don't have to get used to a new environment. You need the following tools to compile with Atom LaTex:
- Atom needs a separately installed LaTeX distribution to compile. The raw text can then be converted with this. In theory, you can use most packages for this. In this article we use MiKTeX. This distribution brings only the most necessary tools and requires little storage space. All packages required later can be automatically reloaded in the background. MiKTeX is also available for Windows, MacOS and Linux.
- In addition to the Atom editor, you need the latex package. This executes the LaTeX commands in the background from Atom.
- Optional: In order for Atom to highlight the LaTeX commands in the editor window, you should also install the language-latex package. So you always have a good overview within your document.
Atom: Install LaTeX Distribution
Download MiKTex or a distribution of your choice and carry out the installation with the standard parameters. You may have to specify the installation path later in Atom. We will show you in detail how to install LaTeX under Windows in another practical tip.
- After installation, you will get an overview of all installed program parts with the corresponding paths in the MiKTeX Console in the "Settings" tab. You can also set here that missing packages should be installed on-the-fly (recommended).
- Under "Packages" you can see which packages have been installed so far. Here you can also manually remove or add packages.
- Every now and then you should check under "Updates" whether a new MiKTeX version is available. You will also find updates for packages that have already been installed.
Atom: Set up the LaTeX package
Install the latex package as usual in Atom in the "Packages" menu under "File" -> "Settings". After the installation you can make further changes by clicking on "Settings".
- The most important thing is the correct path to the installed TeX or LaTeX distribution. The path in which you previously installed MiKTeX should appear under "TeX Path". If this is not the case, insert the correct path to the folder here.
- With the "Keybindings" you can see the shortcuts with which you can operate the package even faster.
- Under "Clean Patterns" you can select which files in the project folder are to be deleted with the Clean command. For example, you can exclude PDF files here and always keep the last compiled PDF file in the folder. If you compile again, the old file will be overwritten.
- You can make many more configurations. But first you should try the default settings.
Atom: Compile LaTeX - how it works
When you have completed all of the previous steps, you can now test the function.
- To do this, you first need a * .TEX file, which you compile as a test. You can either write them yourself or search the Internet for short test instructions. It's best to limit yourself to simple commands to test your Atom setup.
- Save the file and then press "Build" in the "Packages" menu under "LaTeX". At the bottom left, the arrows next to the "LaTex" lettering indicate that the process is running.
- When compiling for the first time, the process may take a few seconds. MiKTeX automatically installs necessary packages in the background. If the process fails, you will see a number by the red exclamation mark in the lower left corner. In this case you can click on "Show Log" in the "Packages" menu under "LaTeX" and see what is stopping the process. You may then be able to manually install the missing packages in the MiKTeX Console.
- If everything went well, the compilation runs without errors. Atom automatically creates files in the same directory as your * .TEX file. Among other things, you will find the finished PDF file here.
- Now you can expand your source code as you like and recompile it again and again to see your result.