# latex-live-without-overleaf
# 🧮 Live LaTeX Editing Without Overleaf
You can get a **free, Overleaf-style LaTeX editing experience** using **VS Code** or **GitHub**, with live PDF preview, collaboration tools, and full version control — all without paying for Overleaf.
---
## 🧩 Option 1: VS Code Live LaTeX Editing (Recommended)
### ✅ What You Get
- Real-time PDF preview
- Syntax highlighting, autocompletion, and snippets
- Live reload on save
- Two-way PDF ↔ source navigation (SyncTeX)
- Collaboration through Git or VS Code Live Share
### ⚙️ Setup Steps
1. **Install VS Code**
[https://code.visualstudio.com](https://code.visualstudio.com)
2. **Install a LaTeX Distribution**
- **macOS:**
```bash
brew install mactex
# or for a smaller install
brew install basictex
```
- **Linux:**
```bash
sudo apt install texlive-full
```
- **Windows:**
[Download MiKTeX](https://miktex.org/download)
3. **Install the LaTeX Workshop Extension**
Search for `LaTeX Workshop` by James Yu in the VS Code Extensions Marketplace.
4. **Open a `.tex` File**
- Open your LaTeX file in VS Code.
- Press **Cmd+Option+V** (Mac) or **Ctrl+Alt+V** (Windows/Linux) to open the PDF preview.
- The preview updates automatically when you save the file (`Cmd+S`).
5. **Optional: Enable Auto Build**
- Open Command Palette → `LaTeX Workshop: Open Settings`
- Set:
```json
"latex-workshop.latex.autoBuild.run": "onFileChange"
```
6. **Enable SyncTeX**
Click a line in your `.tex` file to jump to the corresponding spot in the PDF — and vice versa.
7. **Collaborate**
- Use **VS Code → Live Share** for real-time co-editing.
- Or version your LaTeX project with **GitHub** for asynchronous collaboration.
---
## 🌐 Option 2: GitHub Codespaces / VS Code .dev
You can also edit LaTeX directly **in the browser** using GitHub’s built-in VS Code interface.
### ✅ Advantages
- No local setup required
- Full VS Code experience in the browser
- Automatic sync with your GitHub repo
### ⚙️ Steps
1. Push your LaTeX project to a GitHub repository.
2. Open it in the browser:
````
[https://github.dev/](https://github.dev/)<your-username>/<your-repo>
````
3. Install the **LaTeX Workshop** extension inside the browser editor.
> ⚠️ Note: GitHub.dev alone can’t compile LaTeX (no backend compute).
> Use **Codespaces** for full compilation.
4. In a Codespace, install TeX Live:
```bash
sudo apt install texlive-full
````
5. Compile your document using LaTeX Workshop or directly via:
```bash
pdflatex main.tex
```
---
## 🌐 Option 3: Other Free Web Editors
If you want an online LaTeX editor without setup or GitHub:
| Platform | Key Features |
| ------------------------------------- | -------------------------------------------- |
| [Papeeria](https://papeeria.com/) | Free, collaborative, Overleaf-like interface |
| [CoCalc](https://cocalc.com/) | LaTeX with live preview and Jupyter support |
| [TeXLab](https://texlab.netlify.app/) | Lightweight local or web LaTeX editing |
---
## 🧠 Recommended Hybrid Workflow
1. **Write locally** in VS Code with **LaTeX Workshop** for live preview.
2. **Sync via GitHub** for backup and version control.
3. **Collaborate** using either:
* **VS Code Live Share** for synchronous editing, or
* **GitHub Codespaces** for fully cloud-based editing.
---
## ⚙️ Optional: Pre-Configured VS Code Settings
You can include the following in your `.vscode/settings.json` to make LaTeX Workshop “just work” out of the box:
```json
{
"latex-workshop.latex.autoBuild.run": "onFileChange",
"latex-workshop.view.pdf.viewer": "tab",
"latex-workshop.synctex.afterBuild.enabled": true,
"latex-workshop.latex.recipes": [
{
"name": "latexmk 🔁",
"tools": ["latexmk"]
}
],
"latex-workshop.latex.tools": [
{
"name": "latexmk",
"command": "latexmk",
"args": ["-pdf", "-interaction=nonstopmode", "-synctex=1", "%DOC%"]
}
]
}
```
---
### 🪄 Summary
| Environment | Setup | Compiles PDFs | Live Preview | Collaboration |
| --------------------- | -------------------- | ------------- | ------------- | ---------------------- |
| **VS Code (local)** | Fast & full-featured | ✅ | ✅ | ✅ via Live Share |
| **GitHub Codespaces** | Browser-based | ✅ | ✅ | ✅ via shared Codespace |
| **GitHub.dev** | Browser-only | ❌ | ✅ (edit only) | ✅ via repo commits |
| **Papeeria / CoCalc** | Cloud-hosted | ✅ | ✅ | ✅ (basic) |
---
**Result:** A robust, free alternative to Overleaf — built around tools you control.