\begin{article}
Find the Right LaTeX Package Instantly — latex-packages Skill
Ask which package to use for any task and get the best recommendation with a rationale, alternatives, a working example, and loading order advice.

If you have spent any time writing LaTeX seriously, you know the drill: you need to do something specific — draw a table with merged cells, typeset a chemical formula, embed source code with syntax highlighting — and you open a browser tab to search for which package handles it. You find three Stack Overflow threads from different years, each recommending a different package. Some are deprecated. Some conflict with each other. None of the examples match your document class. Twenty minutes later you have a preamble full of \usepackage lines you do not fully understand, and the document still does not compile. This is the exact problem the latex-packages Claude Code skill is built to solve.
What latex-packages Does
The latex-packages skill is a Claude Code skill that acts as a package recommendation engine. You describe what you need — "a table with colored rows and merged cells," "code listings with syntax highlighting," "APA-style citations," "a font that works with XeLaTeX," "a flowchart" — and the skill returns:
- The best current package recommendation for your specific use case
- A rationale explaining why that package is preferred over alternatives
- The main alternatives, with notes on when you would choose them instead
- A minimal working example you can drop into your document immediately
- Loading order rules, since some packages must come before or after others
It covers the full range of LaTeX use cases: mathematics, tables, graphics and diagrams, citations and bibliography, typography, fonts, algorithms, colors, listings, page layout, hyperlinks, and more. The recommendations reflect current CTAN best practices, not advice from 2011 Stack Overflow threads.
This is particularly useful if you are building PDF generation systems on top of FormatEx — the LaTeX compilation API. When you are generating LaTeX programmatically and need to know which package to load for a given output feature, having the right answer immediately (with a working example to test against) saves a significant amount of iteration time when hitting the FormatEx API.
How to Install
The skill lives in the latex-skills GitHub repository. You have four install options depending on how much of the skill set you want.
Install only the latex-packages skill:
cp -r skills/latex-packages ~/.claude/skills/Install the full LaTeX meta-skill bundle (includes packages, error fixing, markup, math, and more):
cp -r skills/latex ~/.claude/skills/Install the FormatEx meta-skill (LaTeX skills plus FormatEx API integration skills):
cp -r skills/formatex ~/.claude/skills/Install everything at once:
cp -r skills/latex-full ~/.claude/skills/After copying, the skill is immediately available in Claude Code. No configuration required.
The Before and After
To make this concrete, here is a realistic scenario: you need to produce a PDF report with a data table that has alternating row colors, a top rule that is thicker than the other rules, and two columns that span merged headers.
Before the skill — the manual process:
You search "latex table alternating colors" and find references to xcolor, colortbl, booktabs, tabularx, longtable, and tabu. You read that tabu is unmaintained. You find that colortbl requires xcolor. You try to combine booktabs with colortbl and hit a known conflict with \rowcolor and \midrule. You find a workaround involving \arrayrulecolor. You still need multirow for the merged headers, which is a separate package. After an hour you have something that mostly works but you are not confident about the loading order or whether you have introduced subtle spacing bugs.
After the skill:
You open Claude Code and type: /latex-packages I need a table with alternating row colors, thick top and bottom rules, thin inner rules, and merged column headers.
The skill responds with a recommendation to use booktabs for rules combined with xcolor and colortbl for row colors, plus multirow for merged headers. It explains that booktabs should load before colortbl to avoid the \midrule color bleed issue. It gives you a minimal working example:
\documentclass{article}
\usepackage{booktabs}
\usepackage[table]{xcolor}
\usepackage{multirow}
\begin{document}
\begin{table}[ht]
\centering
\rowcolors{2}{gray!15}{white}
\begin{tabular}{@{}lll@{}}
\toprule
\multicolumn{2}{c}{Header Group A} & Header B \\
\cmidrule(r){1-2}
Col 1 & Col 2 & Col 3 \\
\midrule
Data & Data & Data \\
Data & Data & Data \\
\bottomrule
\end{tabular}
\end{table}
\end{document}You paste it into your document, compile it via FormatEx, and it works. Total time: under two minutes.
If you run into a compilation error with the result, the latex-fix-errors skill handles diagnosis and correction. If you need to write the surrounding markup, the latex-write-markup skill covers that workflow.
Common Use Cases
1. Tables
Table packages in LaTeX have a fragmented ecosystem. The skill cuts through the noise: booktabs for publication-quality rules, tabularx for fixed-width tables with auto-stretching columns, longtable for tables that span pages, tabularray when you need modern syntax that combines all of the above. The skill explains trade-offs so you pick the right one for your document class and output target.
2. Math and Equations
When you need to go beyond basic equation environments, the skill recommends the right AMS packages (amsmath, amssymb, mathtools) and specialty packages (siunitx for units and numbers, physics for bracket notation, bm for bold math symbols). The latex-math-equations skill goes deeper if you are writing heavy mathematical content, but latex-packages handles the "what do I load?" question first.
3. Citations and Bibliography
The natbib vs biblatex question comes up constantly. The skill explains when to use biblatex with biber (most new documents), when natbib is still the right call (journal submission templates that require it), and how citation style packages like cite interact with both. See also the latex-citations-bibliography skill for hands-on bibliography workflow help.
4. Fonts and Typography
XeLaTeX and LuaLaTeX unlock system font usage via fontspec. pdfLaTeX has a different set of font packages (lmodern, libertinus, newtxtext, microtype for microtypography). The skill identifies which font approach fits your engine and gives you the correct \usepackage invocations. This matters if you are building a PDF pipeline on FormatEx where the engine choice is configurable — see getting started with FormatEx for engine selection in the API.
5. Code Listings
listings is the traditional choice; minted gives better syntax highlighting but requires --shell-escape and Python's Pygments library. For PDF generation via API (including the FormatEx Go client or the PHP Laravel integration), shell-escape availability matters. The skill flags this constraint and recommends listings with a custom style when shell-escape is not available, or minted when it is.
6. Graphics and Diagrams
graphicx for including images, tikz for programmatic drawing, pgfplots for data plots, forest for tree structures, chemfig for chemical structures. Each has different complexity trade-offs. The skill gives you the entry point package plus notes on common companion packages (tikzlibrary imports, pgfplotsset boilerplate).
Loading Order Matters
One of the most practical aspects of the skill is that it surfaces loading order rules, which are poorly documented and a common source of hard-to-debug errors. Examples it will catch and explain:
hyperrefshould almost always be loaded last (with a handful of documented exceptions likeglossaries)cleverefmust load afterhyperrefxcolorwith thetableoption must load beforecolortblbiblatexmust load beforehyperrefin some configurationsamsmathshould load beforeunicode-math
If you want to understand what a package actually does once you have found the right one, the latex-explain-commands skill covers command-level explanation. For structuring the overall document, the latex-document-structure skill handles document class selection and preamble organization.
Related Skills
The latex-packages skill fits into a broader set of LaTeX skills for Claude Code:
- latex-fix-errors — diagnose and fix compilation errors
- latex-write-markup — write LaTeX markup for a given content description
- latex-math-equations — typeset mathematical content correctly
- latex-document-structure — choose document class and organize preamble
- latex-citations-bibliography — manage references and bibliography
- latex-explain-commands — understand what any LaTeX command does
If you are building a LaTeX-to-PDF pipeline, the FormatEx API handles the compilation side. Clients are available for Ruby on Rails, serverless AWS Lambda, and other environments. The skills handle the LaTeX authoring side.
Get Started
Install the skill from the latex-skills repository and stop guessing which of five table packages to use. The skill gives you the right answer for your specific use case in seconds, with a working example you can immediately test.
If you are compiling LaTeX programmatically, FormatEx provides a REST API that handles TeX Live infrastructure so you do not have to. The latex-packages skill and FormatEx together cover the two hardest parts of LaTeX PDF generation: knowing what to write, and reliably compiling it.
\end{article}
\related{posts}




