docs-latex
Convert Markdown to LaTeX with TikZ and compile to PDF. Use when wanting a presentation-quality PDF, a professional report with diagrams, or print-ready documentation.
What this skill does
# Markdown to LaTeX Conversion
Convert Markdown documents to professional LaTeX with advanced typesetting, TikZ/PGFPlots visualizations, and PDF compilation.
## When to Use This Skill
| Use this skill when... | Use another skill when... |
|------------------------|--------------------------|
| Converting Markdown to presentation-quality PDF | Writing Markdown documentation (`/docs:generate`) |
| Creating reports with diagrams and visualizations | Simple text formatting |
| Generating print-ready strategic documents | Creating HTML documentation |
| Building lifecycle reports with charts and timelines | Syncing existing docs (`/docs:sync`) |
## Context
- LaTeX installed: !`which pdflatex`
- Current directory: !`pwd`
- Available .md files: !`find . -maxdepth 2 -name '*.md' -not -name 'CHANGELOG.md' -not -name 'README.md'`
## Parameters
- `<file>`: Path to the Markdown source file (required)
- `--no-compile`: Generate `.tex` file only, skip PDF compilation
- `--visualizations`: Include TikZ/PGFPlots diagrams (timelines, charts, risk matrices)
- `--report-type`: Document structure preset
- `roadmap`: Phase-based roadmap with timeline visualization
- `lifecycle`: Project lifecycle with release charts and velocity graphs
- `general`: Standard professional document (default)
## Execution
Execute this Markdown-to-LaTeX conversion workflow:
### Step 1: Analyze the Markdown source
Read the source Markdown file and extract:
- Document title and metadata
- Section hierarchy (map `#` levels to LaTeX chapters/sections)
- Tables, lists, code blocks, callout blocks, and blockquotes
- Priorities or status indicators for color-coded markers
- Numerical data suitable for visualization
### Step 2: Generate the LaTeX document
Create a `.tex` file adjacent to the source. Use the document preamble, color definitions, custom environments, and conversion rules from [REFERENCE.md](REFERENCE.md).
Apply the Markdown-to-LaTeX conversion rules:
| Markdown | LaTeX |
|----------|-------|
| `# Title` | `\chapter{Title}` |
| `## Section` | `\section{Section}` |
| `### Subsection` | `\subsection{Subsection}` |
| `**bold**` | `\textbf{bold}` |
| `*italic*` | `\textit{italic}` |
| `` `code` `` | `\texttt{code}` |
| `- item` | `\begin{itemize}\item ...\end{itemize}` |
| `1. item` | `\begin{enumerate}\item ...\end{enumerate}` |
| `> quote` | `\begin{tcolorbox}...\end{tcolorbox}` |
| `[text](url)` | `\href{url}{text}` |
| Tables | `booktabs` tables with `\toprule`, `\midrule`, `\bottomrule` |
| Code blocks | `\begin{lstlisting}...\end{lstlisting}` |
| `- [ ]` / `- [x]` | `$\square$` / `$\boxtimes$` (requires `amssymb`) |
### Step 3: Add visualizations (when --visualizations or data suggests it)
Choose appropriate TikZ/PGFPlots visualizations based on document content. Use the visualization templates from [REFERENCE.md](REFERENCE.md):
- **Timeline** for roadmaps with phases
- **Bar/pie charts** for release or metric data
- **Risk matrix** for documents with risk/impact data
- **Test pyramid** for QA/testing documents
### Step 4: Compile to PDF
1. Install LaTeX toolchain if not available:
```bash
apt-get update && apt-get install -y texlive-latex-extra texlive-fonts-recommended \
texlive-fonts-extra texlive-science latexmk
```
2. Compile with two passes for cross-references:
```bash
pdflatex -interaction=nonstopmode DOCUMENT.tex
pdflatex -interaction=nonstopmode DOCUMENT.tex
```
3. If compilation fails, check [REFERENCE.md](REFERENCE.md) for common compilation fixes.
### Step 5: Clean up repository artifacts
Add LaTeX build artifacts to `.gitignore` if not already present: `*.aux`, `*.log`, `*.out`, `*.toc`, `*.lof`, `*.lot`, `*.fls`, `*.fdb_latexmk`, `*.synctex.gz`, `*.bbl`, `*.blg`, `*.nav`, `*.snm`, `*.vrb`.
## Post-actions
1. Report the output PDF path, page count, and file size
2. Summarize what visualizations were generated
3. List any compilation warnings that may need attention
4. Suggest the `.gitignore` additions if not already present
## Agentic Optimizations
| Context | Command |
|---------|---------|
| Check LaTeX installed | `which pdflatex 2>/dev/null` |
| Quick compile | `pdflatex -interaction=nonstopmode -halt-on-error FILE.tex` |
| Full compile (with TOC) | `pdflatex -interaction=nonstopmode FILE.tex && pdflatex -interaction=nonstopmode FILE.tex` |
| Check PDF page count | `pdfinfo FILE.pdf 2>/dev/null` |
| Check PDF file size | `stat -f %z FILE.pdf 2>/dev/null` |
| Install toolchain | `apt-get install -y texlive-latex-extra texlive-fonts-recommended texlive-fonts-extra texlive-science` |
| Errors only | `pdflatex -interaction=nonstopmode FILE.tex 2>&1` |
For detailed LaTeX patterns, TikZ templates, and package reference, see [REFERENCE.md](REFERENCE.md).
Related in Writing & Docs
jax-development
IncludedUse this skill when the user is writing, debugging, profiling, refactoring, reviewing, benchmarking, parallelising, exporting, or explaining JAX code, or when they mention JAX, jax.numpy, jit, grad, value_and_grad, vmap, scan, lax, random keys, pytrees, jax.Array, sharding, Mesh, PartitionSpec, NamedSharding, pmap, shard_map, Pallas, XLA, StableHLO, checkify, profiler, or the JAX repo. It helps turn NumPy or PyTorch-style code into pure functional JAX, fix tracer/control-flow/shape/PRNG bugs, remove recompiles and host-device syncs, choose transforms and sharding strategies, inspect jaxpr/lowering/IR, and benchmark compiled code correctly.
nature-article-writer
IncludedDrafts, rewrites, diagnostically critiques, and style-calibrates primary research manuscripts for Nature and Nature Portfolio journals. Use when the user wants a Nature-style title, summary paragraph or abstract, introduction, results, discussion, methods, figure legends, presubmission enquiry, cover letter, reviewer response, or when a scientific draft sounds generic, jargon-heavy, structurally weak, or AI-ish and needs precise, broad-reader-friendly prose without inventing data, analyses, or references. Best for primary research articles and letters rather than reviews or press releases unless explicitly adapting one.
deckrd
IncludedDocument-driven framework that derives requirements, specifications, implementation plans, and executable tasks from goals through structured AI dialogue. Use when user says "write requirements", "create spec", "plan implementation", "derive tasks", "structure this feature", "break down into tasks", or "document this module". Also use for reverse engineering existing code into docs (/deckrd rev). Do NOT use for direct code writing — use /deckrd-coder after tasks are generated. Do NOT use when the user only wants to run or fix existing code without planning.
clinical-decision-support
IncludedGenerate professional clinical decision support (CDS) documents for pharmaceutical and clinical research settings, including patient cohort analyses (biomarker-stratified with outcomes) and treatment recommendation reports (evidence-based guidelines with decision algorithms). Supports GRADE evidence grading, statistical analysis (hazard ratios, survival curves, waterfall plots), biomarker integration, and regulatory compliance. Outputs publication-ready LaTeX/PDF format optimized for drug development, clinical research, and evidence synthesis.
handling-sf-data
IncludedSalesforce data operations with 130-point scoring. Use this skill to create, update, delete, bulk import/export, generate test data, and clean up org records using sf CLI and anonymous Apex. TRIGGER when: user creates test data, performs bulk import/export, uses sf data CLI commands, needs data factory patterns for Apex tests, or needs to seed/clean records in a Salesforce org. DO NOT TRIGGER when: SOQL query writing only (use querying-soql), Apex test execution (use running-apex-tests), or metadata deployment (use deploying-metadata).
accelint-ac-to-playwright
IncludedConvert and validate acceptance criteria for Playwright test automation. Use when user asks to (1) review/evaluate/check if AC are ready for automation, (2) assess if AC can be converted as-is, (3) validate AC quality for Playwright, (4) turn AC into tests, (5) generate tests from acceptance criteria, (6) convert .md bullets or .feature Gherkin files to Playwright specs, (7) create test automation from requirements. Handles both bullet-style markdown and Gherkin syntax with JSON test plan generation and validation.