Quick Start
Get your first document generated in 10 minutes.
Prerequisites
- LaTeX distribution (TeX Live or MacTeX)
- Claude Code CLI or OpenCode installed
- API access (this project uses Claude Max 5x subscription)
Step 1: Setup Project
bash
# Clone the template (repo URL will be added later)
# git clone https://github.com/[TBD]/ai-doc-template.git my-document
cd my-document
# Verify LaTeX installation
./scripts/verify-setup.shExpected output:
================================================
Documentation Template - Setup Verification
================================================
Checking Required Tools...
✓ pdfLaTeX: pdfTeX 3.141592653
✓ Biber: biber version 2.19
Checking Project Structure...
✓ Directory: latex/
✓ File: latex/main.tex
✓ Script: scripts/compile.sh (executable)
All checks passed! Ready to generate documentation.
================================================Step 2: Add Source Documents
bash
# Copy your source PDFs
cp ~/research/thesis.pdf sources/
cp ~/research/report.pdf sources/
# View sources
ls -la sources/Step 3: Configure Project
Edit .claude/CLAUDE.md with your project details:
markdown
# Project: [Your Document Title]
## Goal
Generate [X]-page research document on [topic].
## Source Files
- sources/thesis.pdf - [description]
- sources/report.pdf - [description]
## Output
- latex/chapters/*.tex - Chapter files
- latex/main.tex - Main document
## Style Guidelines
- Academic prose, not bullet lists
- [Language] with proper accents
- Max 2-3 code blocks per chapter
- Citations using \cite{}Step 4: Start Claude Code
bash
# Launch Claude Code (or opencode if using OpenCode)
claude
# The orchestrator reads CLAUDE.md and understands your projectStep 5: Analyze Sources
In Claude Code:
> Analyze all documents in sources/ and create a synthesis.
List the main topics covered and identify research gaps.The orchestrator spawns Sonnet agents to read sources in parallel.
Step 6: Plan Document
After source analysis:
> Based on the source analysis, create a document plan with:
- Chapter structure
- Page budgets
- Source-to-chapter mapping
Save to plan/DOCUMENT_PLAN.mdStep 7: Write Chapters
Start parallel chapter writing:
> Write chapters 1-5 following agents/AGENT_GUIDELINES.md
Each chapter should use flowing prose with proper citations.Multiple Sonnet agents write chapters simultaneously.
Step 8: Build PDF
After chapters are complete:
bash
# Compile LaTeX to PDF
./scripts/compile.sh
# Check output
open latex/main.pdfQuick Workflow Summary
Common Commands
Claude Code Commands
| Command | Purpose |
|---|---|
Analyze sources/ | Read all source documents |
Write chapter XX | Generate specific chapter |
Review chapter XX | Quality check chapter |
Fix LaTeX errors | Repair build issues |
Build Commands
bash
# Full build (pdflatex + biber)
./scripts/compile.sh
# Clean build files
./scripts/clean.sh
# Check citations
./scripts/check-citations.sh
# Word count
./scripts/word-count.shTroubleshooting
Claude Code Not Found
bash
# Install Claude Code
npm install -g @anthropic-ai/claude-code
# Authenticate
claude auth loginLaTeX Errors
bash
# Clean and rebuild
./scripts/clean.sh
./scripts/compile.sh
# Check log for specific errors
grep -i error latex/main.logMissing Citations
bash
# Find undefined citations
grep "undefined" latex/main.log
# Add missing entries to bibliography.bib