# Latex

> >

- **Type:** Skill
- **Install:** `agentstack add skill-hameefy-claude-latex-skill-claude-latex-skill`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [hameefy](https://agentstack.voostack.com/s/hameefy)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [hameefy](https://github.com/hameefy)
- **Source:** https://github.com/hameefy/claude-latex-skill
- **Website:** https://github.com/hameefy/claude-latex-skill/releases/latest

## Install

```sh
agentstack add skill-hameefy-claude-latex-skill-claude-latex-skill
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# LaTeX Skill

This skill governs the production of LaTeX output for a researcher in computational and
applied mathematics whose work spans numerical optimisation, deep learning theory, electrical
impedance tomography (EIT), regularisation theory, data-driven inversion, numerical analysis,
PINNs, and related areas. All output must satisfy the mathematical standards of journals such
as SIAM Journal on Scientific Computing, Inverse Problems, Mathematics of Computation, and
Journal of Computational Physics.

---

## Step 1. Classify the Request

Before writing anything, determine which of the **three** output modes applies.
Check for BEAMER MODE first, since it has the strongest surface signals.

### Beamer Mode  ← CHECK THIS FIRST

Produce a complete Beamer presentation (`.tex` file with `\documentclass{beamer}`) when
the request contains any of:

- The words "slides", "presentation", "beamer", "slide deck", "talk", "seminar",
  "conference talk", or "present my work on".
- A request to prepare a talk from a manuscript, paper draft, or set of results.
- A request for a "title slide", "table of contents slide", or named academic sections
  such as "introduction slide", "convergence results slide", "numerical experiments slide".

Proceed to **Step 2B** for the beamer preamble and **Step 3B** for beamer content rules.
Do NOT use the article preamble (Step 2) or article document structure (Step 4) for
Beamer Mode output.

**Content sourcing for Beamer Mode:**
- If the user supplies a complete manuscript or paper: extract content from it faithfully
  to populate each slide section.
- If the user supplies only a title, abstract, or partial notes: generate a fully
  structured template with `\todo{}` placeholders in every slide that lacks content.
- Never fabricate theorems, lemmas, or numerical results that were not provided.

### Document Mode

Produce a complete, standalone `.tex` file (preamble through `\end{document}`) using
`\documentclass{article}` when the request involves:

- A theorem, lemma, proposition, corollary, definition, or remark, with or without proof.
- A multi-step derivation or mathematical argument.
- A convergence analysis or complexity result.
- An algorithm presented alongside its theoretical justification.
- An introduction, related-work survey, or structured academic section.
- A self-contained report, technical note, or preprint draft.

Save the output as a `.tex` file and present it to the user for download.

### Snippet Mode

Produce raw LaTeX body content only (no `\documentclass`, no preamble, no
`\begin{document}`) when the request involves:

- A single equation or aligned system of equations.
- An algorithm or pseudocode block in isolation.
- A numerical results table.
- A TikZ figure or pgfplots graph.
- Any fragment intended to be inserted into the user's own template.

Deliver snippet output as a labelled code block in the chat, not as a file, unless the
user explicitly requests a file.

**When in doubt**, ask: "Should I produce a complete standalone document, a snippet, or a
Beamer presentation?"

---

## Step 2. Apply the Standard Preamble (Document Mode Only)

Use the preamble below verbatim. Do not improvise or abbreviate it.

```latex
\documentclass[11pt,a4paper]{article}

% ---------------------------------------------------------------
% Core mathematics packages
% ---------------------------------------------------------------
\usepackage{amsmath, amssymb, amsthm, mathtools}
\usepackage{bm}            % bold math symbols
\usepackage{dsfont}        % indicator function \mathds{1}

% ---------------------------------------------------------------
% Algorithms
% ---------------------------------------------------------------
\usepackage[ruled,vlined,linesnumbered]{algorithm2e}

% ---------------------------------------------------------------
% Graphics, figures, and plots
% ---------------------------------------------------------------
\usepackage{graphicx}
\usepackage{tikz}
\usepackage{pgfplots}
\pgfplotsset{compat=1.18}
\usepackage{subfigure}     % side-by-side figures
\usepackage{adjustbox}     % fallback rescaling for wide TikZ diagrams

% ---------------------------------------------------------------
% Tables
% ---------------------------------------------------------------
\usepackage{booktabs}
\usepackage{tabularx}
\usepackage{siunitx}       % decimal-aligned columns, SI units

% ---------------------------------------------------------------
% Cross-referencing and citations
% ---------------------------------------------------------------
\usepackage[numbers,sort&compress]{natbib}
\usepackage[colorlinks=true,linkcolor=blue,citecolor=blue,urlcolor=blue]{hyperref}
\usepackage[capitalise,noabbrev]{cleveref}

% ---------------------------------------------------------------
% Typography
% ---------------------------------------------------------------
\usepackage{microtype}
\usepackage{parskip}
\setlength{\parindent}{0pt}
\setlength{\parskip}{6pt}

% ---------------------------------------------------------------
% Page layout
% ---------------------------------------------------------------
\usepackage[margin=2.5cm]{geometry}

% ---------------------------------------------------------------
% Miscellaneous
% ---------------------------------------------------------------
\usepackage{xcolor}
\usepackage{todonotes}     % \todo{} markers for placeholders

% ---------------------------------------------------------------
% Theorem environments (amsthm)
% ---------------------------------------------------------------
\theoremstyle{plain}
\newtheorem{theorem}{Theorem}[section]
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{proposition}[theorem]{Proposition}
\newtheorem{corollary}[theorem]{Corollary}

\theoremstyle{definition}
\newtheorem{definition}[theorem]{Definition}
\newtheorem{assumption}{Assumption}
\newtheorem{example}[theorem]{Example}

\theoremstyle{remark}
\newtheorem{remark}[theorem]{Remark}

% ---------------------------------------------------------------
% Notation macros (computational and applied mathematics)
% ---------------------------------------------------------------
% Norms and inner products
\newcommand{\norm}[1]{\left\lVert #1 \right\rVert}
\newcommand{\normF}[1]{\left\lVert #1 \right\rVert_{\mathrm{F}}}
\newcommand{\ip}[2]{\left\langle #1,\, #2 \right\rangle}
\newcommand{\abs}[1]{\left\lvert #1 \right\rvert}

% Calculus and optimisation
\newcommand{\grad}{\nabla}
\newcommand{\Hess}{\nabla^2}
\newcommand{\Lapl}{\Delta}
\newcommand{\divergence}{\operatorname{div}}
\newcommand{\curl}{\operatorname{curl}}

% Function spaces
\newcommand{\Lp}[1]{L^{#1}}
\newcommand{\Sob}[2]{H^{#1}(#2)}
\newcommand{\SobZ}[2]{H^{#1}_0(#2)}

% Operators and matrices
\newcommand{\bA}{\mathbf{A}}
\newcommand{\bB}{\mathbf{B}}
\newcommand{\bJ}{\mathbf{J}}
\newcommand{\bK}{\mathbf{K}}
\newcommand{\bI}{\mathbf{I}}
\newcommand{\bx}{\mathbf{x}}
\newcommand{\by}{\mathbf{y}}
\newcommand{\bz}{\mathbf{z}}
\newcommand{\bu}{\mathbf{u}}
\newcommand{\bv}{\mathbf{v}}

% Probability and statistics
\newcommand{\E}{\mathbb{E}}
\newcommand{\Prob}{\mathbb{P}}
\newcommand{\Var}{\operatorname{Var}}
\newcommand{\Cov}{\operatorname{Cov}}
\newcommand{\indicator}{\mathbf{1}}

% Asymptotic notation
\newcommand{\bigO}[1]{\mathcal{O}\!\left(#1\right)}
\newcommand{\smallO}[1]{o\!\left(#1\right)}

% Common domains
\newcommand{\R}{\mathbb{R}}
\newcommand{\N}{\mathbb{N}}
\newcommand{\C}{\mathbb{C}}

% Regularisation (EIT / inverse problems)
\newcommand{\Reg}{\mathcal{R}}
\newcommand{\Forward}{\mathcal{F}}
\newcommand{\Tikhonov}[3]{\norm{#1 - #2}^2 + #3\,\Reg(#2)}

% Iterates and step sizes
\newcommand{\xk}{x_k}
\newcommand{\alphak}{\alpha_k}
\newcommand{\etak}{\eta_k}
```

---

## Step 2B. Beamer Preamble (Beamer Mode Only)

Use the preamble below for ALL Beamer presentations. Do NOT mix with the article preamble
in Step 2. The two preambles are mutually exclusive.

**Theme selection:** The default theme is `Madrid`. If the user specifies a different
standard theme (e.g., `Berlin`, `AnnArbor`, `Warsaw`, `Copenhagen`, `Frankfurt`,
`Singapore`, `Boadilla`, `CambridgeUS`), substitute it in `\usetheme{}`. Never invent
custom themes; use only named Beamer built-in themes.

**Color theme:** Default is `default` (matching the chosen outer theme's palette). If the
user requests a specific color theme (e.g., `dolphin`, `beaver`, `crane`, `orchid`,
`rose`, `seagull`, `seahorse`, `whale`, `wolverine`), apply it with `\usecolortheme{}`.

```latex
\documentclass[aspectratio=169,10pt]{beamer}
% aspectratio=169 gives 16:9 widescreen; use 43 for 4:3 if user requests it.

% ---------------------------------------------------------------
% Theme — change \usetheme{} to any standard Beamer theme name
% ---------------------------------------------------------------
\usetheme{Madrid}
% \usecolortheme{dolphin}   % Uncomment and change to apply a colour theme

% ---------------------------------------------------------------
% Core mathematics
% ---------------------------------------------------------------
\usepackage{amsmath, amssymb, amsthm, mathtools}
\usepackage{bm}

% ---------------------------------------------------------------
% Algorithms — use ONE of the two options below; comment out the other
% ---------------------------------------------------------------
% OPTION A: algorithm2e (recommended for pseudocode with line numbers)
\usepackage[ruled,vlined,linesnumbered]{algorithm2e}

% OPTION B: algorithmicx + algpseudocode (uncomment if preferred)
% \usepackage{algorithmic}
% \usepackage{algorithmicx}
% \usepackage{algpseudocode}

% ---------------------------------------------------------------
% Graphics and plots
% ---------------------------------------------------------------
\usepackage{graphicx}
\usepackage{tikz}
\usepackage{pgfplots}
\pgfplotsset{compat=1.18}
\usepackage{subfigure}

% ---------------------------------------------------------------
% Tables
% ---------------------------------------------------------------
\usepackage{booktabs}
\usepackage{tabularx}

% ---------------------------------------------------------------
% Theorem-like blocks — configurable style
% ---------------------------------------------------------------
% Beamer provides: theorem, lemma, corollary, proof, definition,
% example, block, alertblock, exampleblock — all built-in.
%
% For coloured framed boxes (tcolorbox style), uncomment below:
% \usepackage{tcolorbox}
% \tcbuselibrary{theorems,skins}
% Then define custom tcolorbox environments as needed (see Step 3B).

% ---------------------------------------------------------------
% Footnote citation control
% ---------------------------------------------------------------
\usepackage{perpage}   % resets footnote counter on each slide
\MakePerPage{footnote}

% ---------------------------------------------------------------
% Miscellaneous
% ---------------------------------------------------------------
\usepackage{xcolor}
\usepackage{multicol}  % for two-column slides

% ---------------------------------------------------------------
% Notation macros (shared with article mode for consistency)
% ---------------------------------------------------------------
\newcommand{\norm}[1]{\left\lVert #1 \right\rVert}
\newcommand{\ip}[2]{\left\langle #1,\, #2 \right\rangle}
\newcommand{\abs}[1]{\left\lvert #1 \right\rvert}
\newcommand{\grad}{\nabla}
\newcommand{\R}{\mathbb{R}}
\newcommand{\N}{\mathbb{N}}
\newcommand{\E}{\mathbb{E}}
\newcommand{\bigO}[1]{\mathcal{O}\!\left(#1\right)}
\newcommand{\xk}{x_k}
\newcommand{\alphak}{\alpha_k}
\newcommand{\etak}{\eta_k}
\newcommand{\bx}{\mathbf{x}}
\newcommand{\bg}{\mathbf{g}}
\newcommand{\bA}{\mathbf{A}}
\newcommand{\bJ}{\mathbf{J}}

% ---------------------------------------------------------------
% Presentation metadata — fill in before \begin{document}
% ---------------------------------------------------------------
\title[Short Title]{Full Title of the Presentation}
\subtitle{Subtitle or Paper Title (if applicable)}
\author[H.~Mohammad]{Hassan Mohammad}
\institute[BUK]{%
  Numerical Optimisation Research Group\\
  Department of Mathematical Sciences\\
  Faculty of Physical Sciences\\
  Bayero University, Kano, Nigeria
}
\date{\today}
```

---

## Step 3B. Beamer Content Standards (Beamer Mode Only)

### 3B.1 Section Structure — Flexible Defaults

The eight sections below are the default scaffold. The user may omit any section or
reorder them. When a section is omitted, remove its `\section{}` declaration and all
corresponding frames. Never leave an empty `\section{}` block.

| # | Section | `\section{}` name | Typical frame count |
|---|---|---|---|
| 1 | Title page | *(title frame, no section)* | 1 |
| 2 | Table of contents | *(TOC frame, no section)* | 1 |
| 3 | Introduction | `Introduction` | 2–3 |
| 4 | Literature review / Related work / Motivation | `Related Work` | 2–3 |
| 5 | Method / Algorithm | `Methodology` | 3–5 |
| 6 | Convergence results | `Convergence Analysis` | 2–4 |
| 7 | Implementation / Numerical experiments | `Numerical Experiments` | 2–3 |
| 8 | Conclusion / Further research | `Conclusion` | 1–2 |

If the user provides only a title or partial content, generate all eight sections with
`\todo{}` placeholder text inside each frame body. If the user provides a full manuscript,
populate each section from the manuscript, preserving mathematical notation exactly.

### 3B.2 Footnote Citations

Beamer Mode uses `\footnotemark` / `\footnotetext{}` pairs exclusively. There is NO
reference section at the end of the presentation; every cited source appears as a
footnote on the slide where it is first cited.

**Citation pattern — use verbatim:**

```latex
% Within slide body text, place the mark:
...as shown by La Cruz et al.\footnotemark{}...

% Immediately before \end{frame}, place the text:
\footnotetext{W.~La Cruz, J.~Mart\'{\i}nez, and M.~Raydan,
  ``Spectral residual method without gradient information for solving large-scale
  nonlinear systems of equations,''
  \textit{Math.\ Comp.}, vol.~75, no.~255, pp.~1429--1448, 2006.}
```

Rules for footnote citations:
1. Every `\footnotemark` must have a matching `\footnotetext` within the same `frame`.
2. Use `\MakePerPage{footnote}` (already in the preamble) so the counter resets per slide.
3. If more than two references appear on one slide, consider splitting the slide or using
   a smaller font for the `\footnotetext` entries: `{\tiny \footnotetext{...}}`.
4. Format: Author(s), ``Title,'' \textit{Journal/Proceedings}, vol., no., pp., Year.
   For books: Author(s), \textit{Title}, Publisher, Year.
5. Never list a reference in a `\footnotetext` that does not have a corresponding
   `\footnotemark` on the same slide.
6. If the user provides BibTeX keys without full details, supply the correct bibliographic
   entry from knowledge of the standard literature. If genuinely ambiguous, insert:
   `\footnotetext{\todo{Fill in full bibliographic details.}}`

### 3B.3 Theorem-like Blocks

**Default (Beamer built-in environments):** Use `\begin{theorem}`, `\begin{lemma}`,
`\begin{corollary}`, `\begin{definition}`, `\begin{proof}` directly inside frames.
Beamer styles these automatically with coloured headers matching the chosen theme.

```latex
\begin{frame}{Convergence Result}
  \begin{theorem}[Global Convergence]\label{thm:global}
    Let Assumptions~1 and~2 hold. If $\{x_k\}$ is the sequence generated by
    Algorithm~1, then
    \[
      \lim_{k \to \infty} \|F(x_k)\| = 0.
    \]
  \end{theorem}
  \footnotetext{\todo{Citation if theorem is from a paper.}}
\end{frame}
```

**Optional tcolorbox style (activate in preamble):** If the user requests coloured framed
boxes resembling the sample slides, uncomment the `tcolorbox` lines in the preamble and
add definitions such as:

```latex
\usepackage{tcolorbox}
\tcbuselibrary{theorems,skins}
\newtcbtheorem[number within=section]{thm}{Theorem}{%
  colback=blue!5, colframe=blue!40!black,
  fonttitle=\bfseries}{thm}
\newtcbtheo

…

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [hameefy](https://github.com/hameefy)
- **Source:** [hameefy/claude-latex-skill](https://github.com/hameefy/claude-latex-skill)
- **License:** MIT
- **Homepage:** https://github.com/hameefy/claude-latex-skill/releases/latest

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** yes
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-hameefy-claude-latex-skill-claude-latex-skill
- Seller: https://agentstack.voostack.com/s/hameefy
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
