LaTeX

Write LaTeX documents with correct syntax, packages, and compilation workflow.

Iván

@ivangdavila

What This Skill Does

Guides writing LaTeX documents with correct syntax, package usage, and compilation workflow. Covers special characters, math mode, spacing, floats, references, tables, images, and common errors.

Replaces trial-and-error LaTeX debugging by providing a structured reference for syntax, packages, and compilation steps.

When to Use It

  • Write a research paper or thesis with proper LaTeX formatting
  • Create a professional report with tables, figures, and cross-references
  • Typeset mathematical equations and formulas for academic documents
  • Set up a LaTeX document from scratch with correct preamble and package order
  • Debug common LaTeX errors like overfull hboxes or missing math mode
  • Compile a LaTeX document with bibliography using the correct multi-pass workflow

Install

$ openclaw skills install @ivangdavila/latex

Special Characters

  • Reserved chars need escape: \# \$ \% \& \_ \{ \} \textbackslash
  • Tilde as character: \textasciitilde not \~ (that's an accent)
  • Caret: \textasciicircum not \^
  • Backslash in text: \textbackslash not \\ (that's line break)

Quotes & Dashes

  • Opening quotes: `` not "; closing: ''—never use straight " quotes
  • Hyphen -, en-dash -- (ranges: 1--10), em-dash --- (punctuation)
  • Minus in math mode: $-1$ not -1 in text

Math Mode

  • Inline: $...$ or \(...\); display: \[...\] or equation environment
  • Text inside math: $E = mc^2 \text{ where } m \text{ is mass}$
  • Multiline equations: align environment, not multiple equations
  • \left( ... \right) for auto-sizing delimiters—must be paired

Spacing

  • Command followed by text needs {} or \ : \LaTeX{} or \LaTeX\ is
  • Non-breaking space: ~ between number and unit: 5~km
  • Force space in math: \, thin, \: medium, \; thick, \quad \qquad

Packages

  • \usepackage order matters—hyperref almost always last
  • inputenc + fontenc for UTF-8: \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc}
  • graphicx for images, booktabs for professional tables, amsmath for advanced math
  • microtype for better typography—load early, subtle but significant improvement

Floats (Figures & Tables)

  • [htbp] suggests placement: here, top, bottom, page—not commands
  • LaTeX may move floats far from source—use [H] from float package to force
  • Always use \centering inside float, not center environment
  • Caption before \label—label references the last numbered element

References

  • Compile twice to resolve \ref and \pageref—first pass collects, second uses
  • \label immediately after \caption or inside environment being labeled
  • For bibliography: latex → bibtex → latex → latex (4 passes)
  • hyperref makes refs clickable—but can break with some packages

Tables

  • tabular for inline, table float for numbered with caption
  • Use booktabs: \toprule, \midrule, \bottomrule—no vertical lines
  • @{} removes padding: \begin{tabular}{@{}lll@{}}
  • Multicolumn: \multicolumn{2}{c}{Header}; multirow needs multirow package

Images

  • Path relative to main file or set with \graphicspath{{./images/}}
  • Prefer PDF/EPS for pdflatex/latex; PNG/JPG for photos
  • \includegraphics[width=0.8\textwidth]{file}—no extension often better

Common Errors

  • Overfull hbox: line too long—rephrase, add \- hyphenation hints, or allow \sloppy
  • Missing $: math command used in text mode
  • Undefined control sequence: typo or missing package
  • \include adds page break, \input doesn't—use \input for fragments

Document Structure

  • Preamble before \begin{document}—all \usepackage and settings
  • \maketitle after \begin{document} if using \title, \author, \date
  • article for short docs, report for chapters without parts, book for full books

Top skills in this category

Free Ride - Unlimited free AI

@shaivpidadi

Manages free AI models from OpenRouter for OpenClaw. Automatically ranks models by quality, configures fallbacks for rate-limit handling, and updates opencla...

48269k

Playwright (Automation + MCP + Scraper)

@ivangdavila

Automates, tests, and debugs browsers with Playwright: locators, auto-waiting, traces, CI runs, and MCP browser control. Use when a test is flaky, times out, or fails only in CI or headless; when a locator matches multiple elements or the wrong one (strict mode violation); when clicks need force, waits become sleeps, or networkidle never settles; for storageState and login setup, request mocking and HAR replay, uploads and downloads, iframes and shadow DOM, popups and dialogs, screenshot diffs that change per machine, trace and report artifacts, sharding a slow suite, device and permission emulation, accessibility checks, driving a real browser through Playwright MCP, extracting data from JS-rendered pages, or porting a Cypress, Puppeteer, or Selenium suite to Playwright. Not for maintaining an existing Cypress or Puppeteer suite (cypress, puppeteer) or for work a plain HTTP request answers (http).

12839k

n8n

@thomasansems

Manage n8n workflows and automations via API. Use when working with n8n workflows, executions, or automation tasks - listing workflows, activating/deactivating, checking execution status, manually triggering workflows, or debugging automation issues.

6121k

Superpowers Dev Workflow

@wlshlad85

Spec-first, TDD, subagent-driven software development workflow. Use when: (1) building any new feature or app — triggers brainstorm → plan → subagent executi...

1824k

LNBits Wallet wtih QR Code

@jamestsetsekas

Manage LNbits Lightning Wallet (Balance, Pay, Invoice)

622k