Agent skill

Latex Polish

by flonat in flonat/flonat-research

Inspect a cleanly compiling LaTeX document for source pathologies and rendered visual defects by linting and viewing selected PDF pages.

MITAuto-check passedDocuments & Office

Install Latex Polish

skills CLI
$ npx skills add flonat/flonat-research --skill latex-polish -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install flonat/flonat-research latex-polish --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/flonat/flonat-research.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/latex-polish .claude/skills/latex-polish && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
latex-polish
GitHub stars
146
Token cost
~2.3k tokens
SKILL.md length
913 words
Files
3 (incl. references)
Skills in repo
83
Repo updated
First seen
Licence
MIT

At a glance

Inspect a cleanly compiling LaTeX document for source pathologies and rendered visual defects by linting and viewing selected PDF pages.

  • Works in 7 steps: Pre-flight → Source-pathology re-run (Phase 4 of latex) → Page selection → …
  • Compilation succeeds but title pages
  • SKILL.md covers When to Use, When NOT to Use, Inputs and Hard Rules, plus 4 more sections
  • Calls pdftoppm and brew

What it does

Latex Polish is an agent skill from flonat/flonat-research. Inspect a cleanly compiling LaTeX document for source pathologies and rendered visual defects by linting and viewing selected PDF pages. Use when compilation succeeds but title pages, floats, tables, figures, or layout still need publication-quality review. Not for basic compilation health; use $latex-health-check.

Its SKILL.md is about 2.3k tokens, which your agent loads only when the skill is triggered. The skill folder holds 3 other files, including reference files (for example `references/quality-rubric.md` and `references/vision-prompts.md`).

It sits in Documents & Office, covering LaTeX and Linting and formatting. It works with LaTeX. The repository describes itself as: Shareable Claude Code + Codex infrastructure for PhD researchers — skills, agents, hooks, and rules for academic workflows. The licence is MIT.

When your agent uses it

  • Compilation succeeds but title pages
  • Layout still need publication-quality review

Example prompts

  • “/latex-polish”

Requirements

  • Pre-approved tools (allowed-tools): Bash(ls*, mkdir*, cp*, pdftoppm*, pdftocairo*, pdfinfo*, grep*, sed*, awk*, find*, chktex*, latexindent*, cat*, head*, tail*, wc*, sort*, uniq*, rm*, mktemp*), Read, Write, Edit, Glob, Grep

Workflow steps

7 steps, taken from the step headings in SKILL.md.

  1. Pre-flight
  2. Source-pathology re-run (Phase 4 of latex)
  3. Page selection
  4. Page rendering
  5. Vision analysis
  6. Report consolidation
  7. Quality score

What it can do on your machine

Read from SKILL.md and the folder at commit da27600. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Bash(ls*
    • mkdir*
    • cp*
    • pdftoppm*
    • pdftocairo*
    • pdfinfo*
    • grep*
    • sed*
    • awk*
    • find*

    …and 15 more on the same allowed-tools line.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • pdftoppm
    • brew

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Latex Polish loads about 2.3k tokens when it runs, and up to ~5k if it reads all its reference files. Until then it costs about 82 tokens; SKILL.md has 913 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~82
When it runs · the whole SKILL.md, loaded when a task matches
~2.3k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~5k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from flonat/flonat-research at commit da27600, republished under its MIT licence (© flonat). 913 words, ~2,279 tokens.

Download SKILL.mdSave it as .claude/skills/latex-polish/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
latex-polish
description
Inspect a cleanly compiling LaTeX document for source pathologies and rendered visual defects by linting and viewing selected PDF pages. Use when compilation succeeds but title pages, floats, tables, figures, or layout still need publication-quality review. Not for basic compilation health; use $latex-health-check.
allowed-tools
Bash(ls*, mkdir*, cp*, pdftoppm*, pdftocairo*, pdfinfo*, grep*, sed*, awk*, find*, chktex*, latexindent*, cat*, head*, tail*, wc*, sort*, uniq*, rm*, mktemp*), Read, Write, Edit, Glob, Grep
argument-hint
[tex-path] [--no-vision] [--pages 'auto|1,3,5']
skill-dependencies
latex

LaTeX Polish — Source Lint + Vision-On-Rendered-PDF

Heavier-weight visual-quality review than latex. Combines the Phase 4 source-pathology lint with vision-model inspection of selected rendered PDF pages. Designed to catch the failure class that latex Phase 4 source-grep misses: blank pages, clipped tables, illegible shrunken figures, weird title-page line spacing that the regex couldn't fingerprint, bad float placement, overlap.

When to Use

  • Pre-submission visual check on a paper, proposal, thesis, or deck
  • After major restructuring (new sections, table re-layouts, figure swaps) when you want eyes on the rendered output
  • When latex reports a clean build but something still "looks weird"
  • When preparing for a panel / supervisor read where presentation matters

When NOT to Use

NeedUse instead
Compile-fix looplatex
Citation auditlatex (Phase 5) or bib-validate
Prose / academic-argument reviewproofread
Single-figure analysisfigure-feedback
Continuous integrationThis skill renders + vision-inspects pages; too expensive to run on every save

Inputs

  • .tex path — auto-discovered or user-provided. Prefer the user's argument.
  • PDF path — assumed at <project>/<basename>.pdf (per latex convention). If absent or older than .tex, the skill aborts and suggests latex first.
  • --no-vision — skip the vision-rendering phases (Page rendering onward), run the source-pathology lint only.
  • --pages auto|N,N,N — page selection override. Default auto.

Hard Rules

  1. Do not compile. This skill presupposes a clean PDF. If the PDF is missing or stale, abort and suggest latex first.
  2. Read-only with respect to source files. Exception: Pattern-1 (spacing-hack) opt-in fix, which is offered with a diff and only applied on explicit user yes.
  3. No deploy actions. This skill produces a report; it does not commit, push, or modify build infrastructure.
  4. Cap render cost. Max 8 pages rendered per invocation. If page selection would exceed 8, prioritise: title page, worst-overfull page, first table/figure page, then arbitrary sample.
  5. Cap vision-prompt cost. One Read per rendered page. No per-page back-and-forth.

Protocol — 7 Phases

Phase 1: Pre-flight
  1. Resolve .tex path. If a directory was given, find main.tex or single .tex inside.
  2. Resolve PDF path: <dirname>/<basename without .tex>.pdf. If missing or older than .tex, abort with: "Stale or missing PDF — run latex first."
  3. Verify pdftoppm is on PATH. If not, abort with install hint (brew install poppler on macOS).
  4. Create render dir: mktemp -d /tmp/latex-polish.XXXXXX. Track this as $RENDER_DIR.
Phase 2: Source-pathology re-run (Phase 4 of latex)

Run the 9 grep-based source-pathology detectors from <skills-root>/latex/references/source-pathologies.md, plus chktex and latexindent -k if installed. Collect findings into a structured list.

This phase is identical to latex Phase 4 and is rerun here for self-containment (so latex-polish can be invoked without a prior latex run).

Phase 3: Page selection

Determine which pages to vision-inspect. Default auto:

PageWhyMandatory if available
1Title / cover — high-stakes visual real estate; title-page failure mode is commonYes
Page containing any overfull vbox > 50ptVertical overflow is almost always visually brokenYes
Page containing the largest overfull hboxThe "worst" horizontal overflow seenYes
First page containing a tableTables produce the most common visual pathologiesYes
First page containing a figureSameIf figures exist
Last body page before bibliographyCatches widow/orphan and end-of-content layout issuesIf pages > 5
Bibliography page 1Citation formatting + hanging indent regressionsIf bib exists

If overfull-box locations are not known (no log file or out/main.log missing), skip those entries. Cap total at 8 pages; if the selection would exceed 8, drop the lowest-priority entries.

Pull overfull-box page locations by reading <project>/out/<basename>.log:

bash
awk '/Overfull \\(v|h)box/ { for(i=1;i<=NF;i++) if($i ~ /\[[0-9]+\]/) print substr($i,2,length($i)-2) }' out/main.log | sort -u

For each candidate page, also record WHY it was selected (used to pick the right vision-prompt later).

Show full SKILL.md (331 more words)Show less
Phase 4: Page rendering
bash
for P in $SELECTED_PAGES; do
    pdftoppm -r 150 -f $P -l $P -png "$PDF" "$RENDER_DIR/page-$P"
done

150 DPI is enough for layout analysis without ballooning file sizes. Each PNG lands at $RENDER_DIR/page-<N>-<P>.png (pdftoppm pads the page number).

Phase 5: Vision analysis

For each rendered page, Read the PNG and apply the per-page-type prompt from references/vision-prompts.md:

  • Title page prompt: focuses on alignment, line-spacing consistency, weight hierarchy, vertical block separation, font-size jumps
  • Body page prompt: focuses on paragraph spacing, hyphenation/justification artefacts, ragged margins, widow/orphan lines, float positioning
  • Table/figure page prompt: focuses on caption position, alignment with surrounding text, legibility at this rendered size, clipping, awkward whitespace
  • Bibliography page prompt: focuses on hanging indent, entry alignment, consistent inter-entry spacing
  • General prompt: catches anything unmatched

Each Read produces a structured finding list per page. Output schema per page:

Page N (selection reason: "title page" | "overfull at L<line>" | …):
  - Finding 1: <one-sentence description> [Tier: Major/Moderate/Minor]
  - Finding 2: …
  Verdict: PASS / NOTES / REVISE

If --no-vision was passed, skip Phases 3–5 entirely.

Phase 6: Report consolidation

Write the polish report to <project>/reviews/<paper-slug>/latex-polish/<YYYY-MM-DD-HHMM>.md (per rules/review-artefact-routing.md), where <paper-slug> is the paper being reviewed (e.g. paper-jtp, paper-philtech):

markdown
# LaTeX Polish Report — YYYY-MM-DD HH:MM

**Document:** <path>
**PDF age:** <minutes/hours since last build>
**Pages rendered for vision:** N
**Source detectors run:** 9 grep + chktex + latexindent

## Source pathologies (Phase 2)

<table from Phase 4 spec>

## Per-page vision findings (Phase 5)

### Page 1 — title
<verdict and findings>

### Page <N> — <reason>
<verdict and findings>

...

## Consolidated verdict

PASS / NOTES / REVISE — based on the worst finding tier across both phases.

## Suggested remediations

<prioritised list, max 10 items>
Phase 7: Quality score

Read references/quality-rubric.md. Compute deductions across:

  • Source-pathology findings (mirrors latex rubric)
  • Vision findings (this skill's distinct contribution)

Verdict thresholds per skills/shared/quality-scoring.md. Append the Score Block to the report.

Pattern-1 opt-in auto-fix

If Phase 2 detects a Pattern-1 (spacing-hack) issue, the report includes an **Offer:** block:

markdown
**Offer:** Wrap `<env-name>` in `\begin{singlespace}…\end{singlespace}` and delete the negative kerns at L<N1>, L<N2>. Apply? (Y/N)

Wait for explicit user approval. If yes, apply via narrow Edit calls and recompile via latexmk. If no, leave the report as-is. Do not silently apply.

This is the only auto-fix offered. All other findings are report-only.

What latex-polish does NOT do

  • Compile or fix compile errors (use latex first)
  • Modify prose or argument (proofread covers that)
  • Audit citations (latex Phase 5 or bib-validate)
  • Replace figure-feedback for standalone figure-file analysis
  • Auto-commit, auto-push, or modify settings.json / hooks / rules

Cross-references

Skill / FileRelationship
latexCompile + Phase 4 grep lint + citation audit. latex-polish is the deeper sibling for visual-quality review.
figure-feedbackVision pattern this skill reuses for per-page analysis
proofreadProse / argument review; non-overlapping concern
<skills-root>/latex/references/source-pathologies.mdShared detector catalogue
rules/review-artefact-routing.mdWhere the polish report is filed
rules/manuscript-edit-budget.mdWhy this skill is report-only by default

© flonat, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 2 other files (references) in skills/latex-polish of flonat/flonat-research.

  • SKILL.md
  • references/quality-rubric.md
  • references/vision-prompts.md

Open the folder on GitHubat commit da27600

Compare with similar skills

Latex Polish next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Latex Polish compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Latex Polish this skillflonat/flonat-research146—~2.3kAutomated safety check: PassMIT
Tikz Figure Code0xE1337/thesis-figure-skill1441 repos~1.2kAutomated safety check: PassMIT
Research Writingalfonso0512/research-writing-skill4901 repos~818Automated safety check: PassMIT
Paper WritingMLNLP-World/Paper-Writing-Tips4.7k—~630Automated safety check: PassNone
Evomath TaoEvoScientist/EvoSkills4782 repos~3.8kAutomated safety check: PassApache-2.0
PaperjurySpark-To-Paper-Skills/paperjury1.2k—~5.3kAutomated safety check: PassMIT

Similar skills

  • Tikz Figure Code

    0xE1337/thesis-figure-skill

    写出高质量、一次过编译、编辑安全的 TikZ/LaTeX 配图代码的工程基础技能. An agent skill from 0xE1337/thesis-figure-skill.

    144 GitHub starsUsed in 1 repo~1.2k tokens
    Documents & OfficeAuto-check passed
  • Research Writing

    alfonso0512/research-writing-skill

    科研论文写作助手,提供 30 个 Prompt 模板覆盖论文写作全流程. An agent skill from alfonso0512/research-writing-skill.

    490 GitHub starsUsed in 1 repo~818 tokens
    Documents & OfficeAuto-check passed
  • Paper Writing

    MLNLP-World/Paper-Writing-Tips

    学术论文写作检查与优化助手。基于 MLNLP-World 社区整理的论文写作技巧,帮助检查和优化学术论文。Use when: (1) 检查论文 LaTeX 格式和排版, (2) 优化公式符号使用, (3) 改进图表设计, (4) 润色英文学术表达, (5) 检查参考文献格式, (6) 投稿前终稿检查, (7) 用户询问论文写作技巧或规范。

    4.7k GitHub stars~630 tokensUpdated 14 days ago
    Documents & OfficeAuto-check passed
  • Evomath Tao

    EvoScientist/EvoSkills

    A skill your agent uses whenever the user submits a non-trivial mathematical claim that needs a rigorous proof or audit.

    478 GitHub starsUsed in 2 repos~3.8k tokens
    Documents & OfficeAuto-check passed
  • Paperjury

    Spark-To-Paper-Skills/paperjury

    Three modes for CS-conference papers (CVPR/ICCV/ECCV vision, ACL/EMNLP/NAACL NLP, ICLR/NeurIPS/ICML/AAAI ML).

    1.2k GitHub stars~5.3k tokensUpdated 1 mo ago
    Documents & OfficeAuto-check passed
  • Thesis Defense PPTX Builder

    zouchenzhen/thesis-defense-pptx-skill

    Builds an editable thesis defense PowerPoint from a thesis PDF or LaTeX project while preserving a supplied university or lab template, then runs a visual quality check.

    266 GitHub stars~2.4k tokensUpdated 4 mo ago
    Documents & OfficeAuto-check passed

More from flonat/flonat-research

All 83 skills in this repo
  • Latex Posters

    flonat/flonat-research

    Create a large-format academic poster in LaTeX using beamerposter, tikzposter, or baposter.

    146 GitHub stars~1.5k tokensUpdated 11 days ago
    Auto-check: notes
  • Skill Creator

    flonat/flonat-research

    Create, revise, and evaluate reusable AI workflow skills, including trigger-quality tests.

    146 GitHub stars~4.4k tokensUpdated 11 days ago
    Auto-check passed
  • DOCX

    flonat/flonat-research

    Create, read, edit, or convert Microsoft Word documents while preserving professional document structure.

    146 GitHub stars~1.2k tokensUpdated 11 days ago
    Auto-check passed
  • PDF

    flonat/flonat-research

    Read, create, combine, split, rotate, OCR, watermark, secure, or extract content from PDF files.

    146 GitHub stars~488 tokensUpdated 11 days ago
    Auto-check passed
  • Init Project Orchestration

    flonat/flonat-research

    Create or migrate project-level agents, repeatable project workflows, and planning state from one client-neutral contract, then render repository-scoped adapters for both Claude Code and Codex.

    146 GitHub stars~1.6k tokensUpdated 11 days ago
    Auto-check passed
  • Pre Commit Audit

    flonat/flonat-research

    Deliver a fast pre-commit safety scan: file size, anonymity (author / affiliation strings in tex/bib), hardcoded secrets, and invisible-Unicode carriers.

    146 GitHub stars~2.8k tokensUpdated 11 days ago
    Auto-check: notes

Works with

Questions about Latex Polish

What does Latex Polish do?

Inspect a cleanly compiling LaTeX document for source pathologies and rendered visual defects by linting and viewing selected PDF pages. Latex Polish is an agent skill from flonat/flonat-research. Inspect a cleanly compiling LaTeX document for source pathologies and rendered visual defects by linting and viewing selected PDF pages.

When should I use Latex Polish?

Latex Polish fits situations like: compilation succeeds but title pages; layout still need publication-quality review.

How do I install Latex Polish in Claude Code?

Run `npx skills add flonat/flonat-research --skill latex-polish -a claude-code`. Or copy the skill folder (skills/latex-polish in flonat/flonat-research) into .claude/skills/latex-polish in your project. Claude Code loads it when a task matches its description.

How do I install Latex Polish in Codex?

Run `npx skills add flonat/flonat-research --skill latex-polish -a codex`. Or copy the skill folder (skills/latex-polish in flonat/flonat-research) into .agents/skills/latex-polish in your project. Codex loads it when a task matches its description.

Can I use Latex Polish in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add flonat/flonat-research --skill latex-polish -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/latex-polish, .gemini/skills/latex-polish, .github/skills/latex-polish and .opencode/skills/latex-polish in your project.

What does Latex Polish need to run?

Going by SKILL.md and its folder, Latex Polish needs the command-line tools its instructions call (pdftoppm and brew). Its frontmatter pre-approves these tools: Bash(ls*, mkdir*, cp*, pdftoppm*, pdftocairo*, pdfinfo*, grep*, sed*, awk*, find*, chktex*, latexindent*, cat*, head*, tail*, wc*, sort*, uniq*, rm*, mktemp*), Read, Write, Edit, Glob, Grep.

Does Latex Polish access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Latex Polish safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Latex Polish use?

Latex Polish is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Latex Polish use?

About 2.3k tokens (SKILL.md is roughly 9.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 2.7k tokens, read only when the agent opens those files.

What are the alternatives to Latex Polish?

Skills that share tags, products or a category with Latex Polish: Tikz Figure Code (0xE1337/thesis-figure-skill, 144 stars), Research Writing (alfonso0512/research-writing-skill, 490 stars), Paper Writing (MLNLP-World/Paper-Writing-Tips, 4.7k stars) and Evomath Tao (EvoScientist/EvoSkills, 478 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Latex Polish?

flonat (a GitHub user) maintains it in flonat/flonat-research, which has 146 GitHub stars. The repository holds 83 skills in this directory. The repository was last updated on September 29, 2026.

Source: flonat/flonat-research on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.