Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,7 @@ jobs:
path: dist/plugins
retention-days: "7"
build-plugins-willow:
name: "Plugins (willow): asciidoc, diff, jinja2, markdown, svelte, typst, vue"
name: "Plugins (willow): asciidoc, diff, jinja2, latex, markdown, svelte, typst, vue"
runs-on: depot-ubuntu-24.04-32
container: "ghcr.io/bearcove/arborium-plugin-builder:latest"
needs:
Expand All @@ -625,10 +625,10 @@ jobs:
set -e
tar -xf generate-output.tar && rm generate-output.tar
shell: bash
- name: Build asciidoc, diff, jinja2, markdown, svelte, typst, vue
- name: Build asciidoc, diff, jinja2, latex, markdown, svelte, typst, vue
run: |-
set -e
./xtask/target/release/xtask build asciidoc diff jinja2 markdown svelte typst vue -o dist/plugins
./xtask/target/release/xtask build asciidoc diff jinja2 latex markdown svelte typst vue -o dist/plugins
shell: bash
- name: Upload plugins artifact
uses: actions/upload-artifact@v5
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## Unreleased

### Added

- LaTeX (`latex` / `tex`) language support via `latex-lsp/tree-sitter-latex`

## 0.2.2 (2025-12-04)


Expand Down
156 changes: 156 additions & 0 deletions demo/samples/latex.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
\documentclass[12pt,a4paper]{article}

% Packages
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{hyperref}
\usepackage{graphicx}
\usepackage{booktabs}

\title{A Sample \LaTeX{} Document}
\author{Jane Doe \and John Smith}
\date{\today}

\begin{document}

\maketitle

% Table of contents
\tableofcontents
\newpage

%% Introduction
\section{Introduction}
\label{sec:intro}

This document demonstrates the syntax of \LaTeX{}, a document preparation system
based on Donald Knuth's \TeX{} typesetting engine. It is widely used in academia
for \textbf{scientific}, \textit{mathematical}, and \emph{technical} writing.

See Section~\ref{sec:math} for examples of mathematical typesetting.

\subsection{Background}
\label{sec:background}

\LaTeX{} was developed by Leslie Lamport in 1983 as a higher-level interface to
\TeX{}. It provides macros for document structuring, cross-referencing, and
bibliography management~\cite{lamport1994latex}.

\subsubsection{Why Use \LaTeX{}?}
\begin{itemize}
\item Superior mathematical typesetting
\item Automatic numbering and cross-references
\item Consistent, professional output
\item Free and open source
\end{itemize}

\section{Mathematics}
\label{sec:math}

\subsection{Inline and Display Math}

Inline math uses dollar signs: $E = mc^2$ and $\sum_{i=1}^{n} i = \frac{n(n+1)}{2}$.

Display math uses the \texttt{equation} environment:

\begin{equation}
\label{eq:euler}
e^{i\pi} + 1 = 0
\end{equation}

Unnumbered display equations use \verb|\[...\]|:

\[
\int_{-\infty}^{\infty} e^{-x^2} \, dx = \sqrt{\pi}
\]

\subsection{Aligned Equations}

\begin{align}
f(x) &= x^2 + 2x + 1 \\
&= (x + 1)^2
\end{align}

\subsection{Theorem Environments}

\newtheorem{theorem}{Theorem}
\newtheorem{lemma}[theorem]{Lemma}

\begin{theorem}[Pythagorean Theorem]
For a right triangle with legs $a$ and $b$ and hypotenuse $c$:
\[
a^2 + b^2 = c^2
\]
\end{theorem}

\section{Environments}
\label{sec:environments}

\subsection{Tables}

\begin{table}[ht]
\centering
\caption{Comparison of typesetting systems}
\label{tab:comparison}
\begin{tabular}{lcc}
\toprule
System & Math support & Free \\
\midrule
\LaTeX{} & Excellent & Yes \\
Typst & Good & Yes \\
Word & Limited & No \\
\bottomrule
\end{tabular}
\end{table}

\subsection{Figures}

\begin{figure}[ht]
\centering
% \includegraphics[width=0.5\textwidth]{example-image}
\caption{An example figure.}
\label{fig:example}
\end{figure}

\subsection{Verbatim}

\begin{verbatim}
#include <stdio.h>
int main() {
printf("Hello, World!\n");
return 0;
}
\end{verbatim}

\section{Cross-References and URLs}
\label{sec:refs}

Refer to Equation~\ref{eq:euler}, Table~\ref{tab:comparison},
and Figure~\ref{fig:example}.

Visit \url{https://www.latex-project.org} or use
\href{https://ctan.org}{CTAN} for packages.

% Define a custom command
\newcommand{\R}{\mathbb{R}}
\newcommand{\norm}[1]{\left\|#1\right\|}

The set of real numbers is $\R$ and a norm is $\norm{x}$.

% Bibliography
\bibliographystyle{plain}
\begin{thebibliography}{9}
\bibitem{lamport1994latex}
Leslie Lamport,
\textit{\LaTeX: A Document Preparation System},
Addison-Wesley, 1994.

\bibitem{knuth1984tex}
Donald E. Knuth,
\textit{The \TeX book},
Addison-Wesley, 1984.
\end{thebibliography}

\end{document}
24 changes: 24 additions & 0 deletions langs/group-willow/latex/def/arborium.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
repo: https://github.com/latex-lsp/tree-sitter-latex
commit: "7e0ecdc02926c7b9b2e0c76003d4fe7b0944f957"
license: MIT

grammars:
- id: latex
name: LaTeX
tag: markup
tier: 3
has_scanner: true
icon: simple-icons:latex
aliases:
- tex

inventor: Leslie Lamport
year: 1983
description: "A document preparation system built on Donald Knuth's TeX typesetting engine, widely used in academia for scientific, mathematical, and technical documents."
link: https://www.latex-project.org
trivia: "LaTeX is used for typesetting over 90% of mathematics and physics research papers. Its macro system is so expressive that it is technically Turing-complete."

samples:
- path: samples/sample.tex
description: A representative LaTeX document covering document structure, math, sectioning, environments, and formatting commands.
license: MIT
Loading