# latex-document-skill

Generates, compiles, and converts LaTeX documents into PDF files with PNG previews, handling technical reports, resumes, posters, and Beamer slides.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 561 installs · ★ 798
- Author: ndpvt-web
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/ndpvt-web/latex-document-skill/tree/HEAD/SKILL.md
- Updated: 2026-10-25
- HTML: https://affpapa.org/en/nevibecode/skills/latex-document-skill

## What it does

The skill manages drafting `.tex` source files, selecting templates, and running the compilation pipeline. Its core script, `scripts/compile_latex.sh`, detects the required engine automatically among pdflatex, xelatex, or lualatex, filters compile logs with texfot, and renders PNG preview images. For documents spanning five pages or more, it applies layout guidelines to compact lists and scale figures.

Visual assets run through dedicated scripts. Matplotlib plots and Mermaid diagrams are exported to images using Python and shell scripts before insertion into the document. The workflow supports Pandoc document conversions, PDF diff generation using latexdiff, and OCR parsing via pytesseract. Compilation requires a local TeX installation; missing packages cause immediate build failures.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add ndpvt-web/latex-document-skill --skill latex-document-skill -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/latex-document-skill/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/latex-document-skill/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add ndpvt-web/latex-document-skill --skill latex-document-skill -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/latex-document-skill/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add ndpvt-web/latex-document-skill --skill latex-document-skill -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/latex-document-skill/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install ndpvt-web/latex-document-skill latex-document-skill
```

2. **Manually: put the files in place**
- File: `.github/skills/latex-document-skill/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add ndpvt-web/latex-document-skill --skill latex-document-skill -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/ndpvt-web/latex-document-skill
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/latex-document-skill/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add ndpvt-web/latex-document-skill --skill latex-document-skill -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/ndpvt-web/latex-document-skill/tree/HEAD/SKILL.md

## When to use it
- compile research papers and Beamer presentations to PDF
- generate version diffs between TeX files with latexdiff
- convert Markdown or DOCX documents to LaTeX format
- render matplotlib graphs and Mermaid charts for document inclusion

## Example prompts
- Build a two-column IEEE paper from my draft and generate a matplotlib chart
- Compile report.tex using xelatex and show me a PNG preview of the first page
- Generate a diff PDF between version1.tex and version2.tex using latexdiff

## Similar
- [latex-posters](https://affpapa.org/en/nevibecode/skills/k-dense-ai-latex-posters.md) — skill · 2000 installs
- [document-processing](https://affpapa.org/en/nevibecode/skills/document-processing.md) — skill · 1300 installs
- [pdf-generation](https://affpapa.org/en/nevibecode/skills/pdf-generation.md) — skill · 482 installs
- [paper-slides](https://affpapa.org/en/nevibecode/skills/paper-slides.md) — skill · 520 installs
- [scientific-slides](https://affpapa.org/en/nevibecode/skills/scientific-slides.md) — skill · 2200 installs
- [word-document-processor](https://affpapa.org/en/nevibecode/skills/word-document-processor.md) — skill · 3600 installs

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
