jupyterlab/jupyterlab-latex

Support popular TeX rendering engines

Closed this issue · 0 comments

Problem

Currently, the extension supports pdflatex, xelatex and similar options that has the same command structure, so that one can easily swap between them. I would like to create an out of the box support for more LaTeX rendering engines and document the usage.

This is a meta-issue that will track the development of such implementation

Proposed Solution

  • Update LatexBuildHandler class to have less rigid full_latex_sequence
  • Possibly create more child classes or configurations to handle popular engines. Group them by the command sequence. I.e. to have PdflatexBuildHandler and other sibling classes
  • Make bibtex optional
  • Document the usage of most of the popular engines, so users can start out the box. Possibly add multiple Binder links with different engines.

Additional context

Related issues that should be fixed by this:

Existing engines

Summary Table: Comparison of LaTeX Build Compilers Across Operating Systems

Compiler Type OS Support Key Feature Performance Package Management Works with current ext version
pdfTeX LaTeX engine (requires a LaTeX distribution like TeXLive or MiKTeX to function.) Windows, macOS, Linux - Outputs high-quality PDFs
- Also integrated into TeX Live
- Less flexible for complex typographical tasks.
- Compatible with various LaTeX editors
Efficient for standard LaTeX documents Tlmgr (TeXLive Manager), MiKTeX Yes
(c.LatexConfig.latex_command = 'pdflatex')
Engine is installed within TeX Live.
TeXLive Full LaTeX distribution
(includes engine, package manager)
Windows, macOS, Linux - Comprehensive – includes all popular LaTeX packages
- Ongoing and regular support from LaTeX community
- Compatible with various LaTeX editors
Moderate Tlmgr N/A
XeTeX LaTeX engine (requires a LaTeX distribution like TeXLive or MiKTeX to function.) Windows, macOS, Linux - Unicode and OpenType font support
- Advanced typography support – Helps with complex math documents
- Compatible with various LaTeX editors
Moderate Tlmgr, MiKTeX Yes
(c.LatexConfig.latex_command = 'xelatex')
Using Xelatex within TeXLive
Tectonic Complete, self-contained LaTeX engine (does not require an additional LaTeX distribution) Windows, macOS, Linux - Cloud-based - handles the downloading and managing of LaTeX packages.
- Recompiles only parts of documents that have changed.
- CLI interface – best for CI/CD.
Fast Personal Repo No
(c.LatexConfig.latex_command = 'tectonic')
MiKTeX Full LaTeX distribution
(like TeXLive)
Windows, macOS, Linux - Windows OS focused
- GUI support
- Compatible with various LaTeX editors
Efficient Built-in manager N/A
LuaTeX LaTeX engine (requires a LaTeX distribution like TeXLive or MiKTeX to function.) Windows, macOS, Linux - Lua scripting
- Advanced typesetting
- Compatible with various LaTeX editors
Slower – Due to Lua integration Tlmgr Yes
(c.LatexConfig.latex_command = 'lualatex')
Using lualatex within TeXLive
PythonTeX Added Package (works within a LaTeX distribution) Windows, macOS, Linux - Integrates Python code with LaTeX – allows running python code within doc and insert results directly.
- Ideal for scientific computations and generating dynamic plots.
Efficient, depends on Python code Python package management Yes
Install package inside TeXLive using tlmgr install pythontex
Use package in the document with \usepackage{pythontex}
REVTeX 4.2 Document Class
(works with all standard LaTeX engines)
Windows, macOS, Linux - Perfect for submissions to physics, mathematics, and engineering journals.
- Contains pre-built formatting
- Predefined templates for different types of papers.
Does not impact compilation N/A Yes
Install package inside TeXLive using tlmgr install revtex
Use package with \documentclass[aps,prl,reprint]{revtex4-2}