claude/ai-resources-plugin/skills/latex/SKILL.md
Generate LaTeX documents (or convert markdown to LaTeX) with professional typography. Optionally compile to PDF.
npx skillsauth add amhuppert/my-ai-resources latexInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Create beautifully formatted LaTeX documents from any input source (markdown files, plain text, structured data, or user instructions). Produce professional-quality typeset output following modern LaTeX best practices.
.tex file with proper preamble and bodylatexmkIf the user provides additional formatting instructions, apply them. User instructions override defaults below.
| Content Type | Class | When |
|---|---|---|
| Short documents, articles, memos | scrartcl | No chapters needed |
| Reports, theses, long documents | scrreprt | Chapter-level structure |
| Books, manuals | scrbook | Front/back matter, parts |
| Presentations | beamer | Slides |
Use KOMA-Script classes (scrartcl, scrreprt, scrbook) over standard classes for superior typography defaults and built-in customization.
Organize the preamble in this order. Include only packages the document actually needs.
\documentclass[a4paper, 11pt]{scrartcl}
% --- Typography ---
\usepackage[T1]{fontenc}
\usepackage{lmodern} % Clean, professional font
\usepackage{microtype} % ESSENTIAL: character protrusion + font expansion
% --- Math (include only if document has math) ---
\usepackage{mathtools} % Superset of amsmath with fixes
\usepackage{amssymb}
% --- Layout ---
\usepackage{geometry}
% --- Tables & Figures ---
\usepackage{booktabs} % Professional table rules
\usepackage{graphicx}
\usepackage{caption}
\usepackage{subcaption}
% --- Lists ---
\usepackage{enumitem}
% --- Language & Quotes ---
\usepackage[english]{babel}
\usepackage{csquotes}
% --- Colors ---
\usepackage{xcolor}
% --- Code Listings (include only if document has code) ---
\usepackage{listings}
% --- Units (include only if document has quantities) ---
\usepackage{siunitx}
% --- Links & References (load near-last) ---
\usepackage{hyperref}
\hypersetup{
colorlinks=true,
linkcolor=blue!70!black,
citecolor=green!50!black,
urlcolor=blue!70!black,
}
\usepackage{cleveref} % MUST be after hyperref
microtype is non-negotiable for professional output - always include itmathtools loads amsmath automatically; never load bothcleveref must load after hyperrefhyperref should load near-lastbiblatex with biber backend, not legacy bibtex/natbiblmodern (Latin Modern) - clean, professional, widely availablelibertinus, newtxtext/newtxmath (Times-like)fontspec2020--2025 renders as 2020–2025word---word renders as word—word~) before \cite, \cref, and between numbers and units\int f(x) \, dx\enquote{} from csquotes for quotation marks, never manual quote characters\emph{} instead of \textit{} - semantic emphasis that adapts to context\dots for ellipses, never three periodse.g.\ this, i.e.\ thatNASA\@. The next sentencebooktabs: \toprule, \midrule, \bottomrule|) or \hline\centering inside floats, not \begin{center}[htbp]\cref{} from cleveref - automatically produces "Figure 1", "Table 2", etc.fig:, tab:, sec:, eq:, lst:\label immediately after \caption or \sectionenumitem for customization$$...$$ for display math - use \[...\] or equation environment\\ for paragraph breaks - use a blank line\begin{center} inside floats - use \centering\label before \caption - produces wrong reference numbers\cref{}\sin, \log, or \DeclareMathOperator#, %, $, &, _, {, }When converting from markdown, apply these mappings:
| Markdown | LaTeX |
|---|---|
| # Heading | \section{Heading} |
| ## Heading | \subsection{Heading} |
| ### Heading | \subsubsection{Heading} |
| **bold** | \textbf{bold} |
| *italic* | \emph{italic} |
| `code` | \texttt{code} |
| > blockquote | \begin{quote}...\end{quote} |
| - item | \begin{itemize}\item ...\end{itemize} |
| 1. item | \begin{enumerate}\item ...\end{enumerate} |
| [text](url) | \href{url}{text} |
|  | \begin{figure}...\includegraphics{path}...\end{figure} |
| ```lang ``` | \begin{lstlisting}[language=lang]...\end{lstlisting} |
| --- (horizontal rule) | \bigskip\noindent\rule{\textwidth}{0.4pt}\bigskip |
| Tables | \begin{tabular} with booktabs rules |
| $math$ | $math$ (same) |
| $$math$$ | \[math\] |
# heading or filename\author and \date if present in the source, otherwise omitbooktabs-styled tabular environments# → \chapter, ## → \section)When the user requests PDF output, detect the platform and compile.
| Engine | Command | Use When |
|---|---|---|
| pdfLaTeX | latexmk -pdf | Default. ASCII/Latin content, standard fonts, fastest compilation |
| XeLaTeX | latexmk -xelatex | System fonts via fontspec, native Unicode |
| LuaLaTeX | latexmk -lualatex | System fonts + Lua scripting, no memory limits |
latexmk automatically runs the correct number of passes for cross-references, bibliographies, and indices. Always prefer it over manual multi-pass compilation.
latexmk -pdf document.tex # Compile to PDF (pdflatex)
latexmk -xelatex document.tex # Compile with XeTeX
latexmk -lualatex document.tex # Compile with LuaTeX
latexmk -c document.tex # Clean auxiliary files (keep PDF)
# Simple document (no bibliography)
pdflatex document.tex && pdflatex document.tex
# Document with biblatex/biber bibliography
pdflatex document.tex && biber document && pdflatex document.tex && pdflatex document.tex
If LaTeX tools are not installed or compilation fails due to missing packages, read the appropriate platform guide for installation instructions:
references/pdf-compilation-ubuntu.mdreferences/pdf-compilation-macos.mdDetect the platform with uname -s (Linux or Darwin).
Package installation requires system permissions — present the installation command to the user and let them confirm before running sudo or brew commands.
tools
Use when picking or vetting a keyboard shortcut on macOS. Triggers include "what hotkey should I use for X", "is `<combo>` available", "does this shortcut conflict", "recommend a keybinding for…", "check `<combo>` against my setup", "pick a hotkey for…", or any mention of choosing/binding/changing a shortcut in WezTerm, tmux, Zed, Chrome, Claude Code, or macOS. Determines whether a proposed combo collides with OS-reserved bindings, app defaults, or the user's customizations, and recommends ergonomic alternatives when needed.
development
Detect and remove dead code with knip. Use when the user asks to "run knip", "find unused files", "find unused exports", "find unused dependencies", "clean up dead code", "remove dead code", "set up knip", "configure knip", "knip.json", "knip false positive", "knip CI", or mentions a `knip` config, dependency bloat, bundle bloat from unused imports, or tree-shaking unused exports. Covers the configuration-first workflow, confidence-gated deletion, framework-specific gotchas (Next.js 15+, Tailwind, Storybook, Jest, Bun's test runner and `bun build --compile`), monorepos, CI integration, and performance tuning.
tools
This skill should be used when the user asks to "set up react-scan", "install react-scan", "diagnose React re-renders", "find unnecessary renders", "find unstable props", "automate React render checks with Playwright", "react-scan + playwright", "measure component renders programmatically", "check why a React component is slow", or mentions React rendering issues, slow React interactions, render counts, or component-level perf attribution. Covers install across Next.js/Vite/Remix/script-tag/browser-extension, the lite headless API for CI, and the canonical render-attribution → fix → validate loop driven through Playwright.
documentation
This skill should be used when integrating source material into a knowledge base, including when the user asks to "integrate this document into the knowledge base", "add this transcript to the memory bank", "ingest this document", "update the knowledge base", "analyze a new source document", or "sync current-state docs with this source".