agentleFS
vekzz-devvekzz-dev/opencode-skills/skills/latex/SKILL.md

latex

Skill4 starsChanged 41 days agoMITView on GitHub

Trigger: LaTeX, latex, .tex, documento académico, artículo, tesis, apuntes, guías, ensayos. Create compile-safe LaTeX academic documents.

7 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

2 rules. 0 are common, 0 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 6 edited versions we read keep these.

  • 0

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    If Lora/Lato are not installed: remove or comment the \setmainfont{Lora} / \setsansfont{Lato} lines.

    line 39
  2. Very specific:

    Existing projects: read the preamble, .latexmkrc, and any .cls/.sty files first — match their conventions instead of overriding them.

    line 43

“Common” is measured: kept by at least 6 in 10 of the 6 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Skill: LaTeX Academic Documents

Activation Contract

Load when creating, editing, or fixing .tex files for academic documents (articles, theses, essays, notes, guides) or when diagnosing compilation errors from .log files.

Hard Rules

  1. hyperref MUST be the last package loaded in the preamble.
  2. Never use \\ to separate paragraphs — use blank lines. \\ is for tables, alignments, and line breaks inside special environments only. Pair with \usepackage{parskip} for visual paragraph separation.
  3. Remove file extensions from \includegraphics, \include, \input — let LaTeX resolve them.
  4. Use \enquote{text} (from csquotes) for quotation marks, never raw "text".
  5. Brace command names before text: \LaTeX{} not \LaTeX.
  6. Always provide a working compilation command with every document.
  7. Default fonts are Lora (serif) + Lato (sans) via fontspec. Engine is always lualatex.
  8. For Spanish documents: babel[spanish] (works with lualatex).

Decision Gates

Document typeClassEngineFonts
Article, essay, apuntesarticlelualatexLora + Lato
Large article, report, guíareportlualatexLora + Lato
Thesis (tesis)memoir or booklualatexLora + Lato
PresentationbeamerlualatexLato (sans-default)

Execution Steps

  1. Identify document type from the request, then select class via the Decision Gates. Engine is always lualatex.
  2. Build preamble in this order: \documentclass[a4paper,12pt]{...} → fontspec → \setmainfont{Lora} + \setsansfont{Lato} → language (babel[spanish]) → math (amsmath, amssymb, mathtools, amsthm) → tables (booktabs) → graphics (graphicx + \graphicspath{{figures/}}) → typography (microtype) → paragraphs (parskip) → code (listings or minted) → citations (biblatex with biber) → hyperref LAST.
  3. If Lora/Lato are not installed: remove or comment the \setmainfont{Lora} / \setsansfont{Lato} lines. lualatex will use Latin Modern as the default — the document compiles without changes.
  4. Structure: main.tex is a skeleton. Use \input for sections. Use \include only for top-level chapters in books/reports.
  5. Bibliography: \addbibresource{refs.bib} in preamble, \printbibliography at document end.
  6. Compilation command: latexmk -lualatex main.tex. latexmk handles multi-pass and biblatex automatically.
  7. Existing projects: read the preamble, .latexmkrc, and any .cls/.sty files first — match their conventions instead of overriding them.

Common Errors & Diagnosis

ErrorLikely causeFix
! Undefined control sequence. \fooMissing package or typo in command nameAdd the required \usepackage{...} or correct spelling
! LaTeX Error: File 'x.sty' not found.Package x is not installedtlmgr install x (TeX Live)
! Package hyperref Error: Wrong driverhyperref loaded before a driver-dependent packageMove \usepackage{hyperref} to the very end of the preamble
! Missing \endcsname insertedSpecial chars in \label{} or \ref{}Use only ASCII and : in labels: \label{sec:intro}
! Emergency stop.Syntax error near the top of the fileCheck first 20 lines for unbalanced braces or unmatched \begin/\end
! Package babel Error: Unknown option 'spanish'.Babel installed without Spanish patternstlmgr install babel-spanish
! LaTeX Error: Option clash for package xPackage loaded twice with different optionsLoad once with all options: \usepackage[opt1,opt2]{x}
No .pdf, .log truncatedInfinite loop or out of memoryCheck for \def\a{\a} loops or conflicting packages
fontspec warnings about Lora/LatoFonts not installed on this systemRemove \setmainfont{Lora} / \setsansfont{Lato} — lualatex falls back to Latin Modern

Output Contract

Return: created/modified .tex files, the compilation command, and key structural decisions. If fixing errors, include the root cause from .log analysis and which fix was applied.

Resources

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.