Convert Figma logo to code with AI

latex-lsp logotexlab

An implementation of the Language Server Protocol for LaTeX

1,679
57
1,679
62

Top Related Projects

Boost LaTeX typesetting efficiency with preview, compile, autocomplete, colorize, and more.

5,746

VimTeX: A modern Vim and neovim filetype plugin for LaTeX files.

14,998

A web-based collaborative LaTeX editor

Quick Overview

TeXLab is an implementation of the Language Server Protocol for LaTeX. It provides intelligent editing support for LaTeX documents in various text editors and IDEs that support the LSP. TeXLab aims to enhance the LaTeX editing experience with features like autocompletion, linting, and formatting.

Pros

  • Cross-platform compatibility, supporting Windows, macOS, and Linux
  • Integrates with multiple editors and IDEs through the Language Server Protocol
  • Offers advanced features like autocompletion, linting, and formatting for LaTeX documents
  • Actively maintained and regularly updated

Cons

  • May require additional setup depending on the editor or IDE being used
  • Some features might be limited compared to dedicated LaTeX-specific editors
  • Performance can vary depending on the size and complexity of LaTeX projects
  • Learning curve for users new to LSP-based tools

Getting Started

To use TeXLab, you need to install it and configure your editor to use it as a language server. Here's a basic guide:

  1. Install TeXLab:

    cargo install --git https://github.com/latex-lsp/texlab.git
    
  2. Configure your editor to use TeXLab as a language server for LaTeX files. The exact steps depend on your editor, but generally involve adding TeXLab to your editor's LSP configuration.

  3. Open a LaTeX file in your configured editor and start using TeXLab's features like autocompletion and linting.

For detailed setup instructions for specific editors, refer to the TeXLab documentation on GitHub.

Competitor Comparisons

Boost LaTeX typesetting efficiency with preview, compile, autocomplete, colorize, and more.

Pros of LaTeX-Workshop

  • More comprehensive feature set, including PDF viewer and synctex support
  • Larger user base and more frequent updates
  • Extensive configuration options for customization

Cons of LaTeX-Workshop

  • Heavier resource usage due to its broader feature set
  • Steeper learning curve for new users
  • Potential for conflicts with other LaTeX-related extensions

Code Comparison

LaTeX-Workshop (settings.json):

"latex-workshop.latex.tools": [
  {
    "name": "latexmk",
    "command": "latexmk",
    "args": [
      "-synctex=1",
      "-interaction=nonstopmode",
      "-file-line-error",
      "-pdf",
      "%DOC%"
    ]
  }
]

texlab (settings.json):

"texlab.build.executable": "latexmk",
"texlab.build.args": [
  "-pdf",
  "-interaction=nonstopmode",
  "-synctex=1",
  "%f"
]

Both extensions offer LaTeX language support for VS Code, but LaTeX-Workshop provides a more feature-rich experience at the cost of complexity, while texlab focuses on core language server functionality with a lighter footprint.

5,746

VimTeX: A modern Vim and neovim filetype plugin for LaTeX files.

Pros of vimtex

  • Deeply integrated with Vim/Neovim ecosystem
  • Extensive feature set including compilation, viewing, and syntax highlighting
  • Large and active community with frequent updates

Cons of vimtex

  • Limited to Vim/Neovim users
  • Steeper learning curve for new users
  • May require additional configuration for optimal performance

Code Comparison

vimtex:

let g:vimtex_compiler_method = 'latexmk'
let g:vimtex_view_method = 'zathura'
let g:vimtex_quickfix_mode = 0

texlab:

{
  "latex.build.executable": "latexmk",
  "latex.build.args": ["-pdf", "-interaction=nonstopmode", "-synctex=1"],
  "latex.forwardSearch.executable": "zathura"
}

Both projects aim to enhance LaTeX editing, but they take different approaches. vimtex is a comprehensive plugin for Vim/Neovim users, offering a wide range of features tailored specifically for these editors. texlab, on the other hand, is a language server that can be used with various editors supporting the Language Server Protocol, providing a more editor-agnostic solution for LaTeX development.

14,998

A web-based collaborative LaTeX editor

Pros of Overleaf

  • Web-based collaborative LaTeX editor with real-time synchronization
  • Integrated PDF preview and compilation
  • Large template library and easy document sharing

Cons of Overleaf

  • Requires internet connection for full functionality
  • Limited customization compared to local LaTeX environments
  • Potential privacy concerns with cloud-based storage

Code Comparison

Overleaf (server-side rendering):

app.get('/project/:id', (req, res) => {
  const project = loadProject(req.params.id);
  res.render('project', { project });
});

TeXLab (client-side processing):

pub fn process_latex(document: &str) -> Result<String, Error> {
    let ast = parse_latex(document)?;
    Ok(generate_output(ast))
}

TeXLab focuses on providing a Language Server Protocol implementation for LaTeX, enhancing local development environments. It offers features like code completion, diagnostics, and formatting. Overleaf, on the other hand, is a full-fledged online LaTeX editor and collaboration platform.

While TeXLab integrates with various editors and IDEs, Overleaf provides a complete web-based solution. TeXLab offers more flexibility for users who prefer working locally, whereas Overleaf excels in collaborative scenarios and provides a more accessible entry point for LaTeX beginners.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

CI Wiki GitHub release CTAN

TexLab

A cross-platform implementation of the Language Server Protocol providing rich cross-editing support for the LaTeX typesetting system. The server may be used with any editor that implements the Language Server Protocol.

Demo

Getting Started

If your editor extension like does not install the TexLab server automatically, you will need to install it manually. We provide precompiled binaries for Windows, Linux and macOS. Alternatively, you can build TexLab from source or install it using your package manager. For a list of supported package managers, you can take a look at Repology:

Packaging status

Requirements

A TeX distribution is not strictly required to use the server but TexLab cannot compile your documents without one. TexLab supports compiling using Tectonic. For an example configuration, please see here.

On Windows, you may need to install Microsoft Visual C++ Redistributable for Visual Studio 2015.

Building from Source

You will need to install the following dependencies to compile the server:

  • A recent, stable version of Rust

Then run the following command in the project folder:

cargo build --release

Avoid installing texlab from crates.io because we don't publish new versions of the server to the registry, anymore. Instead, you can use

cargo install --git https://github.com/latex-lsp/texlab --locked --tag <insert version here>

Usage

After installing an editor extension, you can simply start editing LaTeX files. All editing features work out-of-the-box over all files in the currently opened workspace. There is no need for magic comments like %!TEX root and TexLab should figure out the dependencies of a file on its own. Note that you may need to set the texlab.rootDirectory option for some multi-folder projects.

TexLab features a variety of options which can be used to configure features like building or forward search.

See the Wiki for more information.

Development

You can create a debug build by building the server without the --release flag. The resulting build can be used with the Visual Studio Code extension by adding the absolute path of the target/debug folder to your PATH environment variable.

TexLab has an extensive test suite of unit and integration tests. You can run them by executing

cargo test

in the project folder.

Contributing

See CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Maintainers

License

GPL-3.0