Exploring TeXlyre: A Practical Guide to Local-First LaTeX Collaboration
Have you ever needed to work on a LaTeX document with colleagues, but worried about losing control over your data or dealing with spotty internet? That’s where TeXlyre comes in. It’s a platform designed for real-time collaboration on LaTeX files, with a strong emphasis on keeping everything local and accessible offline. Built using React, TypeScript, and Yjs, it lets you edit documents together seamlessly, even when you’re not connected. In this article, we’ll walk through what TeXlyre offers, how it works under the hood, and how you can get started. I’ll address common questions along the way, like how to set it up or what makes it different from other tools.
Let’s start with the basics. TeXlyre is a local-first real-time LaTeX collaboration platform that supports offline editing. This means your documents stay on your device by default, and you can edit them without an internet connection. When you do connect with others, changes sync up automatically. It’s open-source, licensed under AGPL v3, and runs in your browser without needing a central server for most operations.
What Makes TeXlyre Stand Out for LaTeX Users?
If you’re familiar with LaTeX for writing papers, reports, or theses, you know how precise and powerful it can be. But collaborating on LaTeX files traditionally involves emailing versions back and forth or using cloud-based tools that might compromise your privacy. TeXlyre changes that by focusing on peer-to-peer connections and local storage.
One key aspect is its use of Yjs for collaborative editing. Yjs is a conflict-free replicated data type (CRDT) system, which ensures that when multiple people edit the same document, their changes merge without conflicts. This happens in real time, with live cursors showing where everyone is working.

Take a look at the main interface above—it’s split into LaTeX code on one side and the compiled PDF on the other. This setup gives you immediate visual feedback as you type.
But what if you’re working alone sometimes? TeXlyre’s local-first architecture means all your data is stored in your browser’s IndexedDB. You can edit offline, and when you reconnect, everything syncs up. It’s like having a personal LaTeX editor that scales to team work without forcing you online all the time.
Diving into the Core Features
Let’s break down the features step by step. I’ll explain each one and answer potential questions, like “How does this actually work in practice?”
Real-Time Collaboration: Working Together Seamlessly
Imagine you’re co-authoring a research paper. With TeXlyre, multiple users can edit the same document at once. You’ll see colored cursors and selections from others, making it clear who’s changing what.

This is powered by WebRTC for peer-to-peer connections, which keeps latency low since data doesn’t route through a server. There’s also an integrated chat system right in the platform, so you can discuss changes without switching apps.

What about comments? TeXlyre includes comment features for reviews and discussions, helping teams exchange ideas in real time.
A common question here: “Does it handle conflicts well?” Yes, thanks to Yjs CRDTs, changes from different users merge automatically. No more manual resolving of edit overlaps.
LaTeX Compilation: Building Documents in Your Browser
Compiling LaTeX usually requires installing software like TeX Live, but TeXlyre does it all in the browser using SwiftLaTeX WASM engines. It supports pdfTeX and XeTeX, so you can process complex documents without external dependencies.
The compilation is live, meaning you see updates as you type, with syntax highlighting and error detection. If there’s an issue, an error panel pops up to guide you.

The PDF viewer is integrated, allowing zoom, navigation, and side-by-side viewing with your code. This makes iterating on documents faster.
Question: “Is this as powerful as desktop LaTeX tools?” It’s designed for browser use, so it handles most standard LaTeX needs, but for very specialized packages, you might still want a full desktop setup. However, since it’s WASM-based, it’s surprisingly capable without servers.
Local-First Architecture: Keeping Your Data Yours
Privacy and offline access are big deals in TeXlyre. Everything stores locally via IndexedDB, so you own your data. You can export and import projects easily, and the File System Access API lets you sync with local folders for backups.
This architecture supports full offline editing—write your LaTeX document on a plane, then sync when you land. When collaborating, synchronization happens automatically upon reconnection.
File Management and Synchronization: Organizing Your Projects
TeXlyre includes a file explorer for managing LaTeX sources, images, and other files. You can drag and drop items, and document linking connects collaborative docs to static files.
For sharing larger files, it integrates FilePizza for peer-to-peer transfers over WebRTC. This keeps things secure and direct.

Yjs handles metadata and sync state, ensuring everyone has the latest file versions.
A question users often have: “How do I share a project?” Just share the URL, like http://localhost:5173/#yjs:abc123def456
, and collaborators can join instantly.
You can also start from templates to kick off projects quickly.

How Does TeXlyre’s Architecture Work?
Under the hood, TeXlyre is built with React for the frontend, communicating with Yjs documents in IndexedDB. WebRTC handles real-time sync, and SwiftLaTeX WASM takes care of compilation—all in the browser.
It’s extensible via a plugin system. Plugins can add custom viewers, renderers, or backup providers. For example, there’s a Bib Editor plugin for handling bibliographies.

Plugins are registered in a config file and must be in the ‘extras’ directory.
The architecture emphasizes local-first principles, meaning data stays local unless you’re actively collaborating.
File Synchronization in Detail
For local sync, use the File System Access API to connect to folders. This works well with cloud storage like Dropbox for cross-device access, keeping compatibility with traditional LaTeX tools.
Peer-to-peer sharing via FilePizza handles non-collaborative files, while Yjs manages metadata. This combo ensures real-time updates to file lists and shared states.
Getting Started with TeXlyre: A Step-by-Step Guide
How to Install and Run TeXlyre
If you’re wondering how to set this up, it’s straightforward. You need Node.js 18 or higher and a modern browser.
Here’s the process:
-
Clone the repository:
git clone https://github.com/TeXlyre/texlyre.git
-
Navigate to the directory:
cd texlyre
-
Install dependencies:
npm install
-
Start the development server:
npm run dev
-
Open your browser to
http://localhost:5173
.
From there, create a new project or open an existing one. To collaborate, share the URL with the project ID.
For HTTPS in development:
npm run dev:https
Building for production:
npm run build
Then preview:
npm run preview
Lint your code:
npm run lint
This setup ensures you have a running instance quickly.
How to Develop Plugins for TeXlyre
Extending TeXlyre? The plugin system uses typed interfaces. For a viewer plugin:
interface ViewerPlugin extends Plugin {
type: 'viewer';
canHandle: (fileType: string, mimeType?: string) => boolean;
renderViewer: React.ComponentType<ViewerProps>;
}
Place plugins in the ‘extras’ directory and add their paths (without ‘/extras’) to plugins.config.ts
. The system loads them automatically.
Browser Compatibility: What You Need to Know
TeXlyre works best on Chrome and Edge, with full support for File System Access API and WebRTC. Firefox handles core features but has limits on file system integration. Safari has partial support, with reduced file access.
Mobile browsers haven’t been thoroughly tested for File System API, so use backup features cautiously on devices.
WebRTC is crucial for collaboration, and File System Access enhances backups.
License and Privacy: Understanding the Details
TeXlyre uses AGPL v3, meaning you can use, modify, and distribute it, even commercially. If you modify and distribute, share the source code. For network services, provide source to users.
Why AGPL? It’s due to dependency on SwiftLaTeX’s AGPL-licensed WASM engine.
On privacy: Data stays local, connections are direct peer-to-peer, no tracking or cookies. During collaboration, IP addresses pass through signaling servers briefly, but no content does.
GitHub integration is optional and requires your token.
Infrastructure uses open-source servers like y-webrtc, PeerJS, and FilePizza, hosted via Cloudflare Tunnel. You can self-host using the infrastructure repo.
Acknowledgments and Next Steps
TeXlyre builds on SwiftLaTeX for compilation, Yjs for editing, CodeMirror for the interface, and FilePizza for transfers. Development involved tools like Anthropic Claude for guidance.
Ready to try it? Head to the live demo on GitHub Pages or contribute via the CONTRIBUTING.md file.
FAQ: Answering Your Questions About TeXlyre
Here, I’ll tackle common queries in a conversational way, based on what users might ask.
What is TeXlyre and how does it differ from other LaTeX editors?
TeXlyre is a browser-based platform for real-time LaTeX collaboration with offline support. Unlike traditional editors that require servers or installations, it keeps data local and uses peer-to-peer sync. It’s not just an editor—it’s a full platform with file management and plugins.
How does real-time collaboration work in TeXlyre?
It uses Yjs CRDTs for merging edits and WebRTC for direct connections. You see live cursors, and changes sync instantly. No central server needed, which keeps it private.
Can I use TeXlyre offline?
Absolutely. Documents store in IndexedDB, so edit anytime. Sync happens when you reconnect.
What browsers support TeXlyre fully?
Chrome and Edge are best. Firefox is good for basics, Safari partial. Avoid mobile for advanced file sync until tested.
How do I share files with collaborators?
Use the file explorer for drag-and-drop, and FilePizza for peer-to-peer transfers of larger files. Metadata syncs via Yjs.
Is TeXlyre secure for sensitive documents?
Yes, local-first means data stays on your device. Peer-to-peer avoids servers, and no tracking is built in.
How to compile LaTeX in TeXlyre?
It uses SwiftLaTeX WASM for in-browser compilation with pdfTeX and XeTeX. Live updates show errors and PDF output.
Can I extend TeXlyre with custom features?
Yes, via plugins. Define interfaces like for viewers, place in ‘extras’, and register in config.
What license does TeXlyre use, and what does it mean?
AGPL v3: Free to use/modify, but share source if distributing changes. Required due to SwiftLaTeX dependency.
How to self-host signaling servers?
Follow instructions in the texlyre-infrastructure repo to run your own y-webrtc, PeerJS, etc.
Does TeXlyre support templates?
Yes, start projects from templates and share links easily.
How-To Guides for Common Tasks
How to Create and Share a New Project
-
Open TeXlyre in your browser. -
Click to create a new project. -
Optionally, select a template. -
Edit your LaTeX document. -
Copy the URL (with #yjs:ID) and share with others.
How to Sync with Local File System
-
In the project settings, enable File System Access. -
Select a local folder. -
TeXlyre will sync files bidirectionally. -
Use with cloud storage for cross-device access.
How to Handle Errors During Compilation
-
Write your LaTeX code. -
Watch for live compilation. -
If errors appear in the panel, review the log. -
Fix issues in the code editor. -
Recompile to see updates.
How to Add a Plugin
-
Develop your plugin with the required interface. -
Place it in the ‘extras’ directory. -
Add its path to plugins.config.ts (without ‘/extras’). -
Restart the app; it loads automatically.
Comparing TeXlyre’s Engines and Features
To help you understand options, here’s a table:
Feature | Description | Supported Technologies |
---|---|---|
Compilation Engines | In-browser LaTeX processing | pdfTeX, XeTeX via SwiftLaTeX WASM |
Collaboration Sync | Real-time editing merge | Yjs CRDTs, WebRTC peer-to-peer |
Storage | Local data ownership | IndexedDB, File System Access API |
File Sharing | Peer-to-peer transfers | FilePizza integration, Yjs metadata |
Browser Support | Full features | Chrome/Edge; Partial: Firefox/Safari |
This covers the essentials.
Wrapping Up: Why TeXlyre Might Be Right for You
If you’re a student, researcher, or professional using LaTeX, TeXlyre offers a balance of collaboration and control. It’s not about flashy features—it’s about reliable, privacy-focused tools that fit real workflows. Whether you’re editing solo offline or brainstorming with a team, it adapts.
I’ve covered the features, setup, and common questions here. If something sparks your interest, dive in by cloning the repo and experimenting. The community around open-source tools like this grows when people like you contribute or share experiences.