Generate pixel-perfect invoices with LaTeX templates. Customizable, PDF-ready, and built for freelancers who care about presentation.
Stack
- Next.js 16 — Server actions + API routes for LaTeX compilation.
- LaTeX — Unmatched typographic precision for professional documents.
- Node.js — Server-side PDF generation with child_process.
Features
- Professional LaTeX templates — Clean, customizable invoice templates with proper typography and spacing.
- PDF generation — Compile LaTeX to PDF on-demand. Download or email directly to clients.
- Invoice history — Store invoice metadata, track payments, and re-generate past invoices.
Install
npx create-bitroot@latest my-invoices --kit latex-invoice-kit
cd my-invoices
cp .env.example .env.local
npm run devEnvironment
.env.example
NEXT_PUBLIC_APP_URL=http://localhost:3000
DATABASE_URL=postgresql://user:pass@localhost:5432/invoices
LATEX_BIN=/usr/bin/pdflatexWalkthrough
1. Install LaTeX distribution
Install TeX Live (Linux/macOS) or MiKTeX (Windows). Verify pdflatex is in your PATH.
# macOS
brew install --cask mactex
# Ubuntu/Debian
sudo apt-get install texlive-full
# Verify
pdflatex --version2. Configure database
Point DATABASE_URL to your Postgres instance. Run migrations to create the invoices table.
npm run db:migrate3. Customize templates
Edit templates in /latex/templates/. Variables use \VAR{} syntax. Change logo, colors, and layout to match your brand.
Gotchas
- LaTeX compilation can fail silently — check logs in /tmp/ if PDFs don't generate.
- Special characters ($, &, %) must be escaped in invoice line items.
- Large LaTeX installations (3+ GB) — use a minimal scheme if disk space is tight.
Why not just build it yourself?
If you need real-time collaborative editing or WYSIWYG, LaTeX is overkill. This kit is for developers who want programmatic control over document layout.
Links
License: MIT
Got stuck, or want this shipped end-to-end for you? bitroot.club builds custom products for founders. →