This package provides:
This package consumes:
Made for Pulsar!
This package was written specifically for Pulsar and did not exist in the Atom package repository.
Compile LaTeX documents with latexmk and view PDFs. Includes SyncTeX support, integrated linting, and multiple build management.
latexmk with configurable engines.linter-indie.% !TEX program.To install latex-tools search for latex-tools in the Install pane of the Pulsar settings or run ppm install latex-tools. Alternatively, you can run ppm install asiloisad/pulsar-latex-tools to install a package directly from the GitHub repository.
This package requires latexmk and a LaTeX distribution to be installed on your system.
Windows:
macOS:
brew install --cask mactexLinux:
sudo apt install texlive-full latexmksudo dnf install texlive-scheme-full latexmksudo pacman -S texlive-most latexmkAfter installation, verify that latexmk is available in your PATH:
latexmk --version
Use the latex-tools:global-rc command to open your global latexmkrc configuration file. This file allows you to customize latexmk behavior, such as adding support for glossaries:
# Glossaries support
add_cus_dep('glo', 'gls', 0, 'makeglossaries');
add_cus_dep('acn', 'acr', 0, 'makeglossaries');
sub makeglossaries {
system("makeglossaries \"$_[0]\"");
}
Commands available in atom-workspace:
latex-tools:global-rc: open the global latexmkrc configuration file (creates with defaults if not exists).Commands available in atom-text-editor[data-grammar~="latex"]:
latex-tools:compile: (F5) compile the current LaTeX document using latexmk,latex-tools:toggle-compile-on-save: (Alt+F5) toggle automatic compilation when the file is saved,latex-tools:interrupt: (Ctrl+F5) stop the current build process for the active file,latex-tools:interrupt-all: stop all running build processes,latex-tools:clean: (F6) remove auxiliary files generated during compilation,latex-tools:clean-linter: (Alt+F6) clear all linter messages,latex-tools:kill-and-clean: (Ctrl+F6) interrupt the build and clean auxiliary files,latex-tools:open-pdf: (F7) open the generated PDF in Pulsar,latex-tools:synctex: (Alt+F7) jump from source to corresponding PDF location (forward SyncTeX),latex-tools:open-pdf-external: (F8) open the generated PDF in an external viewer.This package works seamlessly with the pdf-viewer package:
You can specify the LaTeX engine per-file using magic comments at the top of your .tex file:
% !TEX program = xelatex
\documentclass{article}
...
Supported engines: pdflatex, xelatex, lualatex
The magic comment overrides the global engine setting in the package configuration.
The package supports compiling multiple LaTeX files simultaneously. Each file tracks its own build state independently, allowing you to start a compilation in one file while another is still building. The status bar updates to show the build state of the currently active file.
The package provides a latex-tools service (version 1.0.0) that allows other packages to integrate with LaTeX compilation and SyncTeX.
In your package's package.json, add the consumed service:
{
"consumedServices": {
"latex-tools": {
"versions": {
"1.0.0": "consumeLatexTools"
}
}
}
}
Then in your package's main module:
consumeLatexTools(service) {
// Subscribe to build events
this.subscriptions.add(
service.onDidStartBuild(({ file }) => {
console.log(`Build started: ${file}`);
}),
service.onDidFinishBuild(({ file, output }) => {
console.log(`Build finished: ${file}`);
}),
service.onDidFailBuild(({ file, error, output }) => {
console.log(`Build failed: ${file}`, error);
}),
service.onDidChangeBuildStatus(({ status, file, error }) => {
console.log(`Build status changed: ${status}`);
})
);
// Get current status for a specific file
const { status, file } = service.getStatus(filePath);
// Check if a specific file is currently building
const building = service.isBuilding(filePath);
}
| Method | Description |
|---|---|
onDidStartBuild(callback) |
Called when a build starts. Callback receives { file }. |
onDidFinishBuild(callback) |
Called when a build succeeds. Callback receives { file, output }. |
onDidFailBuild(callback) |
Called when a build fails. Callback receives { file, error, output }. |
onDidChangeBuildStatus(callback) |
Called on any status change. Callback receives { status, file, error? }. |
getStatus(filePath?) |
Returns status for a specific file or all builds if no path provided. |
isBuilding(filePath) |
Returns true if the specified file is currently being compiled. |
syncToPdf(file, line, column) |
Forward SyncTeX: returns { page, x, y } for PDF position. |
syncToSource(file, page, x, y) |
Backward SyncTeX: returns { file, line, column } and opens the source. |
'idle' - No build in progress'building' - Build is currently running'success' - Last build completed successfully'error' - Last build failedGot ideas to make this package better, found a bug, or want to help add new features? Just drop your thoughts on GitHub — any feedback's welcome!