Atom-LaTeX is an extension for Atom.io, aiming to provide all-in-one features and utilities for latex typesetting with Atom.
Atom-LaTeX is currently under active development. More features coming soon. Some features have screenshots/screencasts available here. Have a check!
- Compile LaTeX with BibTeX
- Preview PDF with build-in viewer
- Parse LaTeX compiling log
- Autocomplete
- Syntax highlight
- Direct and reverse SyncTeX
If you figured out some features neat but not included, create an issue!
Unification provides seamless experience. Aiming to make it work and work perfectly.
- LaTeX distribution in system PATH. For example, TeX Live.
- MiKTeX does not ship with SyncTeX, but basic build and preview and non-SyncTeX related features work fine.
- Set LaTeX root file.
Installing Atom-LaTeX is simple. You can find it in the atom.io package registry, or simply run apm install atom-latex
in command line.
For cutting edge features or changes, you can check out this repository to the Atom package folder:
- Windows
%USERPROFILE%\.atom\packages
- Mac/Linux
$HOME/.atom/packages
All commands can be invoked from Package
-Atom-LaTeX
menu or by command palette. Alternatively, keybinds are provided. Each command is invoked if the two key combinations are pressed sequentially.
For reverse SyncTeX from PDF to LaTeX, use ctrl+Mouse Left Click in the PDF viewer to reveal the line in editor.
Mac OS users can use command key as a replacement of ctrl.
Command | Default Keybind | Function |
---|---|---|
atom-latex:build |
ctrl+L ctrl+B | Build LaTeX file. |
atom-latex:build-here |
ctrl+L ctrl+H | Build LaTeX using active text editor file if possible. |
atom-latex:clean |
ctrl+L ctrl+C | Clean LaTeX auxillary files. |
atom-latex:preview |
ctrl+L ctrl+P | Preview generated PDF file with in-browser viewer. |
atom-latex:kill |
ctrl+L ctrl+K | Terminate current LaTeX building process. |
atom-latex:synctex |
ctrl+L ctrl+S | Direct SyncTeX from the current cursor position. |
atom-latex:toggle-panel |
ctrl+L ctrl+L | Toggle Atom-LaTeX panel display. |
Atom currently does not provide per-project configuration. Atom-LaTeX uses a .latexcfg
file under the root directory of LaTeX project to partially control its behavior. Following is a complete example of its content.
{
"root" : "\path\to\root\file.tex",
"toolchain" : "%TEX %ARG %DOC"
}
If a key is set, the config will overwrite the global one in atom settings.
LaTeX root file is essential to Atom-LaTeX. Building, preview, autocompletion, and more features rely on its proper configuration. You can select to manually set the file by clicking the home
icon on the control bar, or let Atom-LaTeX automatically find it given proper project structures:
{ "root" : "\path\to\root\file.tex" }
- Create a
.latexcfg
file at the root directory of your project. The file should contain a json object withroot
key set to the root file. An example:{ "root" : "\path\to\root\file.tex" }
- Add a magic comment
% !TEX root = \path\to\root\file.tex
to all of your LaTeX source file. The path can be absolute or relative. - Open the root file and use
Build Here
command. Alternatively, useBuild LaTeX from active editor
menu item. - If all previous checks fail to find a root file, Atom-LaTeX will iterate through all LaTeX files in the root directory.
You can choose one or multiple methods stated above to set the root file.
LaTeX toolchain can be controlled by either atom configuration or .latexcfg
file under root directory. If LaTeX projects need special toolchain, one can add a toolchain
key to this file. An example:
{ "toolchain" : "%TEX %ARG %DOC" }
This example will only use the defined compiler in atom configuration to build the project. Alternatively, you can also have this example that provides the same functionality:
{ "toolchain" : "pdflatex -synctex=1 -interaction=nonstopmode -file-line-error -pdf %DOC" }
- Open setting panel of build-in package
spell-check
. - Add
text.tex.latex
to theGrammars
edit box.
- Creat issues for bugs
- Fork and PR for fixes
- Thank you so much!