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.
development
Debug a running web app via the web-debugger SDK: app logs, application state, runtime snapshots, React state, query cache.
development
Thoroughly understand a software development objective before implementation: research, identify ambiguities, ask clarifying questions. Use before starting implementation of a non-trivial or ambiguously specified feature, or when requirements leave open design decisions.
development
Locate the on-disk Claude Code transcript file (.jsonl under ~/.claude/projects/) for the current or a specified conversation.
development
Reflect on codebase navigation effectiveness at end of conversation. Surfaces dead ends, inefficiencies, missing context. Does not write files — pair with /kiro:steering-custom to persist.